Example #1
0
 /// <summary>
 ///    Fetches the default input gestures for the command by invoking the LoadDefaultGestureFromResource function on the owning type.
 /// </summary>
 /// <returns>collection of input gestures for the command</returns>
 private InputGestureCollection GetInputGestures()
 {
     if (OwnerType == typeof(ApplicationCommands))
     {
         return(ApplicationCommands.LoadDefaultGestureFromResource(_commandId));
     }
     else if (OwnerType == typeof(NavigationCommands))
     {
         return(NavigationCommands.LoadDefaultGestureFromResource(_commandId));
     }
     else if (OwnerType == typeof(MediaCommands))
     {
         return(MediaCommands.LoadDefaultGestureFromResource(_commandId));
     }
     else if (OwnerType == typeof(ComponentCommands))
     {
         return(ComponentCommands.LoadDefaultGestureFromResource(_commandId));
     }
     return(new InputGestureCollection());
 }
Example #2
0
 /// <summary>
 ///    Fetches the text by invoking the GetUIText function on the owning type.
 /// </summary>
 /// <returns>The text for the command</returns>
 private string GetText()
 {
     if (OwnerType == typeof(ApplicationCommands))
     {
         return(ApplicationCommands.GetUIText(CommandId));
     }
     else if (OwnerType == typeof(NavigationCommands))
     {
         return(NavigationCommands.GetUIText(CommandId));
     }
     else if (OwnerType == typeof(MediaCommands))
     {
         return(MediaCommands.GetUIText(CommandId));
     }
     else if (OwnerType == typeof(ComponentCommands))
     {
         return(ComponentCommands.GetUIText(CommandId));
     }
     return(null);
 }