Example #1
0
 private static void FanSpeedHighAttach(PlatformVisual visual, ICommandParameter parameter, IEnumerable <IViewModel> selection, ICompositionHost host, DocumentEditSite site)
 {
     if (!parameter.QueryService <ControlCommandParameter>().Any())
     {
         parameter.AttachService(new ControlCommandParameter()
         {
             Parameter = FanSpeed.High
         });
     }
 }
Example #2
0
 private static void FanSpeedLowAttach(PlatformVisual visual, ICommandParameter parameter, IEnumerable <IViewModel> selection, ICompositionHost host, DocumentEditSite site)
 {
     // This allows us to pass specific information to a common handler used by multiple commands. Otherwise, we would have redundant code for
     // three different commands
     if (!parameter.QueryService <ControlCommandParameter>().Any())
     {
         parameter.AttachService(new ControlCommandParameter()
         {
             Parameter = FanSpeed.Low
         });
     }
 }