Esempio n. 1
0
        private static string GetPropertyName(ControlCommands.CommandId commandId)
        {
            string result = string.Empty;

            result = commandId.ToString();
            return(result);
        }
Esempio n. 2
0
        private static RoutedUICommand _EnsureCommand(ControlCommands.CommandId idCommand)
        {
            if (idCommand >= (ControlCommands.CommandId) 0 &&
                idCommand < ControlCommands.CommandId.Last)
            {
                lock (ControlCommands._internalCommands.SyncRoot)
                {
                    if (ControlCommands._internalCommands[(int)idCommand] == null)
                    {
                        RoutedUICommand routedUICommand = new RoutedUICommand(
                            ControlCommands.GetPropertyName(idCommand),
                            ControlCommands.GetPropertyName(idCommand),
                            typeof(ControlCommands));

                        ControlCommands._internalCommands[(int)idCommand] = routedUICommand;
                    }
                }
                return(ControlCommands._internalCommands[(int)idCommand]);
            }
            return(null);
        }