WPF 精修篇 非UI进程后台更新UI进程
标签:public begin params str keyword led ali vat rap
原文:WPF 精修篇 非UI进程后台更新UI进程
-
-
-
-
-
-
"Horizontal" Margin="0" VerticalAlignment="Center">
-
-
"beginText" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="100" VerticalAlignment="Top" Width="100"/>
-
-
"endText" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="1000000000" VerticalAlignment="Top" Width="100"/>
-
-
-
-
"odd" TextWrapping="Wrap" Text="奇数数量:"/>
-
"even" TextWrapping="Wrap" Text="偶数数量:"/>
-
-
-
-
private int evencount =0;
-
public void Make(int from ,int to)
-
-
for (int i = from; i
-
-
-
-
-
-
-
-
-
-
-
-
private void Button_Click(object sender, RoutedEventArgs e)
-
-
-
-
if(int.TryParse(beginText.Text,out from)&&int.TryParse(endText.Text,out to) )
-
-
button.IsEnabled = false;
-
ThreadPool.QueueUserWorkItem(_ =>
-
-
-
Dispatcher.BeginInvoke(new Action(() =>
-
-
odd.Text = "奇数数量:" + oddcount;
-
even.Text = "偶数数量:" + evencount;
-
-
-
-
-
-
-
-
-
Dispatcher.BeginInvoke(new Action(() =>
-
-
-
WPF 精修篇 非UI进程后台更新UI进程
标签:public begin params str keyword led ali vat rap
原文地址:https://www.cnblogs.com/lonelyxmas/p/12075536.html
评论