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 }); } }
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 }); } }