惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - Warrior Sun

【再学WPF】模板 Tomcat修改service.xml性能调优 增加最大并发连接数 网站并发量的计算方法 计算并发用户数的五种方法 用户中心 - 博客园 你怎么看《周鸿祎自述:我的互联网方法论》这本书? 如何让SQLServer的 itemNum 字段 按照数字大小顺序排序 中文网页的字体 怎么用钓鱼小药 [转]红帽 Red Hat Linux相关产品iso镜像下载【百度云】 IIS7.0上传文件限制的解决方法 特殊符号 开源免费的天气预报接口API以及全国所有地区代码(国家气象局提供) 如何得到天气情况?在那个接口获取? Windows Update 时出现8024402C的错误 OC中copy的使用 Access自动编号的初始值设置及重置编号 在Excel中将数字转换为大写 [SharpZipLib 未能加载文件或程序集] 解决方法
【再学WPF】自定义样式
Warrior Sun · 2019-08-17 · via 博客园 - Warrior Sun

1、添加“资源字典”;

工程名称:WpfApp1
新建Styles文件夹;
创建“Dictionary1.xaml”的文件;

2、编辑样式;

    <SolidColorBrush x:Key="MainColor">#FF000000</SolidColorBrush>
    <SolidColorBrush x:Key="MainColor1">#FFFFFFFF</SolidColorBrush>

    <Style  TargetType="Button">
        <Setter Property="Background" Value="Blue"/>
    </Style>

    <Style TargetType="TextBox">
        <Setter Property="FontFamily" Value="微软雅黑"/>
        <Setter Property="FontSize" Value="23"/>
    </Style>

3、在App.xaml中引用样式

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/WpfApp1;component/Styles/Dictionary1.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

4、元素上添加样式

        <Button Content="主题颜色" Width="100" Height="40" Margin="545,82,155,328"/>
        <Button Content="主题颜色" Width="100" Height="40" Margin="545,127,155,283"/>

        <Button Content="外部样式" Width="100" Height="40" Margin="144,270,556,140" Background="{StaticResource MainColor}" Foreground="{StaticResource MainColor1}"/>