public MainViewModel() { try { CurrentDate = DateTime.Today.ToShortDateString(); IsMovieDetailsButtonChecked = false; MovieDetailsVisibility = "Hidden"; HomeVM = new HomeViewModel() { Model = this }; DiscoveryVM = new DiscoveryViewModel() { Model = this }; MovieDetailsVM = new MovieDetailsViewModel() { Model = this }; discoveryView = new DiscoveryView() { DataContext = DiscoveryVM }; homeView = new HomeView() { DataContext = HomeVM }; movieDetailsView = new MovieDetailsView() { DataContext = tmdb.ExampleMovieDetails() }; CurrentView = HomeVM; } catch { CustomMessageBox.Show(AllResources.InternetConnectionError, MessageBoxButton.OK); } HomeViewCommand = new RelayCommand(o => { CurrentView = homeView; MovieDetailsVisibility = "Hidden"; }); DiscoveryViewCommand = new RelayCommand(o => { CurrentView = discoveryView; MovieDetailsVisibility = "Hidden"; }); MovieDetailsViewCommand = new RelayCommand(o => { CurrentView = movieDetailsView; }); }
void ReleaseDesignerOutlets() { if (AdventureButton != null) { AdventureButton.Dispose(); AdventureButton = null; } if (AdventureCreditLabel != null) { AdventureCreditLabel.Dispose(); AdventureCreditLabel = null; } if (AdventureDiscountLabel != null) { AdventureDiscountLabel.Dispose(); AdventureDiscountLabel = null; } if (AdventureDiscountView != null) { AdventureDiscountView.Dispose(); AdventureDiscountView = null; } if (AdventureEuroLabel != null) { AdventureEuroLabel.Dispose(); AdventureEuroLabel = null; } if (AdventureView != null) { AdventureView.Dispose(); AdventureView = null; } if (DiscoveryButton != null) { DiscoveryButton.Dispose(); DiscoveryButton = null; } if (DiscoveryCreditLabel != null) { DiscoveryCreditLabel.Dispose(); DiscoveryCreditLabel = null; } if (DiscoveryDiscountLabel != null) { DiscoveryDiscountLabel.Dispose(); DiscoveryDiscountLabel = null; } if (DiscoveryDiscountView != null) { DiscoveryDiscountView.Dispose(); DiscoveryDiscountView = null; } if (DiscoveryEuroLabel != null) { DiscoveryEuroLabel.Dispose(); DiscoveryEuroLabel = null; } if (DiscoveryView != null) { DiscoveryView.Dispose(); DiscoveryView = null; } if (EpicButton != null) { EpicButton.Dispose(); EpicButton = null; } if (EpicCreditLabel != null) { EpicCreditLabel.Dispose(); EpicCreditLabel = null; } if (EpicDiscountLabel != null) { EpicDiscountLabel.Dispose(); EpicDiscountLabel = null; } if (EpicDiscountView != null) { EpicDiscountView.Dispose(); EpicDiscountView = null; } if (EpicEuroButton != null) { EpicEuroButton.Dispose(); EpicEuroButton = null; } if (EpicView != null) { EpicView.Dispose(); EpicView = null; } if (ExplorationButton != null) { ExplorationButton.Dispose(); ExplorationButton = null; } if (ExplorationCreditLabel != null) { ExplorationCreditLabel.Dispose(); ExplorationCreditLabel = null; } if (ExplorationDiscountLabel != null) { ExplorationDiscountLabel.Dispose(); ExplorationDiscountLabel = null; } if (ExplorationDiscountView != null) { ExplorationDiscountView.Dispose(); ExplorationDiscountView = null; } if (ExplorationEuroLabel != null) { ExplorationEuroLabel.Dispose(); ExplorationEuroLabel = null; } if (ExplorationView != null) { ExplorationView.Dispose(); ExplorationView = null; } if (InformationTextView != null) { InformationTextView.Dispose(); InformationTextView = null; } if (InformationView != null) { InformationView.Dispose(); InformationView = null; } }
void ReleaseDesignerOutlets() { if (AdvCreditLabel != null) { AdvCreditLabel.Dispose(); AdvCreditLabel = null; } if (AdventureButton != null) { AdventureButton.Dispose(); AdventureButton = null; } if (AdventureCreditLabel != null) { AdventureCreditLabel.Dispose(); AdventureCreditLabel = null; } if (AdventureEuroLabel != null) { AdventureEuroLabel.Dispose(); AdventureEuroLabel = null; } if (AdventureTitle != null) { AdventureTitle.Dispose(); AdventureTitle = null; } if (AdventureView != null) { AdventureView.Dispose(); AdventureView = null; } if (DiscoCreditLabel != null) { DiscoCreditLabel.Dispose(); DiscoCreditLabel = null; } if (DiscoveryButton != null) { DiscoveryButton.Dispose(); DiscoveryButton = null; } if (DiscoveryCreditLabel != null) { DiscoveryCreditLabel.Dispose(); DiscoveryCreditLabel = null; } if (DiscoveryEuroLabel != null) { DiscoveryEuroLabel.Dispose(); DiscoveryEuroLabel = null; } if (DiscoveryTitle != null) { DiscoveryTitle.Dispose(); DiscoveryTitle = null; } if (DiscoveryView != null) { DiscoveryView.Dispose(); DiscoveryView = null; } if (EpicButton != null) { EpicButton.Dispose(); EpicButton = null; } if (EpicCreditLabel != null) { EpicCreditLabel.Dispose(); EpicCreditLabel = null; } if (EpicEuroLabel != null) { EpicEuroLabel.Dispose(); EpicEuroLabel = null; } if (EpicTitle != null) { EpicTitle.Dispose(); EpicTitle = null; } if (EpicView != null) { EpicView.Dispose(); EpicView = null; } if (ExploCreditLabel != null) { ExploCreditLabel.Dispose(); ExploCreditLabel = null; } if (ExplorationButton != null) { ExplorationButton.Dispose(); ExplorationButton = null; } if (ExplorationCreditLabel != null) { ExplorationCreditLabel.Dispose(); ExplorationCreditLabel = null; } if (ExplorationEuroLabel != null) { ExplorationEuroLabel.Dispose(); ExplorationEuroLabel = null; } if (ExplorationTitle != null) { ExplorationTitle.Dispose(); ExplorationTitle = null; } if (ExplorationView != null) { ExplorationView.Dispose(); ExplorationView = null; } if (InformationTextView != null) { InformationTextView.Dispose(); InformationTextView = null; } if (InformationView != null) { InformationView.Dispose(); InformationView = null; } if (ObsCreditLabel != null) { ObsCreditLabel.Dispose(); ObsCreditLabel = null; } if (ObservationButton != null) { ObservationButton.Dispose(); ObservationButton = null; } if (ObservationCreditsLabel != null) { ObservationCreditsLabel.Dispose(); ObservationCreditsLabel = null; } if (ObservationEuroLabel != null) { ObservationEuroLabel.Dispose(); ObservationEuroLabel = null; } if (ObservationTitle != null) { ObservationTitle.Dispose(); ObservationTitle = null; } if (ObservationView != null) { ObservationView.Dispose(); ObservationView = null; } }