UWP C#: How to make a framework element to full window mode
I am writing a uwp app that has multiple frameworkEelements. When a button is clicked, I want one of the FrameworkElement(In my app it is a usercontrol) to be in full window. I don't want a new window to be launched. (Similar to the behavior of media player element going to full window)
This seems trivial but I can't get it working. I tried the following and this seems to make the element go to full screen but there are issues like I am not getting button click events(app seems to be unresponsive sometimes)
private async void onSelectFullWindow(object sender, RoutedEventArgs e)
{
ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
Window.Current.Content = customElementToBeFullScreen;
}
I want to know in general how do we make an element enter full-screen mode without opening a new window.