zoukankan      html  css  js  c++  java
  • SystemFonts Class的典型用法?

    SystemFonts是一个字体资源类, 它的用法在下面代码中可以看出:

    <Button Margin="10, 10, 5, 5" Grid.Column="0" Grid.Row="3"     

         FontSize="{x:Static SystemFonts.IconFontSize}"

         FontWeight="{x:Static SystemFonts.MessageFontWeight}"

         FontFamily="{x:Static SystemFonts.CaptionFontFamily}">

         SystemFonts

    </Button>

    这段代码对应的C#代码是:

    Button btncsharp = new Button();

    btncsharp.Content = "SystemFonts";

    btncsharp.Background = SystemColors.ControlDarkDarkBrush;

    btncsharp.FontSize = SystemFonts.IconFontSize;

    btncsharp.FontWeight = SystemFonts.MessageFontWeight;

    btncsharp.FontFamily = SystemFonts.CaptionFontFamily;

    cv1.Children.Add(btncsharp);

     

    This example shows how to use the static resources of SystemFonts in order to style or customize a button.

    这个例子演示了如何使用SystemFonts的静态资源去定制一个button.

    SystemFonts is a class that contains both system font values and resources that bind to the values, for example, CaptionFontFamily is a SystemFonts value and CaptionFontFamilyKey is a corresponding resource key.

    SystemFonts类是一个既包含系统字体值又包含绑定到系统字体值的系统字体资源. 例如CaptionFontFamily是一个SystemFonts的值, CaptionFontFamilyKey是一个SystemFonts的资源关键字.

  • 相关阅读:
    简单实现 C# 与 Javascript的兼容
    如何写好CSS系列之表单(form)
    D3、openlayers的一次尝试
    如何写好css系列之button
    mockjs,json-server一起搭建前端通用的数据模拟框架
    AIX中的/etc/inittab文件
    AIX中crontab和at 定时任务
    AIX中的服务管理
    AIX系统的备份和恢复
    AIX中磁带设备的使用
  • 原文地址:https://www.cnblogs.com/dunnice/p/640157.html
Copyright © 2011-2022 走看看