Exemplo n.º 1
0
 static ViewModelLocator()
 {
     navigationService = new NavigationService();
     Main        = new MainViewModel(ViewModelBase.IsInDesignModeStatic, navigationService);
     Track       = new TrackViewModel(ViewModelBase.IsInDesignModeStatic, navigationService);
     Palestrante = new PalestranteViewModel(ViewModelBase.IsInDesignModeStatic, navigationService);
     Palestra    = new PalestraViewModel(ViewModelBase.IsInDesignModeStatic, navigationService);
 }
 static ViewModelLocator()
 {
     navigationService = new NavigationService();
     Main = new MainViewModel(ViewModelBase.IsInDesignModeStatic, navigationService);
     Track = new TrackViewModel(ViewModelBase.IsInDesignModeStatic, navigationService);
     Palestrante = new PalestranteViewModel(ViewModelBase.IsInDesignModeStatic, navigationService);
     Palestra = new PalestraViewModel(ViewModelBase.IsInDesignModeStatic, navigationService);
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (!e.IsNavigationInitiator)
            {
                var palestraViewModel = new PalestraViewModel(false, null);
                var id = NavigationContext.QueryString["id"];
                palestraViewModel.LoadPalestra(Convert.ToInt32(id));
                DataContext = palestraViewModel;
            }
        }