private void RemoveZeroOnFocus(object sender, RoutedEventArgs e) { if (TextBoxAmount.Text == "0") { TextBoxAmount.Text = String.Empty; } TextBoxAmount.SelectAll(); }
//protected override void OnNavigatedTo(NavigationEventArgs e) //{ // if (e.NavigationMode != NavigationMode.Back) // { // var viewModel = (ModifyPaymentViewModel) DataContext; // var payment = e.Parameter as PaymentViewModel; // if (payment != null) // { // // This payment type will be ignored. Has to be set though. // viewModel.Init(PaymentType.Expense, payment.Id); // } // else if (e.Parameter?.GetType() == typeof(PaymentType)) // { // viewModel.Init((PaymentType) e.Parameter); // } // } // base.OnNavigatedTo(e); //} private void TextBoxOnFocus(object sender, RoutedEventArgs e) { TextBoxAmount.SelectAll(); }