public IndexCardRename(IndexCard sender) { InitializeComponent(); EditedGUID = sender.GetGUID(); this.IndexCardNewName.Text = sender.GetName(); this.IndexCardNewName.Focus(); this.IndexCardNewName.SelectAll(); //if we push enter we presume we pushed button "ok" RoutedCommand firstSettings = new RoutedCommand(); firstSettings.InputGestures.Add(new KeyGesture(Key.Enter, ModifierKeys.None)); CommandBindings.Add(new CommandBinding(firstSettings, Button_AcceptRename)); RoutedCommand SecondSettings = new RoutedCommand(); SecondSettings.InputGestures.Add(new KeyGesture(Key.Escape, ModifierKeys.None)); CommandBindings.Add(new CommandBinding(SecondSettings, Button_DiscardRename)); Globals.MultilangManager.TranslateUIComponent(this); this.Owner = App.Current.MainWindow; this.Left = this.Owner.Left + this.Owner.Width / 2 - this.Width / 2; this.Top = this.Owner.Top + this.Owner.Height / 2 - this.Height / 2; }
public IndexCardRename(IndexCard sender) { InitializeComponent(); RenameWho = sender; this.IndexCardNewName.Text = sender.GetName(); }