private void changeState(CommandListState state) { CommandAddControl = CommandListFactory.CreateControl(state); CommandAddControl.DataContext = CommandAddViewModel = CommandListFactory.CreateViewModel(state); CommandState = state; CommandAddViewModel.Transition += onStateChange; CommandAddViewModel.AddProgram += onCommandAdd; NotifyPropertiesChanged(nameof(CommandState), nameof(CommandAddViewModel), nameof(CommandAddControl)); }
public CommandListBaseViewModel CreateViewModel(CommandListState state) { switch (state) { case CommandListState.Buttons: return(new CommandListViewModel()); case CommandListState.Move: return(new CommandMoveViewModel()); case CommandListState.Turn: return(new CommandTurnViewModel()); } throw new NotImplementedException(nameof(state)); }
private UserControl createControl(CommandListState state) { switch (state) { case CommandListState.Buttons: return(new CommandListControl()); case CommandListState.Move: return(new CommandMoveControl()); case CommandListState.Turn: return(new CommandTurnControl()); } throw new NotImplementedException(nameof(state)); }
public CommandListStateEventArgs(CommandListState state) { this.State = state; }
public IUserControlProxy CreateControl(CommandListState s) => new UserControlProxy(createControl(s));
public virtual new void TransitionInvoke(CommandListState s) => base.TransitionInvoke(s);