zoukankan      html  css  js  c++  java
  • VS工程添加资源文件

    1. 添加资源文件:

    2. 资源文件内写相应代码:

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:local="clr-namespace:MultiSerialPort.Resources">
        <Style TargetType="Label">
            <Setter Property="Foreground" Value="White"></Setter>
        </Style>
        <Style TargetType="Window">
            <Setter Property="Background" Value="LightGray"></Setter>
        </Style>
        
    </ResourceDictionary>

    3.  App.xaml文件添加资源:

    <Application x:Class="MultiSerialPort.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:local="clr-namespace:MultiSerialPort"
                 StartupUri="MainWindow.xaml">
        <Application.Resources>
             <ResourceDictionary>
                 <ResourceDictionary.MergedDictionaries>
                     <ResourceDictionary Source="Resources/Style.xaml"></ResourceDictionary>
                 </ResourceDictionary.MergedDictionaries>
             </ResourceDictionary>
        </Application.Resources>
    </Application>
  • 相关阅读:
    对象的实例化内存布局与访问定位
    方法区

    虚拟机栈
    运行时数据区
    类加载子系统
    JVM和Java体系架构
    JUnit概述
    HTML5CSS3_day03
    HTML5CSS3_day01
  • 原文地址:https://www.cnblogs.com/pangkang/p/6170349.html
Copyright © 2011-2022 走看看