public GalleryViewModel() { var home = new Home.HomeViewModel(); GalleryItems.Add(home); var controlItems = new ControlsViewModel(); GalleryItems.Add(controlItems); var converters = new ConvertersViewModel(); GalleryItems.Add(converters); var popupItems = new PopupsViewModel(); GalleryItems.Add(popupItems); var behaviourItems = new BehavioursViewModel(); GalleryItems.Add(behaviourItems); var dragAndDropItems = new DragAndDropViewModel(); GalleryItems.Add(dragAndDropItems); var mvvmItems = new MVVMViewModel(); GalleryItems.Add(mvvmItems); SelectedGalleryItem = home; }
private MainWindow(Builder builder) : base(builder.GetObject("MainWindow").Handle) { // custom css var provider = new CssProvider(); provider.LoadFromPath("Assets/app.css"); Gtk.StyleContext.AddProviderForScreen(Gdk.Screen.Default, provider, 800); // window views var controlsViewModel = new ControlsViewModel(this); var aboutViewModel = new AboutViewModel(this); builder.Autoconnect(this); builder.Autoconnect(controlsViewModel); // events DeleteEvent += Window_DeleteEvent; // menu events _button_menu_control.Clicked += ButtonMenuControlClicked; _button_menu_about.Clicked += ButtonMenuAboutClicked; controlsViewModel.Init(); aboutViewModel.Init(); }
void App_Startup(object sender, StartupEventArgs e) { // Initialize all view models and model in high level class-App. airplaneModel = new MyAirplaneModel(); settingsVM = new SettingsViewModel(airplaneModel); dashboardVM = new DashboardViewModel(airplaneModel); mapVM = new MapViewModel(airplaneModel); controlsVM = new ControlsViewModel(airplaneModel); }
public ShellViewModel( GameViewModel gameView, ControlsViewModel controlsView, MessageViewModel messageView, RecordsViewModel recordsView, SettingsViewModel settingsView, UserViewModel userView) { GameView = gameView; ControlsView = controlsView; MessageView = messageView; RecordsView = recordsView; SettingsView = settingsView; UserView = userView; SetTitle(); IsUserActive = true; }
public void Execute(object parameter) { if (parameter.ToString() == "gamePlay") { Debug.WriteLine("View update to gameplay view command fired"); GamePlayViewModel.getInstaince().gamePlay.gameState.play(); this.viewModel.selectedViewModel = GamePlayViewModel.getInstaince(); } else if (parameter.ToString() == "mainMenue") { Debug.WriteLine("View update to main menue view command fired"); this.viewModel.selectedViewModel = MainMenueViewModel.getInstaince(); } else if (parameter.ToString() == "controls") { Debug.WriteLine("View update to controls menue view command fired"); this.viewModel.selectedViewModel = ControlsViewModel.getInstaince(); } }
public GalleryViewModel() { var homeItem = new Home.HomeViewModel(); GalleryItems.Add(homeItem); var controlItems = new ControlsViewModel(); GalleryItems.Add(controlItems); var popupItems = new GalleryItemViewModel() { Title = "Popups" }; popupItems.GalleryItems.Add(new PopupsViewModel()); GalleryItems.Add(popupItems); //var behaviourItems = new GalleryItemViewModel() {Title = "Behaviours"}; //behaviourItems.GalleryItems.Add(new ListViewItemContextMenuBehaviourViewModel()); //GalleryItems.Add(behaviourItems); var dragAndDropItems = new GalleryItemViewModel() { Title = "Drag and Drop" }; dragAndDropItems.GalleryItems.Add(new CanvasSampleViewModel()); dragAndDropItems.GalleryItems.Add(new ItemsControlSampleViewModel()); GalleryItems.Add(dragAndDropItems); var mvvmItems = new GalleryItemViewModel() { Title = "MVVM" }; mvvmItems.GalleryItems.Add(new SimpleExampleViewModel()); mvvmItems.GalleryItems.Add(new CommandingSampleViewModel()); mvvmItems.GalleryItems.Add(new ViewBrokerSampleViewModel()); mvvmItems.GalleryItems.Add(new ViewBrokerActivationSampleViewModel()); GalleryItems.Add(mvvmItems); }
protected override DataTemplate OnSelectTemplate(object item, BindableObject container) { try { ControlsViewModel viewModel = item as ControlsViewModel; if (viewModel == null) { return(EmptyTemplate); } if (viewModel.ControlType == Enums.CustomControl.InputField || viewModel.ControlType == Enums.CustomControl.TextField) { return(InputFieldTemplate); } if (viewModel.ControlType == Enums.CustomControl.Duration) { return(DurationTemplate); } if (viewModel.ControlType == Enums.CustomControl.Signature) { if (string.IsNullOrEmpty(viewModel.Disclaimer)) { return(SignatureDetailTemplate); } return(SignaturePhoneTemplate); } return(EmptyTemplate); } catch { throw; } }
public ControlsView() { InitializeComponent(); DataContext = new ControlsViewModel(); }
public Controls(MainWindowViewModel mainWindowVM) : this() { controlVM = new ControlsViewModel(mainWindowVM); this.DataContext = controlVM; }