How do I set the main window title in a C# UWP application?

Posted: (EET/GMT+2)

 

If you are developing Windows 10 UWP (Universal) applications with C#, you might wish to customize your application title while the application is running. For example, you might want to display the application version number in the title, or the particular action the user is currently engaged with.

In the old times, you could say something like "MainForm.Title = myText", but this is slightly different in the UWP world. To set the title, you can use the class ApplicationView class for the namespace Windows.UI.ViewManagement.

Here's an example:

ApplicationView myView = ApplicationView.GetForCurrentView();
myView.Title = "This is the new title";

Happy UWP hacking!