private void Init() { this.WindowStyle = WindowStyle.SingleBorderWindow; this.SizeToContent = SizeToContent.WidthAndHeight; this.ResizeMode = ResizeMode.NoResize; this.WindowStartupLocation = WindowStartupLocation.CenterOwner; this.Icon = BitmapFrame.Create(new Uri("pack://application:,,,/ico.ico", UriKind.RelativeOrAbsolute)); this.Closing += BaseDataForm_Closing; //Application.Current.Resources["appIcon"] as ImageSource; //Utils.AppIcon; // add BaseDataControl BaseControls = new BaseDataControl(); this.Content = BaseControls; // add dataControls ContentControls = new TDC(); BaseControls.gBase.Children.Add(ContentControls); MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); // add commands to BaseDataControl AppCommands.SetCommandBinding(CommandBindings, AppCommands.ApplyCommand, BApplyOnClick, IsValid); AppCommands.SetInputBinding(InputBindings, AppCommands.ApplyCommand, new KeyGesture(Key.Enter, ModifierKeys.Control)); BaseControls.bApply.Command = AppCommands.ApplyCommand; AppCommands.SetCommandBinding(CommandBindings, AppCommands.CancelCommand, BCancelOnClick); AppCommands.SetInputBinding(InputBindings, AppCommands.CancelCommand, new KeyGesture(Key.Escape)); BaseControls.bCancel.Command = AppCommands.CancelCommand; IsVisibleChanged += FormIsVisibleChanged; }
private void Init() { AppCommands.SetCommandBinding(CommandBindings, AppCommands.TestCommand, OnCommadExecute, OnConnectCommadExecute); ContentControls.bBackupPathShowDialog.Click += bBackupPathShowDialog; ContentControls.tbMaxBackups.PreviewTextInput += Utils.OnUnsignedIntPreviewTextInput; }