1.通用静态快捷键绑定命令
cs: public static Key BtnReferHotKey = Key.F7; xaml: <UserControl.InputBindings> <KeyBinding Key="{x:Static common:Common.BtnReferHotKey}" Command="{Binding CmdSelectFromMaterial}" CommandParameter="{Binding ElementName=DgDataItem}" /> </UserControl.InputBindings>
2.xaml中的计算绑定
xmlns:Cal="clr-namespace:CalcBinding;assembly=CalcBinding" <DataGridTextColumn Width="130" Header="实际未税价" IsReadOnly="True" Binding="{Binding Cal:Binding MarketPrice*DiscountRate,StringFormat={}{0:f2}}" />
标签:xaml,绑定,CalcBinding,Key,注意事项,WPF From: https://www.cnblogs.com/mamaxiaoling/p/14557076.html