I need to call an xaml file from a click event and I am using c# for my development. I have created the Xaml file and done with the design part in it, now I need to call this xaml file from my application. I tried the following
NavigationService.Navigate(new Uri("/xxx.xaml", UriKind.Relative));
but it gives me the following error,
unauthorized access exception was unhandled.
Invalid cross-thread access.
What's going wrong with this? I am calling this xaml file in between one of my functions where I need to show this screen designated with .xaml
.