private void Filter_GotFocus(object sender, EventArgs e) { if (FilterTaskText == "Поиск...") { FilterTaskText = ""; } else { FilterTBox.Dispatcher.BeginInvoke(new Action(() => FilterTBox.SelectAll())); } FilterTBox.Foreground = Brushes.Black; }
private void Filter_GotFocus(object sender, EventArgs e)//происходит когда элемент стает активным { if (((ViewModel.TasksFaveViewModel)DataContext).FilterTaskText == "Поиск...") { ((ViewModel.TasksFaveViewModel)DataContext).FilterTaskText = ""; } else { FilterTBox.Dispatcher.BeginInvoke(new Action(() => FilterTBox.SelectAll())); } FilterTBox.Foreground = Brushes.Black; }
private void manager_Loaded(object sender, RoutedEventArgs e) { FilterTBox.Focus(); }