Calling A Method On The UI Thread


	async void SomethingHappened()
	{
		await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
		{
			this.textBlock.Text = "Failure capturing video.";
		});
	}

Set New Screen Page From Other Threads


	async void SetMainScreenPage(int Page)
	{
		await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
		{
			Windows.UI.Xaml.Controls.Frame rootFrame = Windows.UI.Xaml.Window.Current.Content as Windows.UI.Xaml.Controls.Frame;
			switch (Page)
			{
			case 1:
				rootFrame.Navigate(typeof(MainPage));
				break;

			case 2:
				rootFrame.Navigate(typeof(PageTestIo));
				break;

			case 3:
				rootFrame.Navigate(typeof(PageEngineerConfig));
				break;
			}

		});
	}

 

Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *