How can I change the name of the start-up form without altering the system configuration

Asier 41 Reputation points
2021-10-28T16:03:22.907+00:00

Dear,

I have a solution in visual studio made with wpf and .net. When I change the name of 'mainwindow.xaml' I can't run the program.

I have tried right click on change name instead of changing the name manually it even like this does not make the necessary changes for the execution of the application to be successful. How can I change correctly the name of the wpf window?

thanks

Developer technologies | Windows Presentation Foundation
0 comments No comments
{count} votes

Accepted answer
  1. Peter Fleischer (former MVP) 19,341 Reputation points
    2021-10-28T16:19:10.927+00:00

    Hi,
    set StartupUri in App.xaml (C#) or Application.xaml (VB):

    <Application x:Class="WpfApp1.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:local="clr-namespace:WpfApp1"
                 StartupUri="Window075.xaml"/>
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.