WPF-使用资源字典时App.xaml配置

App.xaml:

<Application x:Class="ZhiBiXiaoBai.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:ZhiBiXiaoBai"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                
                <!-- 本文件中写样式 -->
                <ResourceDictionary>
                    <Style x:Key="NormalWinStyle" TargetType="{x:Type Window}">
                        <Setter Property="WindowStyle" Value="None" />
                    </Style>
                </ResourceDictionary>

                <!-- 样式字典_其他项目 -->
                <!--<ResourceDictionary Source="pack://application:,,,/项目名;component/Themes/MaterialDesignTheme.xaml" />-->
                <!-- 样式字典_本项目 -->
                <ResourceDictionary Source="/ZhiBiXiaoBai;component/Dictionarys/Lable_Dictionary.xaml"/>

                <!-- 语言字典 -->
                <!--<ResourceDictionary x:Name="Languag" Source="/项目名;component/Dictionarys/AppResource_en_US.xaml"/>
                    <ResourceDictionary x:Name="Language" Source="/项目名;component/Dictionarys/AppResource_zh_CN.xaml"/>-->
                
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

 

posted @ 2023-01-06 16:00  ꧁执笔小白꧂  阅读(230)  评论(0)    收藏  举报