public TemplateDbTableEditorView()
 {
     InitializeComponent();
     InputBindings.Add(new KeyBinding(new DelegateCommand(() =>
     {
         TextBox tb = FindName("SearchTextBox") as TextBox;
         tb?.Focus();
     }), new KeyGesture(Key.F, ModifierKeys.Control)));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the HamburgerMenuEx class.
        /// </summary>
        public HamburgerMenuEx()
        {
            DefaultStyleKey = typeof(HamburgerMenuEx);

            SetResourceReference(DefaultItemFocusVisualStyleProperty, SystemParameters.FocusVisualStyleKey);
            SetResourceReference(ClientAreaAnimationProperty, SystemParameters.ClientAreaAnimationKey);

            InputBindings.Add(new KeyBinding(new GoBackCommand(this), Key.Left, ModifierKeys.Alt));
        }
Ejemplo n.º 3
0
 private void BindShortkey()
 {
     foreach (var child in Toolbar.Children)
     {
         if (child.GetType() == typeof(RibbonButton))
         {
             RibbonButton tlb         = (RibbonButton)child;
             KeyBinding   key         = new KeyBinding();
             string       strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3);
             if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU_TAM)))
             {
                 KeyGesture keyg = new KeyGesture(Key.H, ModifierKeys.Control);
                 key         = new KeyBinding(HoldCommand, keyg);
                 key.Gesture = keyg;
             }
             else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRINH_DUYET)))
             {
                 KeyGesture keyg = new KeyGesture(Key.S, ModifierKeys.Control);
                 key = new KeyBinding(SaveCommand, keyg);
             }
             else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA)))
             {
                 KeyGesture keyg = new KeyGesture(Key.M, ModifierKeys.Control);
                 key = new KeyBinding(ModifyCommand, keyg);
             }
             else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA)))
             {
                 KeyGesture keyg = new KeyGesture(Key.Delete, ModifierKeys.Shift);
                 key = new KeyBinding(DeleteCommand, keyg);
             }
             else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET)))
             {
                 KeyGesture keyg = new KeyGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift);
                 key = new KeyBinding(ApproveCommand, keyg);
             }
             else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET)))
             {
                 KeyGesture keyg = new KeyGesture(Key.R, ModifierKeys.Control | ModifierKeys.Shift);
                 key = new KeyBinding(RefuseCommand, keyg);
             }
             else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET)))
             {
                 KeyGesture keyg = new KeyGesture(Key.C, ModifierKeys.Control | ModifierKeys.Shift);
                 key = new KeyBinding(CancelCommand, keyg);
             }
             else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP)))
             {
                 KeyGesture keyg = new KeyGesture(Key.F1, ModifierKeys.None);
                 key = new KeyBinding(HelpCommand, keyg);
             }
             if (key != null)
             {
                 InputBindings.Add(key);
             }
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor
        /// </summary>
        public MetroWindow()
        {
            SetValue(WindowChrome.WindowChromeProperty, CreateWindowChromeObject());
            // Since the system menu had to be disabled, we must add this command
            var cmd = new RelayCommand(a => ShowSystemMenu(this), a => !IsFullScreen);

            InputBindings.Add(new KeyBinding(cmd, Key.Space, ModifierKeys.Alt));
            MetroWindowCreated?.Invoke(this, new MetroWindowCreatedEventArgs(this));
        }
        public MainWindow()
        {
            InitializeComponent();

            var a = ApplicationCommands.Help;

            CommandBindings.Add(new CommandBinding(ApplicationCommands.Help, HelpExecuted, HelpCanExecute));
            InputBindings.Add(new KeyBinding(ApplicationCommands.Help, new KeyGesture(Key.D, ModifierKeys.Alt)));
        }
