UWP C#: How to make a framework element to full window mode

karthik vr 31 Reputation points
2020-01-17T16:53:07.87+00:00

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.

Universal Windows Platform (UWP)
{count} votes