Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        view = gameObject.AddComponent <SetView>();

        view.SetSoundMask(GameManager.instance.Sound);

        //Sound button
        view.Btn_Sound.onClick.AddListener(delegate() {
            view.SetSoundMask();
            DataModel.SaveData();
            AudioManager.instance.PlayControl();
        });

        view.Btn_Collect.onClick.AddListener(delegate() {
            GameManager.instance.CreatePanel(PanelType.AuthorPanel);
        });
        view.Btn_Forum.onClick.AddListener(delegate() {
            GameManager.instance.CreatePanel(PanelType.AuthorPanel);
        });
        view.Btn_WebSite.onClick.AddListener(delegate() {
            GameManager.instance.CreatePanel(PanelType.AuthorPanel);
        });


        //Return button
        view.Return.onClick.AddListener(delegate() {
            Destroy(gameObject);
        });
    }
Ejemplo n.º 2
0
    private void OnButtonSetClick()
    {
        SetModel = new SetModel();
        SetView  = (SetView)UIFactory.Instance.GetUIView("SetView");
        SetView.Show();

        SetModel.OnValueChange += SetView.UpdateView;
        SetModel.UpdataData();
    }
Ejemplo n.º 3
0
 private void Enter()
 {
     if (mSetView == null)
     {
         mSetView = ResourceManage.Instance.LoadPrefab("SetView").AddComponent <SetView>();
     }
     else
     {
         mSetView.gameObject.SetActive(true);
     }
 }
Ejemplo n.º 4
0
 public void Navigate()
 {
     if (isFirstPage)
     {
         isFirstPage = false;
         Page entry = new SetView(setVM);
         this.Content = entry;
     }
     else
     {
         Page simulator = new FlightSimulatorView(flightSimVM);
         this.Content = simulator;
         //  flightSimVM.VM_IsPlay = true;
     }
 }
Ejemplo n.º 5
0
 public SetViewPresenter(MainView mainView, SetView setView)
 {
     _setView  = setView;
     _mainView = mainView;
     _mainView.btnDel.Click                 += BtnDelDeleteTopic_Click;
     _setView.btnCode.Click                 += BtnCode_Click;
     _setView.btnBold.Click                 += BtnBold_Click;
     _setView.btnUnderline.Click            += BtnUnderline_Click;
     _setView.btnItalic.Click               += BtnItalic_Click;
     _setView.MainContent.SelectionChanged  += MainContent_SelectionChanged;
     _setView.MainContent.KeyDown           += MainContent_KeyDown;
     _setView.btnClear.Click                += BtnClear_Click;
     _setView.InputNewTopicName.TextChanged += InputNewTopicName_TextChanged;
     _setView.btnNewOldTopicSave.Click      += OnBtnNewOldTopicSave_Click;
     _setModel = StaticFactory.GetSelectedSetModel(SetModel.SelectedSet);
     _setView.TopicListbox.MouseClick   += TopicListbox_MouseClicked;
     _setView.btnAddVideos.MouseClick   += BtnAddVideos_MouseClick;
     _setView.TopicListbox.SelectedIndex = 0;
     PopulateTopicListbox();
 }