Ejemplo n.º 6
0
        public MainWindow()
        {
            InitializeComponent();

            settingsWindow = new SettingsWindow(SettingsWindow_Closed);

            CheckCmdLineArgs();

            dataContext = new MainDataContext();
            DataContext = dataContext;
            InputBinding hotkeySettings = new InputBinding(new RelayCommand(c => OpenSettings(), c => true),
                                                           new KeyGesture(Key.F12, ModifierKeys.Shift | ModifierKeys.Control));

            InputBindings.Add(hotkeySettings);

            LoadSettings();

            //set sizes
            mainWindow.Height = SystemParameters.VirtualScreenHeight;
            mainWindow.Width  = SystemParameters.VirtualScreenWidth;
            mainGrid.RowDefinitions[0].Height = new GridLength(0.03 * mainWindow.Height);
            mainGrid.RowDefinitions[2].Height = new GridLength(0.15 * mainWindow.Height);
            mainGrid.RowDefinitions[1].Height = new GridLength(mainWindow.Height - mainGrid.RowDefinitions[0].Height.Value - mainGrid.RowDefinitions[2].Height.Value);
            btnCall.Width       = mainWindow.Width / 3;
            chatPopup.MaxWidth  = 400;
            chatPopup.MaxHeight = mainWindow.Height - 100;

            timer           = new Timer(settings.chat * 1000);
            timer.Elapsed  += Timer_Elapsed;
            timer.AutoReset = false;

            //TrueConf sdk init
            tc = new AxTrueConfCallX();

            tcHost.Focusable = false;
            tcHost.Child     = tc;
            tc.GotFocus     += Tc_GotFocus;

            //TrueCon sdk events
            tc.OnXAfterStart              += Tc_OnXAfterStart;
            tc.OnXLogin                   += Tc_OnXLogin;
            tc.OnXLoginError              += Tc_OnXLoginError;
            tc.OnServerConnected          += Tc_OnServerConnected;
            tc.OnServerDisconnected       += Tc_OnServerDisconnected;
            tc.OnIncomingChatMessage      += Tc_OnIncomingChatMessage;
            tc.OnIncomingGroupChatMessage += Tc_OnIncomingGroupChatMessage;
            tc.OnInviteReceived           += Tc_OnInviteReceived;
            tc.OnXNotify                  += Tc_OnXNotify;
            tc.OnAbookUpdate              += Tc_OnAbookUpdate;
            tc.OnConferenceCreated        += Tc_OnConferenceCreated;
            tc.OnConferenceDeleted        += Tc_OnConferenceDeleted;
            tc.OnXChangeState             += Tc_OnXChangeState;
            tc.OnLogout                   += Tc_OnLogout;

            Closing += MainWindow_Closing;
        }
Ejemplo n.º 7
0
        public NavigationPage(MainNavigationViewModel mainViewModel)
        {
            InitializeComponent();

            InputBindings.Add(new KeyBinding(mainViewModel.NewDestinationCommand,
                                             new KeyGesture(Key.Z, ModifierKeys.Control)));
            _viewModel  = mainViewModel;
            DataContext = mainViewModel;
            Loaded     += NavigationPage_Loaded;
        }
Ejemplo n.º 8
0
        public ExtensionsWindow(RootViewModel rootViewModel)
        {
            InitializeComponent();

            this.rootViewModel = rootViewModel;

            DataContext = rootViewModel.Extensions;

            InputBindings.Add(new InputBinding(new AnonymousCommand(OnCancel), new KeyGesture(Key.Escape, ModifierKeys.None)));
        }
Ejemplo n.º 9
0
        public MainWindow()
        {
            OrganizerVM organizerVM = Application.Current.TryFindResource("VModel") as OrganizerVM;

            foreach (var binding in organizerVM?.KeyBindings)
            {
                InputBindings.Add(binding);
            }
            InitializeComponent();
        }
Ejemplo n.º 10
0
 public PythonAppsSettings()
 {
     KeyBindingsController = new LocalKeyBindingsController(this);
     InputBindings.Add(new InputBinding(new DelegateCommand(() => {
         Model.SelectedApp?.ViewInExplorerCommand.Execute(null);
     }), new KeyGesture(Key.F, ModifierKeys.Control)));
     InputBindings.Add(new InputBinding(new DelegateCommand(() => {
         Model.SelectedApp?.ReloadCommand.Execute(null);
     }), new KeyGesture(Key.R, ModifierKeys.Control)));
 }
Ejemplo n.º 11
0
        public HelpWindow()
        {
            InitializeComponent();

            InputBindings.Add(new InputBinding(new AnonymousCommand(OnCancel), new KeyGesture(Key.Escape, ModifierKeys.None)));

            helpRootViewModel = new HelpRootViewModel();

            DataContext = helpRootViewModel;
        }
