Generally, Title Bar is not available in a Mobile application, this article explains about, how to add the custom Title Bar in Mobile & Desktop application.
Custom TitleBar
Steps
- Create the XAML template.
TextBlock: Add the TitleBar of the Text.
Button: Close button, placed to right side of the application.
- Button event handler call Application and exit to close the application,
- Set the ExtendViewInfoTitleBar property to true, this property allow developer overwrite the TitleBar.
- Pass XAML (stackpanel) control to the SetTitleBar function.
Run the application
Adaptive Code
What is Adaptive Code
Runs the code only specific device family is called Adaptive code.
The above application run all the platforms, developer want to run only the mobile device family, need to rewrite the code for mobile? No, check only one condition above code run only mobile application.
Check above API present running platform or not, if present application running in the mobile device.
ApiInformation.IsTypePresent function is used to check API present or not.
Add the control into the SetTitleBar function, if IsTypePresent condition is true,
Output in the MobileApplication,
Run the Application in Full Screen mode
Set the ApplicationViewWindowingMode. FullScreen, application is running in full screen mode,