Search code examples
wpfxamldesktop-application

Get product name in XAML


I'm developing a WPF desktop application and want the application's product name to be displayed as the title of the MainWindow. I wanted to know if there is a way in xaml to display the product name as the title. I don't want vb.net or C# codes I just want an XAML code.


Solution

  • You could add a reference to System.Windows.Forms.dll and use the static Application.ProductName property:

    <Window ...
           xmlns:winforms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
           Title="{x:Static winforms:Application.ProductName}">