效果如下:
代码如下:
<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>
原文地址:https://www.cnblogs.com/vipsoft/p/11582248.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。