public override void NotifyOfPropertyChange(string propertyName = "") { base.NotifyOfPropertyChange(propertyName); switch (propertyName) { case "SliderValue": int curIdx = findViewMode(ViewModes, SliderValue); string viewMode; int step; int itemHeight; parseViewMode(ViewModes[curIdx], out viewMode, out step, out itemHeight); ViewModeStepCommandModel commandModel = SubCommands .Where(c => c is ViewModeStepCommandModel) .First(c => (c as ViewModeStepCommandModel).SliderStep == step) as ViewModeStepCommandModel; if (commandModel != null) { this.HeaderIconExtractor = commandModel.HeaderIconExtractor; } if (_flvm.Parameters.ItemSize != SliderValue) { updateViewMode(_flvm, commandModel.Header, SliderValue); //Debug.WriteLine(commandModel.Header + SliderValue.ToString()); } break; } }
private static IEnumerable <ICommandModel> generateCommandModel() { foreach (string vm in ViewModes) { string viewMode; int step; int itemHeight; parseViewMode(vm, out viewMode, out step, out itemHeight); if (viewMode != null) { if (step == -1) { yield return(new SeparatorCommandModel()); } else { var scm = new ViewModeStepCommandModel(viewMode) { SliderStep = step }; if (itemHeight != 0) { scm.ItemHeight = itemHeight; } yield return(scm); } } } }