zoukankan      html  css  js  c++  java
  • WPF三种启动方式

    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)
            {
                
                //Application.Current.StartupUri = new Uri("com/view/TestWindow.xaml", UriKind.Relative);//在com/view目录下
                Application app = new Application();
                MainWindow mv = new MainWindow();
                app.Run(mv);
                Application.Current.Run(mv);
  • 相关阅读:
    一个强大的在线开发IDE: CodeRun Studio
    PyQuery: 一个类似jQuery的Python库
    jQuery的图片剪切插件
    SVN导出两个版本之间的差异文件
    javascript中的focus()光标定位
    零分,裸奔真危险
    Django 截取中英文混合字符串
    360与金山网盾
    20100301:IE6的葬礼
    两个与jQuery相关的资源:导航条与提示
  • 原文地址:https://www.cnblogs.com/wangyinlon/p/11470958.html
Copyright © 2011-2022 走看看