Home > Net >  WPF perform task. Click on the button in the callback start cannot be started
WPF perform task. Click on the button in the callback start cannot be started

Time:10-09

XAML code
 & lt; Button x: Name="startupdate" Content="start upgrade Margin"="is 68.718, 5" Grid. Row="0" is the Grid. The Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Height="28" Width="88" IsEnabled="False" Click="Update_Click"/& gt; 


C # code
 private void Update_Click (object sender, RoutedEventArgs e) 
{
Task task_Updata=https://bbs.csdn.net/topics/new Task (Senddata publishes the event);
Task_Updata. Start ();
//Senddata publishes the event ();
}


Task_Updata cannot be started

CodePudding user response:

There is no reason to not start, debugging, may be wrong

CodePudding user response:

Can't debugging, is to start, will start synchronization execution

CodePudding user response:

reference 1st floor stherix response:
there is no reason to not start, debugging, may be the wrong
debugging, don't start, will start to synchronous execution

CodePudding user response:

Try that in the run way

CodePudding user response:

Breakpoint on the Senddata publishes the event method, to determine whether there is a across threads operation mistakes,

CodePudding user response:

Senddata publishes the event function in the breaking point, and see if I can go in, and then step through

CodePudding user response:

IsEnabled="False" what do you want to do?

CodePudding user response:

refer to 7th floor hum ha ha hey hey sigh reply:
IsEnabled="False" what do you want to do?
this attribute changes in other operations
  •  Tags:  
  • C#
  • Related