public CheckWindow(TotalPurchase totalPurchase, AfterPayMoney afterPayMoney) { this.totalPurchase = totalPurchase; this.afterPayMoney = afterPayMoney; InitializeComponent(); this.tbShouldMoney.Text = totalPurchase.TotalMoney.ToString(); this.txtPaidMoney.Text = this.tbShouldMoney.Text; this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() => this.txtPaidMoney.Focus())); this.txtPaidMoney.SelectionStart = this.txtPaidMoney.Text.Length; }