App.xaml配置
<Application x:Class="超級.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:超級" StartupUri="MainWindow.xaml"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>
代碼啟動
<Application x:Class="超級.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:超級" Startup="App_OnStartup"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>
private void App_OnStartup(object sender, StartupEventArgs e) { //NavigationWindow window = new NavigationWindow(); //window.Source = new Uri("MainWindow.xaml", UriKind.Relative); //window.Height = 800; //window.Width = 800; //window.WindowStartupLocation = WindowStartupLocation.CenterScreen; //window.Show(); Application app = new Application(); MainWindow mv = new MainWindow(); app.Run(mv); Application app1 = new Application(); app1.StartupUri = new Uri("MainWindow.xaml"); app1.Run(); }