WPF设置主窗口

<Application x:Class="testWpf.App"
    xmlns
="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x
="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri
="Window2.xaml">
    
<Application.Resources>
         
    
</Application.Resources>
</Application>

可以在App.xaml文件中设置StartupUri属性来决定哪个窗口是主要窗口

原文地址:https://www.cnblogs.com/timy/p/1607224.html