コード例 #1
0
 private void InitializeCommand(RoutedUICommand command, Func <bool> isVisibleHandler, Func <bool> isEnabledHandler, Func <bool> isCheckedHandler, Action commandHandler)
 {
     CommandList.Add(command);
     MenuHeaderTable.Add(command, command.Text);
     MenuIsVisibleTable.Add(command, isVisibleHandler);
     MenuIsEnabledTable.Add(command, isEnabledHandler);
     MenuIsCheckedTable.Add(command, isCheckedHandler);
     MenuHandlerTable.Add(command, commandHandler);
 }
コード例 #2
0
        private void InitializeCommand(string header, Func <bool> isVisibleHandler, Func <bool> isEnabledHandler, Func <bool> isCheckedHandler, Action commandHandler)
        {
            ICommand Command = new RoutedUICommand();

            CommandList.Add(Command);
            MenuHeaderTable.Add(Command, header);
            MenuIsVisibleTable.Add(Command, isVisibleHandler);
            MenuIsEnabledTable.Add(Command, isEnabledHandler);
            MenuIsCheckedTable.Add(Command, isCheckedHandler);
            MenuHandlerTable.Add(Command, commandHandler);
        }
コード例 #3
0
        private void InitializeCommand(string header, Func <bool> isVisibleHandler, Func <bool> isEnabledHandler, Func <bool> isCheckedHandler, Action commandHandler)
        {
            string   LocalizedText = Properties.Resources.ResourceManager.GetString(header, CultureInfo.CurrentCulture) !;
            ICommand Command       = new RoutedUICommand(LocalizedText, header, GetType());

            CommandList.Add(Command);
            MenuHeaderTable.Add(Command, LocalizedText);
            MenuIsVisibleTable.Add(Command, isVisibleHandler);
            MenuIsEnabledTable.Add(Command, isEnabledHandler);
            MenuIsCheckedTable.Add(Command, isCheckedHandler);
            MenuHandlerTable.Add(Command, commandHandler);
        }