Ejemplo n.º 6
0
        public async void ChangeUserInterfaceState(UserInterfaceStates newState, object paramater = null)
        {
            if (newState == UserInterfaceStates.Main && _userInterfaceStack.Count == 1)
            {
                Application.MainPage = _navigation;
                return;
            }

            if (_userInterfaceStack.Contains(newState))
            {
                PopToState(newState);
                return;
            }

            _userInterfaceStack.Push(newState);

            switch (newState)
            {
            case UserInterfaceStates.AddWorkoutDefinition:
                var addworkoutDefinitionLibrary = App.Container.Resolve <IWorkoutDefinitionLibraryViewModel>();
                var addWorkoutDefinition        = App.Container.Resolve <IAddWorkoutDefinitionViewModel>();
                var addWorkoutDefinitionView    = new AddWorkOutDefinitionView();
                addWorkoutDefinitionView.BindingContext = addWorkoutDefinition;
                await _navigation.PushAsync(addWorkoutDefinitionView);

                break;

            case UserInterfaceStates.ViewWorkoutDefinition:
                var workoutDefinitionLibrary      = App.Container.Resolve <IWorkoutDefinitionLibraryViewModel>();
                var selectedWorkoutDefinitionView = new WorkOutDefinitionView();
                selectedWorkoutDefinitionView.BindingContext = workoutDefinitionLibrary.SelectedWorkoutDefinition;
                await _navigation.PushAsync(selectedWorkoutDefinitionView);

                break;

            case UserInterfaceStates.WorkoutView:
                var selectedWorkout = App.Container.Resolve <ISessionLogViewModel>()
                                      .SelectedSession
                                      .SelectedWorkout;
                var selectedWorkoutView = new WorkOutDetailView(selectedWorkout);
                selectedWorkoutView.BindingContext = selectedWorkout;
                await _navigation.PushAsync(selectedWorkoutView);

                break;

            case UserInterfaceStates.SetView:
                var setSessionLogViewModel = App.Container.Resolve <ISessionLogViewModel>();
                var selectedSet            = setSessionLogViewModel.SelectedSession.SelectedWorkout.SelectedSet;
                var setView = new SetView(selectedSet);
                setView.BindingContext = selectedSet;
                await _navigation.PushAsync(setView);

                break;

            case UserInterfaceStates.AssignWorkoutDefinition:
                var assignWorkoutViewModel = App.Container.Resolve <IAssignWorkoutDefinitionViewModel>();
                var assignWorkoutView      = new AssignWorkOutView(assignWorkoutViewModel);
                assignWorkoutViewModel.WorkOutType = (WorkOutAssignment.WorkOutTypes)paramater;
                assignWorkoutView.BindingContext   = assignWorkoutViewModel;
                await _navigation.PushAsync(assignWorkoutView);

                break;

            case UserInterfaceStates.WorkoutDefinitionLibraryView:
                var workOutDefinitionLibraryViewModel = App.Container.Resolve <IWorkoutDefinitionLibraryViewModel>();
                var workoutDefinitionView             = new WorkOutDefinitionLibraryView(workOutDefinitionLibraryViewModel);
                workoutDefinitionView.BindingContext = workOutDefinitionLibraryViewModel;
                await _navigation.PushAsync(workoutDefinitionView);

                break;

            case UserInterfaceStates.SelectNextSession:
                var createNextSession     = App.Container.Resolve <ICreateNextSessionViewModel>();
                var selectNextSessionView = new SelectNextSessionView(createNextSession);
                selectNextSessionView.BindingContext = createNextSession;
                await _navigation.PushAsync(selectNextSessionView);

                break;

            case UserInterfaceStates.SessionView:
                var sessionLogViewModel = App.Container.Resolve <ISessionLogViewModel>();
                var view = new SessionDetailView(sessionLogViewModel);
                view.BindingContext = sessionLogViewModel.SelectedSession;
                await _navigation.PushAsync(view);

                break;

            case UserInterfaceStates.ScheduleView:
                var scheduleViewModel = App.Container.Resolve <IScheduleViewModel>();
                var workoutDefinitionLibraryViewModel = App.Container.Resolve <IWorkoutDefinitionLibraryViewModel>();
                var scheduleView = new ScheduleView(scheduleViewModel, workoutDefinitionLibraryViewModel);
                scheduleView.BindingContext = scheduleViewModel;
                await _navigation.PushAsync(scheduleView);

                break;

            case UserInterfaceStates.ScheduleAdd:
                var addSessionDefinitionViewModel = App.Container.Resolve <IAddSessionDefinitionViewModel>();
                var addview = new AddSessionDefinitionView();
                addview.BindingContext = addSessionDefinitionViewModel;
                await _navigation.PushAsync(addview);

                break;

            case UserInterfaceStates.SessionDefinitionView:
                var s              = App.Container.Resolve <IScheduleViewModel>();
                var e              = App.Container.Resolve <IWorkoutDefinitionLibraryViewModel>();
                var userInterface  = App.Container.Resolve <IUserInterfaceState>();
                var definitionView = new SessionDefinitionView(s.SelectedSessionDefinition, e, userInterface);
                definitionView.BindingContext = s.SelectedSessionDefinition;
                await _navigation.PushAsync(definitionView);

                break;

            default:
                var sessionLog = App.Container.Resolve <ISessionLogViewModel>();
                var viewMain   = new SessionLogView(sessionLog);
                viewMain.BindingContext   = sessionLog;
                _navigation               = new NavigationPage(viewMain);
                _navigation.Popped       += _navigation_Popped;
                _navigation.PoppedToRoot += _navigation_PoppedToRoot;
                Application.MainPage      = _navigation;
                break;
            }
        }