Beispiel #1
0
        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));
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
 public CommandListStateEventArgs(CommandListState state)
 {
     this.State = state;
 }
Beispiel #5
0
 public IUserControlProxy CreateControl(CommandListState s) => new UserControlProxy(createControl(s));
Beispiel #6
0
 public virtual new void TransitionInvoke(CommandListState s) => base.TransitionInvoke(s);