• 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的资源关键字.

  • 相关阅读:
    NOIP 2017逛公园(记忆化搜索)
    NOIP 2012疫情控制 (二分+倍增+贪心)
    NOIP 2005过河(DP+路径压缩)
    P1198 [JSOI2008]最大数
    [Noip2016]蚯蚓
    [六省联考2017]期末考试
    六省联考:组合数问题
    蒜头君的兔子
    bzoj1015 [JSOI2008]星球大战starwar
    luogu P3370 【模板】字符串哈希
  • 原文地址:https://www.cnblogs.com/dunnice/p/640157.html
Copyright © 2020-2023  润新知