- using Windows.UI.ViewManagement;
Step 3:
Copy and paste the following code to the cs page which will be called on button click event and will enable full screen if not and will be back to the current screens size if clicked again:
- private void fullScreenButton_Click(object sender, RoutedEventArgs e)
- {
- var view = ApplicationView.GetForCurrentView();
- if (view.IsFullScreenMode)
- {
- view.ExitFullScreenMode();
- }
- else
- {
- view.TryEnterFullScreenMode();
- }
- }
Step 4: Run your application and test yourself.