1 Star 5 Fork 1

末叶 / DOC_WPFTOOLS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
图标字体使用.md 3.90 KB
一键复制 编辑 原始数据 按行查看 历史
末叶 提交于 2016-12-28 16:21 . Track 73 files into repository.

图标字体使用

例子

<StackPanel Margin="10">
    <TextBlock Style="{StaticResource TextBlockNormal}" FontWeight="Bold" TextWrapping="Wrap">使用ICONFONT图标字体 可使用的图标请查看 Lib下的IconFont/demo.html</TextBlock>
    <TextBlock Style="{StaticResource TextBlockNormal}">TextBlockIcon样式</TextBlock>
    <StackPanel Orientation="Horizontal" >
            <TextBlock Style="{StaticResource TextBlockIconFont}"  VerticalAlignment="Center">&#xe601;</TextBlock>
        <TextBlock Style="{StaticResource TextBlockNormal}" VerticalAlignment="Center" >今天</TextBlock>
    </StackPanel>
    <TextBlock Style="{StaticResource TextBlockNormal}">ButtonTextBlockIcon样式</TextBlock>
    <Button>
        <StackPanel Orientation="Horizontal">
            <TextBlock Style="{StaticResource ButtonTextBlockIconFont}" Foreground="Orange" Margin="3" >&#xe601;</TextBlock>
            <TextBlock  Text="确定" Margin="3"/>
        </StackPanel>
    </Button>
    <TextBlock Style="{StaticResource TextBlockNormal}" FontWeight="Bold" TextWrapping="WrapWithOverflow">使用FontAwesome图标字体 可使用的图标请查看 Lib下的Font Awesome/Font Awesome Cheatsheet.pdf</TextBlock>

    <StackPanel Orientation="Horizontal">
        <TextBlock Style="{StaticResource TextBlockFontAwesome}"  VerticalAlignment="Center">&#xf0ad; </TextBlock>
        <TextBlock  VerticalAlignment="Center" Style="{DynamicResource TextBlockNormal}"> 设置</TextBlock>
    </StackPanel>
    <Button>
        <StackPanel Orientation="Horizontal">
            <TextBlock Style="{StaticResource ButtonTextBlockFontAwesome}"  >&#xf2c0;</TextBlock>
            <TextBlock  Text="用户"/>
        </StackPanel>
    </Button>
    <TextBlock Style="{StaticResource TextBlockNormal}" FontWeight="Light" TextWrapping="WrapWithOverflow">使用时 尽量不要将图标和文字使用在同一个TextBlock中,否则可能字体会显示不正确</TextBlock>
    <TextBlock Style="{StaticResource TextBlockNormal}" FontWeight="Bold" TextWrapping="WrapWithOverflow">IconTextBlock</TextBlock>
    <WPFTools:IconTextBlock IconGeometry="{StaticResource RightArrow}" Text="右看" />
    <WPFTools:IconTextBlock  Text="{x:Null}" />
    <WPFTools:IconTextBlock IconSize="50" Text="坐标"  IconGeometry="F1 M 34,39.1716L 34,22.4583L 28,28.0833L 28,22.5833L 36,15.0833L 44,22.5833L 44,28.0833L 38,22.4583L 38,38L 54.625,38L 49,32L 54.5,32L 62,40L 54.5,48L 49,48L 54.625,42L 36.8284,42L 25.8284,53L 34,53L 30,57L 19,57L 19,46L 23,42L 23,50.1716L 34,39.1716 Z M 40.2533,47.5333L 37.8,52.345L 37.8,55L 36.0933,55L 36.0933,52.375L 33.7467,47.5333L 35.6683,47.5333L 36.8633,50.3183L 37.0333,50.9283L 37.055,50.9283L 37.22,50.34L 38.4717,47.5333L 40.2533,47.5333 Z M 48.52,37L 46.49,37L 45.1817,34.5683L 45.0283,34.0683L 45.0067,34.0683L 44.8317,34.59L 43.5183,37L 41.48,37L 43.9,33.2667L 41.6933,29.5333L 43.7717,29.5333L 44.855,31.7717L 45.0817,32.4017L 45.1033,32.4017L 45.3383,31.7517L 46.5317,29.5333L 48.4133,29.5333L 46.1783,33.235L 48.52,37 Z M 32.04,38L 25.96,38L 25.96,37.015L 29.835,31.92L 26.28,31.92L 26.28,30.5333L 32.04,30.5333L 32.04,31.4883L 28.2483,36.6133L 32.04,36.6133L 32.04,38 Z" />
    <WPFTools:IconTextBlock Text="44" FontAwesome="&#xf0ad;" IconFont="&#xe601;" Padding="5"   />
    <WPFTools:IconTextBlock Text="IsEnabled=False" IsEnabled="False" FontAwesome="&#xf0ad;"   />
    <WPFTools:IconTextBlock Text="44" FontAwesome="&#xf0ad;" IconFont="&#xe601;" IconForeground="OrangeRed" />
    <WPFTools:IconTextBlock Text="测试程序" FontWeight="Bold" Padding="1" FontAwesome="&#xf0ad;" IconFont="&#xe601;" IconDock="Top" IconSize="40"     />
    <WPFTools:IconTextBlock Text="测试程序" FontWeight="Light" Padding="1" FontAwesome="&#xf0ad;" IconFont="&#xe601;" IconDock="Bottom" IconSize="40" IsEnabled="False"  IconForeground="RoyalBlue"   />
</StackPanel>

样式

1
https://gitee.com/chenhome/DOC_WPFTOOLS.git
git@gitee.com:chenhome/DOC_WPFTOOLS.git
chenhome
DOC_WPFTOOLS
DOC_WPFTOOLS
master

搜索帮助