zoukankan      html  css  js  c++  java
  • WPF Button LinkButton 绑定多个值 Template

    效果如下:

     代码如下:

    <Button Click="InventoryDetail_OnClick" Template="{StaticResource InventoryButton}" />
    <!-- Link Button -->
    <ControlTemplate x:Key="InventoryButton" TargetType="{x:Type Button}">
        <TextBlock x:Name="txtInventory"  Cursor="Hand" Foreground="#4587F0" VerticalAlignment="Bottom"  HorizontalAlignment="Center" >
            <TextBlock.Text>
                <MultiBinding StringFormat="{}{0:###0.####}{1}{2:###0.####}{3}">
                    <Binding Path="deptMinQuantity"></Binding>
                    <Binding Path="minPackageUnit"></Binding>
                    <Binding Path="deptDisassemblyQty"></Binding>
                    <Binding Path="disassemblyUnit"></Binding>
                </MultiBinding>
            </TextBlock.Text>
        </TextBlock>
        <ControlTemplate.Triggers>
            <Trigger Property="IsFocused" Value="True"/>
            <Trigger Property="IsDefaulted" Value="True"/>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="TextDecorations" Value="Underline" TargetName="txtInventory">
                </Setter>
            </Trigger>
            <Trigger Property="IsPressed" Value="True"/>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="#FFD6D4D4"></Setter>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
  • 相关阅读:
    redis同步指定key数据到其他redis中
    Golang 生成随机数
    怎么理解“平均负载”? 进行分析等
    Golang打印空心金字塔for循环实现
    python十几行代码实现三级菜单
    mysql增量恢复
    python内建函数
    python练习题总结
    迭代器和生成器
    python基础数据类型
  • 原文地址:https://www.cnblogs.com/vipsoft/p/11582248.html
Copyright © 2011-2022 走看看