最近在学WPF的MVVM,有两种方式实现,一种是自己实现,一种是借助MVVM框架,接下来通过一个医院自助打印报告机键盘输入界面来演示自己实现、框架CommunityToolkit和Prism的区别。
项目源码:https://gitee.com/cplmlm/SelfServiceReportPrinter
https://github.com/cplmlm/SelfServiceReportPrinter
推荐学习博主:B站UP十月的寒流
一、自己实现
1、首先我们创建一个BaseNotifyPropertyChanged类,继承INotifyPropertyChanged,这个方法的作用是属性值变化时自动更新UI界面。- public class BaseNotifyPropertyChanged : INotifyPropertyChanged
- {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public event PropertyChangedEventHandler? PropertyChanged;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public void RaisePropertyChanged(string propertyName)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> if (!string.IsNullOrEmpty(propertyName))
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- }
复制代码 2、创建一个KeyPressViewModel类,继承BaseNotifyPropertyChanged。- public class KeyPressViewModel : BaseNotifyPropertyChanged
- {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> private string cardNumber;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> private int selectionStart=0;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// <summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 输入文本框的值
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// </summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public string CardNumber
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> get { return cardNumber; }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> set
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> cardNumber = value;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> RaisePropertyChanged(nameof(CardNumber));
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// <summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 输入框光标位置
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// </summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public int SelectionStart
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> get { return selectionStart; }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> set { RaisePropertyChanged(nameof(SelectionStart)); }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// <summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 数字按钮绑定事件
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// </summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public ICommand NumberCommand
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> get { return new RelayCommand<string>(Number); }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// <summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 清空按钮绑定事件
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// </summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public ICommand ClearCommand
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> get { return new RelayCommand(Clear); }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// <summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 删除按钮绑定事件<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// </summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public ICommand DeleteCommand
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> get { return new RelayCommand(Delete); }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// <summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 数字点击事件
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// </summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// <param name="key"></param>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> private void Number(string? key)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> CardNumber += key;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// <summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 清空点击事件
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// </summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> private void Clear()
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> CardNumber = string.Empty;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// <summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 删除点击事件
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// </summary>
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> private void Delete()
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> // 光标在输入框时,删除光标前一个字符
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> if (!string.IsNullOrEmpty(CardNumber) && SelectionStart > 0)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> CardNumber = CardNumber.Remove(SelectionStart - 1, 1);
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> //光标没有在输入框时,删除最后一个字符
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> if (SelectionStart == 0)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> CardNumber = CardNumber.Remove(CardNumber.Length - 1, 1);
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> }
- }
复制代码 3、创建RelayCommand类,这个类的作用是绑定事件的操作,一个泛型版本,一个是非泛型。- public class RelayCommand : ICommand
- {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private Action _execute;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private Func<bool> _canExecute;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public RelayCommand(Action execute) : this(execute, null)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public RelayCommand(Action execute, Func<bool> canExecute)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />if (execute == null)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />throw new ArgumentNullException("execute");
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />_execute = execute;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />_canExecute = canExecute;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public event EventHandler? CanExecuteChanged
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />add
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />if (_canExecute != null)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CommandManager.RequerySuggested += value;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />remove
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />if (_canExecute != null)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CommandManager.RequerySuggested -= value;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public bool CanExecute(object parameter)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />return _canExecute == null ? true : _canExecute();
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public void Execute(object parameter)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />_execute();
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- }
复制代码- public class RelayCommand<T> : ICommand
- {
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private readonly Predicate<T> _canExecute;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private readonly Action<T> _execute;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public RelayCommand(Action<T> execute) : this(execute, null)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public RelayCommand(Action<T> execute, Predicate<T> canExecute)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />if (execute == null)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />throw new ArgumentNullException("execute");
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />_execute = execute;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />_canExecute = canExecute;
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public event EventHandler? CanExecuteChanged
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />add { CommandManager.RequerySuggested += value; }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />remove { CommandManager.RequerySuggested -= value; }
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public bool CanExecute(object parameter)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />return _canExecute == null ? true : _canExecute((T)parameter);
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public void Execute(object parameter)
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />_execute((T)parameter);
- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
- }
复制代码 4、通过binding绑定输入框的值和事件的操作,代替传统直接在后台cs文件写事件。- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />
复制代码 5、将MainWindow的DataContext赋值给ViewModel,我这里用了依赖注入的方法,所以直接是在app.cs里面赋值的,也可以在MainWindow.cs。- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public partial class App : Application<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public App()<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />Services = ConfigureServices();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />this.InitializeComponent();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// Gets the current<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />instance in use<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public new static App Current => (App)Application.Current;<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// Gets the<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />instance to resolve application services.<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public IServiceProvider Services { get; }<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// Configures the services for the application.<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> private static IServiceProvider ConfigureServices()<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />var services = new ServiceCollection();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />services.AddTransient();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />services.AddTransient();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />services.AddTransient();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />services.AddTransient(sp=>new MainWindow() { DataContext=sp.GetRequiredService()});<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />return services.BuildServiceProvider();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />protected override void OnStartup(StartupEventArgs e)<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />base.OnStartup(e);<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />MainWindow= Services.GetRequiredService();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />MainWindow.Show();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
复制代码- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public partial class MainWindow : Window<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public MainWindow()<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />InitializeComponent();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />DataContext =App.Current.Services.GetService();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}
复制代码 6、如果不用依赖注入的方式,可以在MainWindow.xaml或者MainWindow.cs将MainWindow的DataContext赋值给ViewModel。- <TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />
复制代码- public partial class MainWindow : Window {<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> public MainWindow()<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> {<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> InitializeComponent();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> DataContext =new KeyPressViewModel();<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> } }
复制代码 以上就是自己去实现mvvm的方式,会比较繁琐,如果不是复杂的项目大多数还是用社区的CommunityToolkit.MVVM,复杂的项目可以使用Prism
二、使用微软社区的CommunityToolkit.MVVM
1、首先安装CommunityToolkit.MVVM的包。
2、创建一个新的类KeyPressViewModelCommunityToolkit类,继承ObservableObject,CommunityToolkit代码就简洁很多了,直接在方法或者属性上面加特性就可以。- public partial class KeyPressViewModelCommunityToolkit : ObservableObject{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />[ObservableProperty]<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private string cardNumber = string.Empty;<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />[ObservableProperty]<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private int selectionStart;<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 数字点击事件<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> ///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> [RelayCommand]<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private void Number(string? key)<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CardNumber += key;<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 清空输入框<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> [RelayCommand]<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private void Clear()<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CardNumber = string.Empty;<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 删除点击事件<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> [RelayCommand]<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private void Delete()<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />// 光标在输入框时,删除光标前一个字符<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />if (!string.IsNullOrEmpty(CardNumber) && SelectionStart > 0)<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CardNumber = CardNumber.Remove(SelectionStart - 1, 1);<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />//光标没有在输入框时,删除最后一个字符<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />if (SelectionStart == 0)<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CardNumber = CardNumber.Remove(CardNumber.Length - 1, 1);<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}}
复制代码 三、Prism
1、安装Prism.Core和Prism.Wpf,其他的包根据后续实际使用在安装。
2、创建一个KeyPressViewModelPrism类继承BindableBase。- public partial class KeyPressViewModelPrism : BindableBase{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private string cardNumber;<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />private int selectionStart;<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public string CardNumber<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />get { return cardNumber; }<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />set { SetProperty(ref cardNumber, value); }<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public int SelectionStart<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />get { return selectionStart; }<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />set { SetProperty(ref selectionStart, value); }<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public DelegateCommand NumberCommand { get; }<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public DelegateCommand ClearCommand { get; }<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public DelegateCommand DeleteCommand { get; }<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />public KeyPressViewModelPrism()<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />NumberCommand = new DelegateCommand(Number);<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />ClearCommand = new DelegateCommand(Clear);<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />DeleteCommand = new DelegateCommand(Delete);<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 数字点击事件<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> ///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> private void Number(string? key)<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CardNumber += key;<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 清空点击事件<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> private void Clear()<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CardNumber = string.Empty;<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> /// 删除点击事件<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />///<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /> private void Delete()<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />// 光标在输入框时,删除光标前一个字符<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />if (!string.IsNullOrEmpty(CardNumber) && SelectionStart > 0)<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CardNumber = CardNumber.Remove(SelectionStart - 1, 1);<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />//光标没有在输入框时,删除最后一个字符<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />if (SelectionStart == 0)<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />{<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />CardNumber = CardNumber.Remove(CardNumber.Length - 1, 1);<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}<TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" /><TextBox Text="{Binding CardNumber}" x:Name="CardNumberTextBox" local:TextBoxSelectionHelper.SelectionStart="{Binding SelectionStart, Mode=TwoWay}" Height="40" Width="460" />
- <Button Content="1" Command="{Binding NumberCommand}" CommandParameter="1"/>
- <Button Content="删除" Command="{Binding DeleteCommand}" />
- <Button Content="清空" Command="{Binding ClearCommand}" />}}
复制代码 四、总结
以上就是三种不同ViewModel的实现方式,个人比较推荐使用社区的CommunityToolkit,但是还是要根据自己的项目情况来决定。
来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |