void INavigableViewModel.SetView(object view) { //-:cnd:noEmit #if WINDOWS_UWP || __IOS__ || __ANDROID__ || __WASM__ //+:cnd:noEmit var frameworkElement = view as Windows.UI.Xaml.FrameworkElement; View = new ViewModelView(frameworkElement); //-:cnd:noEmit #endif //+:cnd:noEmit }
/* * this function change the value of ViewModelView.current * so the screen change. */ private void move_To(string page) { if (ViewModelView != null) { switch (page) { case "Home": ((VMHome)ViewModels.ElementAt((int)InnerBoardView.HOME)).refreshEventList(null); //TODO : something cleaner for the same thing ViewModelView.MoveCurrentToPosition((int)InnerBoardView.HOME); break; case "Profile": ViewModelView.MoveCurrentToPosition((int)InnerBoardView.PROFILE); break; case "CreateEvent": ViewModelView.MoveCurrentToPosition((int)InnerBoardView.CR_EVENT); break; case "ModifyEvent": ((VMModifyEvent)ViewModels.ElementAt((int)InnerBoardView.MOD_EVENT)).setEvent( ((VMHome)ViewModels.ElementAt((int)InnerBoardView.HOME)).eventName, ((VMHome)ViewModels.ElementAt((int)InnerBoardView.HOME)).eventLocation, ((VMHome)ViewModels.ElementAt((int)InnerBoardView.HOME)).eventDate, ((VMHome)ViewModels.ElementAt((int)InnerBoardView.HOME)).eventContent); //TODO : something cleaner for the same thing ViewModelView.MoveCurrentToPosition((int)InnerBoardView.MOD_EVENT); break; case "InnerRooms": ViewModelView.MoveCurrentToPosition((int)InnerBoardView.INNER_ROOM); ((VMInnerRooms)ViewModels.ElementAt((int)InnerBoardView.INNER_ROOM)).refreshRoomList(); break; case "InnerDecks": ViewModelView.MoveCurrentToPosition((int)InnerBoardView.INNER_DECKS); ((VMInnerDecks)ViewModels.ElementAt((int)InnerBoardView.INNER_DECKS)).refreshDeckList(); break; } } }