public async Task <IButtonEndpoint> CreateDemoButton(string caption) { IButtonEndpoint result = null; await Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => { var button = new Button(); button.Content = caption; var endpoint = new UIButtonButtonEndpoint(button); endpoint.Connect(); DemoButtonStackPanel.Children.Add(button); result = endpoint; }); return(result); }
public async Task<IButtonEndpoint> CreateDemoButton(string caption) { IButtonEndpoint result = null; await Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => { var button = new Button(); button.Content = caption; var endpoint = new UIButtonButtonEndpoint(button); endpoint.Connect(); DemoButtonStackPanel.Children.Add(button); result = endpoint; }); return result; }