Ejemplo n.º 12
0
        public EquipmentExplorerWindow(RootViewModel rootViewModel)
        {
            InitializeComponent();

            equipmentExplorerViewModel = new EquipmentExplorerViewModel(rootViewModel);

            InputBindings.Add(new InputBinding(new AnonymousCommand(OnCancel), new KeyGesture(Key.Escape, ModifierKeys.None)));

            Loaded += EquipmentExplorerWindow_Loaded;
        }
Ejemplo n.º 13
0
        public RangeBar()
        {
            CommandBindings.Add(new CommandBinding(IncrementCommand, ExecuteIncrementCommand));
            CommandBindings.Add(new CommandBinding(DecrementCommand, ExecutedDecrementCommand));

            InputBindings.Add(new KeyBinding(DecrementCommand, Key.Left, ModifierKeys.None));
            InputBindings.Add(new KeyBinding(DecrementCommand, Key.Down, ModifierKeys.None));
            InputBindings.Add(new KeyBinding(IncrementCommand, Key.Right, ModifierKeys.None));
            InputBindings.Add(new KeyBinding(IncrementCommand, Key.Up, ModifierKeys.None));
        }
Ejemplo n.º 14
0
 private void BindCommands()
 {
     for (int i = 0; i <= 9; i++)
     {
         InputBindings.Add(new KeyBinding(Commands.NumCmd, Key.NumPad0 + i, ModifierKeys.None)
         {
             CommandParameter = i.ToString()
         });
     }
 }
        public WeaponsWindow(RootViewModel rootViewModel)
        {
            InitializeComponent();

            InputBindings.Add(new InputBinding(new AnonymousCommand(OnCancel), new KeyGesture(Key.Escape, ModifierKeys.None)));

            this.rootViewModel = rootViewModel;

            this.Loaded += WeaponsWindow_Loaded;
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Prepare bindings for each activity
        /// </summary>
        /// <param name="dependencyGraph"></param>
        private void PrepareBindings(DependencyGraph dependencyGraph)
        {
            foreach (var activity in Activities)
            {
                InputBindings.Add(activity.Id, new HashSet <IBinding>());
                OutputBindings.Add(activity.Id, new HashSet <IBinding>());
            }

            LongDependencies = dependencyGraph.LongDependencies;
        }
        public AdvancedSearchWindow(RootViewModel root)
        {
            InitializeComponent();

            this.root = root;

            InputBindings.Add(new InputBinding(new AnonymousCommand(Close), new KeyGesture(Key.Escape, ModifierKeys.None)));

            DataContext = root.AdvancedSearchViewModel;
        }
Ejemplo n.º 18
0
        public MainWindow(
            IAudioService audioService,
            IDictionaryService dictionaryService,
            IInputService inputService,
            IKeyStateService keyStateService)
        {
            InitializeComponent();

            this.audioService      = audioService;
            this.dictionaryService = dictionaryService;
            this.inputService      = inputService;
            this.keyStateService   = keyStateService;

            defaultPointSource    = inputService.PointSource;
            manualModePointSource = new MousePositionSource(Settings.Default.PointTtl)
            {
                State = RunningStates.Paused
            };

            managementWindowRequest        = new InteractionRequest <NotificationWithServicesAndState>();
            managementWindowRequestCommand = new DelegateCommand(RequestManagementWindow);
            toggleManualModeCommand        = new DelegateCommand(ToggleManualMode, () => !(defaultPointSource is MousePositionSource));
            quitCommand = new DelegateCommand(Quit);
            backCommand = new DelegateCommand(Back);

            //Setup key binding (Alt+M and Shift+Alt+M) to open settings
            InputBindings.Add(new KeyBinding
            {
                Command   = managementWindowRequestCommand,
                Modifiers = ModifierKeys.Alt,
                Key       = Key.M
            });
            InputBindings.Add(new KeyBinding
            {
                Command   = managementWindowRequestCommand,
                Modifiers = ModifierKeys.Shift | ModifierKeys.Alt,
                Key       = Key.M
            });

            //Setup key binding (Alt+Enter and Shift+Alt+Enter) to open settings
            InputBindings.Add(new KeyBinding
            {
                Command   = toggleManualModeCommand,
                Modifiers = ModifierKeys.Alt,
                Key       = Key.Enter
            });
            InputBindings.Add(new KeyBinding
            {
                Command   = toggleManualModeCommand,
                Modifiers = ModifierKeys.Shift | ModifierKeys.Alt,
                Key       = Key.Enter
            });

            Title = string.Format(Properties.Resources.WINDOW_TITLE, DiagnosticInfo.AssemblyVersion);
        }
Ejemplo n.º 19
0
        public BreadcrumbButton()
            : base()
        {
            CommandBindings.Add(new CommandBinding(SelectCommand, SelectCommandExecuted));
            CommandBindings.Add(new CommandBinding(OpenOverflowCommand, OpenOverflowCommandExecuted, OpenOverflowCommandCanExecute));

            InputBindings.Add(new KeyBinding(BreadcrumbButton.SelectCommand, new KeyGesture(Key.Enter)));
            InputBindings.Add(new KeyBinding(BreadcrumbButton.SelectCommand, new KeyGesture(Key.Space)));
            InputBindings.Add(new KeyBinding(BreadcrumbButton.OpenOverflowCommand, new KeyGesture(Key.Down)));
            InputBindings.Add(new KeyBinding(BreadcrumbButton.OpenOverflowCommand, new KeyGesture(Key.Up)));
        }
Ejemplo n.º 20
0
 public PopoutTabItem()
 {
     InputBindings.Add(new MouseBinding
     {
         Gesture = new MouseGesture {
             Modifiers = ModifierKeys.Control | ModifierKeys.Shift, MouseAction = MouseAction.LeftClick
         },
         Command          = PopoutManager.ShowPopupCommand,
         CommandParameter = this
     });
 }
Ejemplo n.º 21
0
        public TreeListView()
            : base()
        {
            CommandBindings.Add(new CommandBinding(OutlinerCommands.UnfocusEditor, new ExecutedRoutedEventHandler(UnfocusEditorCommand)));
            CommandBindings.Add(new CommandBinding(OutlinerCommands.FocusEditor, new ExecutedRoutedEventHandler(FocusEditorCommand)));

            InputBindings.Add(new KeyBinding(OutlinerCommands.IncIndent, new KeyGesture(Key.Right, ModifierKeys.Control)));
            InputBindings.Add(new KeyBinding(OutlinerCommands.DecIndent, new KeyGesture(Key.Left, ModifierKeys.Control)));

            HeaderVisible = Visibility.Collapsed;
        }
Ejemplo n.º 22
0
        public OpenFromGACDlg()
        {
            InitializeComponent();
            var cmd = new RelayCommand(a => {
                searchBox.Focus();
                searchBox.SelectAll();
            });

            InputBindings.Add(new KeyBinding(cmd, Key.E, ModifierKeys.Control));
            InputBindings.Add(new KeyBinding(cmd, Key.F, ModifierKeys.Control));
        }
Ejemplo n.º 23
0
        public ShortCutView()
        {
            InitializeComponent();

            var dataContext = (ShortCutViewModel)DataContext;
            //模式4
            var helloKeyGesture = new KeyGesture(Key.Decimal, ModifierKeys.Control);
            var helloKeyBinding = new KeyBinding(dataContext.Hello2Command, helloKeyGesture);

            InputBindings.Add(helloKeyBinding);
        }
Ejemplo n.º 24
0
        public MainWindow()
        {
            InitializeComponent();
            InputBindings.Add(new InputBinding(ApplicationCommands.SaveAs,
                                               new KeyGesture(Key.S, (ModifierKeys.Control | ModifierKeys.Shift))));

            var args = Environment.GetCommandLineArgs();

            // ReSharper disable InvertIf
            if (args.Length == 2)
            {
                if (File.Exists(args[1]))

                {
                    DataModel m       = null;
                    var       success = true;

                    try
                    {
                        m = DataModel.Open(args[1]);
                    }
                    catch (Exception)
                    {
                        success = false;
                    }

                    if (success && m != null)
                    {
                        DataContext = m;
                    }
                    else
                    {
                        MessageBox.Show(this, "Project could not be opened.");
                    }
                }
            }
            // ReSharper restore InvertIf


            //var values = Enum.GetValues(typeof(EntityType));
            //foreach (var eb in
            //	from EntityType etype in values
            //	select etype.GetType().GetMember(etype.ToString())[0].GetCustomAttributes(typeof(ClassLinkAttribute))
            //	into props
            //	select (props as IList<Attribute> ?? props.ToList())
            //	into attributes
            //	select attributes.Cast<ClassLinkAttribute>().FirstOrDefault()
            //	into eb
            //	where eb != null
            //	select eb)
            //{
            //	Model.Entities.Insert(0, (EntityBase)Activator.CreateInstance(eb.LinkType));
            //}
        }
Ejemplo n.º 25
0
 public MainWindow(bool enableUnsafe)
 {
     InitializeComponent();
     DataContext  = _vm = new MainWindowViewModel();
     EnableUnsafe = enableUnsafe;
     InputBindings.Add(new InputBinding(new DelegateCommand(() =>
     {
         Settings.Default.IsDarkTheme = !Settings.Default.IsDarkTheme;
         Settings.Default.Save();
     }), new KeyGesture(Key.F12)));
 }
Ejemplo n.º 26
0
        public CollectionControl()
        {
            Items = new ObservableCollection <object>();
            CommandBindings.Add(new CommandBinding(ApplicationCommands.New, AddNew, CanAddNew));
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Delete, Delete, CanDelete));
            CommandBindings.Add(new CommandBinding(ComponentCommands.MoveDown, MoveDown, CanMoveDown));
            CommandBindings.Add(new CommandBinding(ComponentCommands.MoveUp, MoveUp, CanMoveUp));

            InputBindings.Add(new KeyBinding(ApplicationCommands.Delete, Key.Delete, ModifierKeys.None));
            InputBindings.Add(new KeyBinding(ApplicationCommands.Delete, Key.Back, ModifierKeys.None));
        }
        private async void SkillSelectorWindow_Loaded(object sender, RoutedEventArgs e)
        {
            await Dispatcher.Yield(DispatcherPriority.SystemIdle);

            //IList<SkillViewModel> skills = await GlobalData.Instance.GetSkills();
            //SkillSelector.Skills = skills;

            InputBindings.Add(new InputBinding(new AnonymousCommand(OnCancel), new KeyGesture(Key.Escape, ModifierKeys.None)));

            IsDataLoading = false;
            IsDataLoaded  = true;
        }
