コード例 #1
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            ViewModel = (GeotagFileBrowserViewModel)navigationContext.Parameters["viewModel"];
            DataContext = ViewModel;

            ViewModel.OnNavigatedTo(navigationContext);   
        }
コード例 #2
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            if (navigationContext.Parameters != null && navigationContext.Parameters.Any())
            {
                var dishes = navigationContext.Parameters["Dishes"] as List<DishViewModel>;

                if (dishes != null)
                    ViewModel = new OrderViewModel(dishes)
                    {
                        Repository = Repository,
                        NavigationService = navigationContext.NavigationService
                    };
                else
                    ViewModel = new OrderViewModel
                    {
                        Repository = Repository,
                        NavigationService = navigationContext.NavigationService
                    };

            }
            else
                ViewModel = new OrderViewModel
                {
                    Repository = Repository,
                    NavigationService = navigationContext.NavigationService
                };
        }
コード例 #3
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            ViewModel = (MediaFileBrowserImagePanelViewModel)navigationContext.Parameters["viewModel"];
            DataContext = ViewModel;

            ViewModel.OnNavigatedTo(navigationContext);
        }
コード例 #4
0
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     string ParametroRecibido = navigationContext.Parameters["TheText"];
     // ReceptionTextBox.Text = ParametroRecibido; // este codigo es para una implantación con codebehinde
     RecepcionDato = ParametroRecibido;
     System.Windows.MessageBox.Show(String.Format("El parametro recibido es :/{0}/", ParametroRecibido));
 }
コード例 #5
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            menu = new RTIMainView();
            menu.AboutButton.Command = aboutCommand;

            ribbonService.AddRibbonItem(menu, true);
        }
コード例 #6
0
 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
     foreach (var tabItem in _tabs)
     {
         tabItem.ViewModel.Deinitialize(navigationContext);
     }
 }
コード例 #7
0
 /// <summary>
 /// 当前的页面被导航到以后发生,这个函数可以用来处理URI的参数
 /// </summary>
 /// <param name="navigationContext"></param>
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     if (TagMsg == null || TagMsg == "")
     {
         TagMsg = "密码";
     }
 }
コード例 #8
0
        public void OnNavigatedTo(Microsoft.Practices.Prism.Regions.NavigationContext navigationContext)
        {
            int hash = int.Parse(navigationContext.Parameters["authenticationhash"]);

            _authentic = (Authentication)NavigatePatameters.Request(hash);
            GetServers();
        }
        public void WhenRegionHasMultipleViews_ThenViewsWithMatchingTypeNameAreConsidered()
        {
            // Arrange

            var serviceLocatorMock = new Mock<IServiceLocator>();

            var region = new Region();

            var view1 = new TestView();
            var view2 = "view";

            region.Add(view1);
            region.Add(view2);

            var navigationContext = new NavigationContext(null, new Uri(view2.GetType().Name, UriKind.Relative));

            var navigationTargetHandler = new TestRegionNavigationContentLoader(serviceLocatorMock.Object);


            // Act

            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);


            // Assert

            Assert.AreSame(view2, returnedView);
        }
コード例 #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RegionNavigationEventArgs"/> class.
        /// </summary>
        /// <param name="navigationContext">The navigation context.</param>
        public RegionNavigationEventArgs(NavigationContext navigationContext)
        {
            if (navigationContext == null) throw new ArgumentNullException("navigationContext");
            Contract.EndContractBlock();

            this.NavigationContext = navigationContext;
        }
コード例 #11
0
 public bool IsNavigationTarget(NavigationContext navigationContext)
 {
     return true;
     // If you want to create multiple versions of this view then you need to set the 
     // PartCreationPolicy to NonShared and write code to determine if the view is 
     // a navigation target or not.
 }
コード例 #12
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            ViewModel = (ImageViewModel)navigationContext.Parameters["viewModel"];
            DataContext = ViewModel;

            ViewModel.OnNavigatedTo(navigationContext);              
        }       
コード例 #13
0
 private void RaiseNavigating(NavigationContext navigationContext)
 {
     if (this.Navigating != null)
     {
         this.Navigating(this, new RegionNavigationEventArgs(navigationContext));
     }
 }
