Skip to main content

Posts

Showing posts with the label UWP System

UWP - How to exit an app

UWP - Exit an app The following Universal Windows Platform application development tutorial demonstrates how we can exit from an app. In this UWP tutorial, we will call the CoreApplication class Exit() method to exit the app. We also get the current application object and call its Exit() method to exit the app. The CoreApplication class enables apps to handle state changes, manage windows, and integrate with a variety of UI frameworks. The CoreApplication class Exit() method shuts down the app. The Application class encapsulates a Windows Presentation Foundation application. The Application implements the singleton pattern to provide shared access to its window, property, and resource scope services. Consequently, only one instance of the Application class can be created per AppDomain. The Application class Current property gets the Application object for the current AppDomain. This property value is the Application object for the ...

UWP - How to resize app window during runtime

UWP - Resize app window at runtime The following Universal Windows Platform application development tutorial demonstrates how we can resize an app window during runtime. In this UWP tutorial, we will call the ApplicationView class GetForCurrentView() method to get the active application view instance. Then we will call TryResizeView() method to change the app window size during runtime. The ApplicationView class represents the active application view and associated states and behaviors. The ApplicationView class GetForCurrentView() method gets the view state and behavior settings of the active application. This method returns an ApplicationView instance that can be used to get and set app display properties. The ApplicationView class TryResizeView(Size) method attempts to change the size of the view to the specified size in effective pixels. The TryResizeView(Size value) method has a parameter names value. The value parameter is Siz...

UWP - How to launch app in full screen mode

UWP - Launch the app in full-screen mode The following Universal Windows Platform application development tutorial demonstrates how we can launch an app in full-screen mode. In this UWP tutorial, we will set the ApplicationView class PreferredLaunchWindowingMode property value to FullScreen to launch the app in full-screen mode. The ApplicationView class represents the active application view and associated states and behaviors. The ApplicationView class PreferredLaunchWindowingMode property gets or sets a value that indicates the windowing mode the app launches with. This property value is an ApplicationViewWindowingModeenumeration value that indicates the windowing mode of the app. By default, PreferredLaunchWindowingMode is set to Auto. The ApplicationViewWindowingMode enumeration defines constants that specify whether the app window is auto-sized, full-screen, or set to a specific size on launch. The enumeration value Ful...

UWP - How to set app launch window size

UWP - Set app launch window size The following Universal Windows Platform application development tutorial demonstrates how we can set the app launch window size programmatically. In this UWP tutorial, we will set the ApplicationView class PreferredLaunchViewSize property value to set the app window preferred launch view size. We will also set the ApplicationView class PreferredLaunchWindowingMode property value to set the app window preferred launch windowing mode. The ApplicationView class represents the active application view and associated states and behaviors. The ApplicationView class PreferredLaunchViewSize property gets or sets the size that the app launches with when the ApplicationView class PreferredLaunchWindowingMode property is set to PreferredLaunchViewSize, except in cases where the system manages the window size directly. The PreferredLaunchViewSize property value is a Size. The ApplicationView class PreferredLau...

UWP - How to set app window minimum size

UWP - Set app window minimum size The following Universal Windows Platform application development tutorial demonstrates how we can set the app window minimum size programmatically. Here we will get the current application view. Then we will set the minimum size for this app window using the ApplicationView class SetPreferredMinSize() method. The ApplicationView class represents the active application view and associated states and behaviors. The ApplicationView class GetForCurrentView() method gets the view state and behavior settings of the active application. This method returns an ApplicationView instance that can be used to get and set app display properties. The ApplicationView class SetPreferredMinSize(Size) method sets the smallest size, in effective pixels, allowed for the app window. The SetPreferredMinSize(Size minSize) method has a parameter named minSize. The minSize parameter value is a Size that is the smallest size allowed for ...

UWP - Get app screen size

MainPage.xaml <Page x:Class="UniversalAppTutorials.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:UniversalAppTutorials" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" > <StackPanel Background="Crimson" Padding="50"> <TextBlock x:Name="TextBlock1" FontFamily="MV Boli" FontSize="30" Foreground="Snow" TextWrapping="Wrap" /> </StackPanel> </Page> MainPage.xaml.cs using Windows.UI.Xaml.Controls; using Windows.UI.ViewManagement; using Windows.Graphics.Display; using Windows.Foundation; nam...