First of all, the WinForm can be implemented with This.invoke; The scheduler Control.Despite.invoke is used in WPF;
(Action) () =
{
}) and
New Action (() =
{
Button1. Content = "Action";
}) is equivalent to
usingSystem.Windows.Data;usingSystem.Windows.Documents;usingSystem.Windows.Input;usingSystem.Windows.Media;usingSystem.Windows.Media.Imaging;usingSystem.Windows.Navigation;usingSystem.Windows.Shapes;namespacewpfapplication1_weituotest{/// <summary> ///the interactive logic of MainWindow.xaml/// </summary> Public Partial classMainwindow:window { PublicMainWindow () {InitializeComponent (); } Private voidButton1_Click (Objectsender, RoutedEventArgs e) { //button1. Dispatcher.begininvoke (Action) (() =//{ //button1. Content = "Action"; //}));button1. Dispatcher.begininvoke (NewAction (() ={button1. Content="Action"; })); } }}
The application of c#の----func,action,predicate in WPF