Ejemplo n.º 28
0
        public ImageViewerWindow()
        {
            InitializeComponent();

            CommandBindings.Add(new CommandBinding(ComponentCommands.ScrollPageUp, OnScrollPageUpCommand));
            CommandBindings.Add(new CommandBinding(ComponentCommands.ScrollPageDown, OnScrollPageDownCommand));
            CommandBindings.Add(new CommandBinding(NextImage, OnNextImageCommand, OnNextImageCommandCanExecute));
            CommandBindings.Add(new CommandBinding(PreviousImage, OnPreviousImageCommand, OnPreviousImageCommandCanExecute));
            InputBindings.Add(new InputBinding(ComponentCommands.ScrollPageDown, new KeyGesture(Key.Space)));
            InputBindings.Add(new InputBinding(NextImage, new KeyGesture(Key.Right)));
            InputBindings.Add(new InputBinding(PreviousImage, new KeyGesture(Key.Left)));
        }
        public DecorationsOverrideWindow(RootViewModel rootViewModel)
        {
            InitializeComponent();

            this.rootViewModel = rootViewModel;

            decorationsOverrideViewModel = new DecorationsOverrideViewModel(GlobalData.Instance.Jewels, ProvideSaveSlotInfo);

            InputBindings.Add(new InputBinding(new AnonymousCommand(OnCancel), new KeyGesture(Key.Escape, ModifierKeys.None)));

            DataContext = decorationsOverrideViewModel;
        }
Ejemplo n.º 30
0
        public EquipmentOverrideWindow(RootViewModel rootViewModel)
        {
            InitializeComponent();

            this.rootViewModel = rootViewModel;

            rootViewModel.EquipmentOverride.SetSaveSelector(ProvideSaveSlotInfo);

            InputBindings.Add(new InputBinding(new AnonymousCommand(OnCancel), new KeyGesture(Key.Escape, ModifierKeys.None)));

            this.Loaded += EquipmentOverrideWindow_Loaded;
        }