コード例 #14
0
ファイル: AlbumViewModel.cs プロジェクト: kms/torshify-client
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            _trackMenuBarToken = _eventAggregator.GetEvent<TrackCommandBarEvent>().Subscribe(OnTrackMenuBarEvent, true);
            _tracksMenuBarToken = _eventAggregator.GetEvent<TracksCommandBarEvent>().Subscribe(OnTracksMenuBarEvent, true);

            Album = navigationContext.Tag as IAlbum;
        }
コード例 #15
0
        public bool IsNavigationTarget( NavigationContext navigationContext )
        {
            // Called to see if this view can handle the navigation request. If it can, this view is activated.

            // This view is always the navigation target so return true.
            return true;
        }
        public void WhenViewExistsAndDoesNotImplementINavigationAware_ThenReturnsView()
        {
            // Arrange

            var serviceLocatorMock = new Mock<IServiceLocator>();

            var region = new Region();

            var view = new TestView();

            region.Add(view);

            var navigationContext = new NavigationContext(null, new Uri(view.GetType().Name, UriKind.Relative));

            var navigationTargetHandler = new TestRegionNavigationContentLoader(serviceLocatorMock.Object);


            // Act

            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);


            // Assert

            Assert.AreSame(view, returnedView);
        }
コード例 #17
0
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     if (navigationContext.Parameters != null && navigationContext.Parameters.Any())
     {
         var id = (int?) navigationContext.Parameters["Id"];
         if (id.HasValue)
         {
             ViewModel = new DishViewModel(id.Value)
             {
                 Repository = Repository
             };
         }
         else
         {
             ViewModel = new DishViewModel
             {
                 Repository = Repository
             };
         }
     }
     else
         ViewModel = new DishViewModel
         {
             Repository = Repository
         };
 }
コード例 #18
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {            
            ViewModel = (MediaFileStackPanelViewModel)navigationContext.Parameters["viewModel"];
            DataContext = ViewModel;

            if (ViewModel == null)
            {
                collapseableGrid.Visibility = System.Windows.Visibility.Collapsed;
                collapseableButtonGrid.Visibility = System.Windows.Visibility.Collapsed;
                return;
            }
            else
            {
                Binding binding = new Binding();
                binding.Path = new PropertyPath("IsEnabled");
                binding.Converter = new BooleanToVisibilityConverter();
                binding.Source = ViewModel;  

                BindingOperations.SetBinding(collapseableButtonGrid, Grid.VisibilityProperty, binding);

                binding = new Binding();
                binding.Path = new PropertyPath("IsVisible");
                binding.Converter = new BooleanToVisibilityConverter();
                binding.Source = ViewModel;

                BindingOperations.SetBinding(collapseableGrid, Grid.VisibilityProperty, binding); 

            }

            if (ViewModel.IsEnabled == false) return;
                                       
            ViewModel.MediaStateCollectionView.Cleared += MediaStateCollectionView_Cleared;
            ViewModel.OnNavigatedTo(navigationContext);   
            
        }
コード例 #19
0
 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
     if (ViewModel != null)
     {
         ViewModel.MediaStateCollectionView.Cleared -= MediaStateCollectionView_Cleared;
         ViewModel.OnNavigatedFrom(navigationContext);
     }
 }
コード例 #20
0
        public bool IsNavigationTarget( NavigationContext navigationContext )
        {
            // Called to see if this view can handle the navigation request. If it can, this view is activated.

            // Check the ID of the currently displayed item against the ID navigation parameter.
            string id = navigationContext.Parameters["ID"];
            return CurrentItem == null ? false : CurrentItem.Id.Equals( id );
        }
コード例 #21
0
        public override void OnNavigatedTo(NavigationContext navigationContext)
        {
            base.OnNavigatedTo(navigationContext);

            var job = navigationContext.Parameters["Job"] as Models.JobModel;
            this.Job = job;
            this.LoadData();
        }
コード例 #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RegionNavigationEventArgs"/> class.
        /// </summary>
        /// <param name="navigationContext">The navigation context.</param>
        public RegionNavigationFailedEventArgs(NavigationContext navigationContext)
        {
            if (navigationContext == null) {
                throw new ArgumentNullException("navigationContext");
            }

            this.NavigationContext = navigationContext;
        }
コード例 #23
0
		public void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback)
		{
			bool result = true;
			
			// TODO: Implement code to set result ...
			
			continuationCallback(result);
		}
コード例 #24
0
 void INavigationAware.OnNavigatedTo(NavigationContext navigationContext)
 {
     if (navigationContext == null)
     {
         throw new ArgumentNullException("navigationContext");
     }
     Name = navigationContext.Parameters["Name"] as string;
 }
コード例 #25
0
 public override void OnNavigatedTo(Microsoft.Practices.Prism.Regions.NavigationContext navigationContext)
 {
     if (navigationContext.Parameters != null && navigationContext.Parameters.Count() > 0)
     {
         var id = navigationContext.Parameters;
     }
     base.OnNavigatedTo(navigationContext);
     navigationService = navigationContext.NavigationService;
 }
コード例 #26
0
        //implementacion de INavigationAware
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            this.RegionManager.Regions[RegionNames.SubMenuRegion].ClearActiveViews();

            DiagramFactory.LoadDiagram(this.diagram, "ModulesDiagram");
            this.diagram.AutoFit();
            SetMenuControl();
        
        }
コード例 #27
0
        public void OnNavigatedFrom(NavigationContext navigationContext)
        {
            /*while (Rm.Regions["youtubeExpanderPanelRegion"].Views.Count() > 0)
            {
                Rm.Regions["youtubeExpanderPanelRegion"].Remove(Rm.Regions["youtubeExpanderPanelRegion"].Views.FirstOrDefault());
            }

            Rm.Regions.Remove("youtubeExpanderPanelRegion");*/
        }
コード例 #28
0
ファイル: LoginViewModel.cs プロジェクト: hva/warehouse.net
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     string l;
     if (IsolatedStorageSettings.ApplicationSettings.TryGetValue(Consts.SettingsLoginKey, out l))
     {
         Login = l;
     }
     Password = string.Empty;
 }
コード例 #29
0
 public override void OnNavigatedTo(Microsoft.Practices.Prism.Regions.NavigationContext navigationContext)
 {
     if (navigationContext.Parameters != null && navigationContext.Parameters.Count() > 0)
     {
         string id          = navigationContext.Parameters["ID"].ToString();
         var    myParameter = navigationContext.Parameters["myObjectParameter"];
     }
     base.OnNavigatedTo(navigationContext);
     navigationService = navigationContext.NavigationService;
 }
コード例 #30
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            foreach (var tabItem in _tabs)
            {
                tabItem.ViewModel.SetModel(this);
                tabItem.ViewModel.Initialize(navigationContext);
            }

            Tabs.MoveCurrentToFirst();
        }
コード例 #31
0
ファイル: EmailViewModel.cs プロジェクト: CarlosVV/mediavf
        private Guid? GetRequestedEmailId(NavigationContext navigationContext)
        {
            var email = navigationContext.Parameters[EmailIdKey];
            Guid emailId;
            if (email != null && Guid.TryParse(email, out emailId))
            {
                return emailId;
            }

            return null;
        }
コード例 #32
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            var artist = navigationContext.Tag as IArtist;

            foreach (var tabItem in _tabs)
            {
                tabItem.ViewModel.SetModel(artist);
                tabItem.ViewModel.Initialize(navigationContext);
            }

            Tabs.MoveCurrentToFirst();
        }
コード例 #33
0
 public void OnTuneIn(NavigationContext context)
 {
     Task.Factory.StartNew(() =>
                           {
                               using (LoadingIndicatorService.EnterLoadingBlock())
                               {
                                   Radio.Play(
                                       Radio.GetTracksByName("NOFX").OrderBy(t => t.TotalDuration).Take(2).
                                           ToTrackStream("My custom track stream"));
                               }
                           });
 }
コード例 #34
0
 public void OnNavigatedFrom(Microsoft.Practices.Prism.Regions.NavigationContext navigationContext)
 {
     navigationContext.Parameters.Add("PageFrom", this.ToString());
 }
コード例 #35
0
 public bool IsNavigationTarget(Microsoft.Practices.Prism.Regions.NavigationContext navigationContext)
 {
     return(false);
 }