当前位置: 首页>>代码示例>>C#>>正文


C# NavigationParameters类代码示例

本文整理汇总了C#中NavigationParameters的典型用法代码示例。如果您正苦于以下问题:C# NavigationParameters类的具体用法?C# NavigationParameters怎么用?C# NavigationParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NavigationParameters类属于命名空间,在下文中一共展示了NavigationParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DisplayViewInSplitPanel

        public void DisplayViewInSplitPanel(string url, NavigationParameters parameter)
        {
            Action operation = () => 
            {
                var uri = new Uri(url, UriKind.Relative);
                _loadedEdgePanel = (FrameworkElement)Application.LoadComponent(uri);

                _loadedEdgePanel.Loaded += (sender, evt) => SplitterPanelLoaded(sender, evt, parameter);
                _splitWindowContent.Children.Clear();
                var contains = _splitWindowContent.Children.Contains(_loadedEdgePanel);
                _splitWindowContent.Children.Add(_loadedEdgePanel);

                // Force the metro window to calculate the size of the user control.
                _loadedEdgePanel.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                _splitWindowContent.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                _splitWindow.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));

                DisplayEdgePanel();
            };

            if (_isEdgePanelOpen)
            {
                HideEdgePanel(operation);
            }
            else
            {
                operation();
            }
        }
开发者ID:thabart,项目名称:SimpleMetroLibrary,代码行数:29,代码来源:MetroWindow.cs

示例2: OnNavigatedFrom

        public override void OnNavigatedFrom(NavigationParameters parameters)
        {
            Loader.CancelLoading();
            ListLoader.CancelLoading();

            base.OnNavigatedFrom(parameters);
        }
开发者ID:XamarinGarage,项目名称:GiTracker,代码行数:7,代码来源:BaseListViewModel.cs

示例3: GoBackAsync

        /// <summary>
        /// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.
        /// </summary>
        /// <param name="parameters">The navigation parameters</param>
        /// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
        /// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
        /// <returns>If <c>true</c> a go back operation was successful. If <c>false</c> the go back operation failed.</returns>
        public virtual async Task<bool> GoBackAsync(NavigationParameters parameters = null, bool? useModalNavigation = null, bool animated = true)
        {
            try
            {
                var page = GetCurrentPage();
                var segmentParameters = GetSegmentParameters(null, parameters);

                var canNavigate = await CanNavigateAsync(page, segmentParameters);
                if (!canNavigate)
                    return false;

                bool useModalForDoPop = UseModalNavigation(page, useModalNavigation);
                Page previousPage = GetOnNavigatedToTarget(page, useModalForDoPop);

                OnNavigatedFrom(page, segmentParameters);

                var poppedPage = await DoPop(page.Navigation, useModalForDoPop, animated);
                if (poppedPage != null)
                {
                    OnNavigatedTo(previousPage, segmentParameters);
                    return true;
                }
            }
            catch (Exception e)
            {
                _logger.Log(e.ToString(), Category.Exception, Priority.High);
                return false;
            }

            return false;
        }
开发者ID:Citringo,项目名称:Prism,代码行数:38,代码来源:PageNavigationService.cs

示例4: Navigate

        void Navigate()
        {
            NavigationParameters parameters = new NavigationParameters();
            parameters.Add("message", "Message from MainPage");

            _navigationService.Navigate("ViewA", parameters);
        }
开发者ID:njmube,项目名称:Prism,代码行数:7,代码来源:MainPageViewModel.cs

示例5: RequestNavigate

        /// <summary>
        /// Initiates navigation to the target specified by the <paramref name="target"/>.
        /// </summary>
        /// <param name="navigation">The navigation object.</param>
        /// <param name="target">A string that represents the target where the region will navigate.</param>
        /// <param name="navigationParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param>
        public static void RequestNavigate(this INavigateAsync navigation, string target, NavigationParameters navigationParameters)
        {
            if (navigation == null) throw new ArgumentNullException("navigation");
            if (target == null) throw new ArgumentNullException("target");

            navigation.RequestNavigate(new Uri(target, UriKind.RelativeOrAbsolute), nr => { }, navigationParameters);
        }
开发者ID:selvendiranj,项目名称:compositewpf-copy,代码行数:13,代码来源:NavigationAsyncExtensions.cs

示例6: RequestNavigate

        /// <summary>
        /// Initiates navigation to the target specified by the <paramref name="target"/>.
        /// </summary>
        /// <param name="navigation">The navigation object.</param>
        /// <param name="target">A Uri that represents the target where the region will navigate.</param>
        /// <param name="navigationParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param>
        public static void RequestNavigate(this INavigateAsync navigation, Uri target, NavigationParameters navigationParameters)
        {
            if (navigation == null)
                throw new ArgumentNullException(nameof(navigation));

            navigation.RequestNavigate(target, nr => { }, navigationParameters);
        }
开发者ID:Citringo,项目名称:Prism,代码行数:13,代码来源:NavigationAsyncExtensions.cs

示例7: OnNavigatedTo

        public void OnNavigatedTo(NavigationParameters parameters)
        {
            Debug.WriteLine("-------------MainPageViewModel----------OnNavigatedTo <--");

            if (parameters.ContainsKey("title"))
                Title = (string)parameters["title"] + " and Prism";
        }
开发者ID:CarMatt,项目名称:PrismNavi,代码行数:7,代码来源:MainPageViewModel.cs

示例8: Navigate

        private void Navigate()
        {
            var navParams = new NavigationParameters();
            navParams.Add("timestamp", DateTime.Now);

            _navigationService.Navigate("ViewB", navParams);
        }
开发者ID:dl0618,项目名称:Prism,代码行数:7,代码来源:ViewAViewModel.cs

示例9: NavigationContext

 /// <summary>
 /// Initializes a new instance of the <see cref="NavigationContext"/> class for a region name and a 
 /// <see cref="Uri"/>.
 /// </summary>
 /// <param name="navigationService">The navigation service.</param>
 /// <param name="navigationParameters">The navigation parameters.</param>
 /// <param name="uri">The Uri.</param>
 public NavigationContext(IRegionNavigationService navigationService, Uri uri, NavigationParameters navigationParameters)
 {
     NavigationService = navigationService;
     Uri = uri;
     Parameters = uri != null ? UriParsingHelper.ParseQuery(uri) : null;
     GetNavigationParameters(navigationParameters);
 }
开发者ID:Citringo,项目名称:Prism,代码行数:14,代码来源:NavigationContext.cs

示例10: Init

        public async Task Init(NavigationParameters parameters)
        {
            bool successful = await SafeOperation(
                TaskEx.Run(async () => Sponsor = await _campService.GetSponsor(parameters.Id)));

            FinishedLoading(successful);
        }
开发者ID:jorik041,项目名称:NycCodeCamp8,代码行数:7,代码来源:SponsorViewModel.cs

示例11: WhenGivenDuplicateParametersThrowsArgumentException

 public void WhenGivenDuplicateParametersThrowsArgumentException()
 {
     Assert.Throws<ArgumentException>(() =>
     {
         var parameters = new NavigationParameters(_uri);
         parameters.Add("id", 3);
     });            
 }
开发者ID:Citringo,项目名称:Prism,代码行数:8,代码来源:NavigationParametersFixture.cs

示例12: OnNavigatedTo

        public override void OnNavigatedTo(NavigationParameters parameters)
        {
            base.OnNavigatedTo(parameters);
            Issue = new IssueViewModel(parameters[Constants.IssueParameterName] as IIssue);
            _repo = parameters[Constants.RepoParameterName] as IRepo;

            Title = string.Format(LogWork.IssueTitle, Issue.Number);
        }
开发者ID:XamarinGarage,项目名称:GiTracker,代码行数:8,代码来源:LogWorkPageViewModel.cs

示例13: AddCustomerHandler

        public void AddCustomerHandler()
        {
            var q = new NavigationParameters();
            q.Add("id",-1);
            regionManager.RequestNavigate(RegionNames.MainRegion, "CustomerAddUpdateView" + q.ToString());
            

        }
开发者ID:TheNeal,项目名称:ABBProject,代码行数:8,代码来源:CustomerListVM.cs

示例14: Click

 private void Click()
 {
     var parameters = new NavigationParameters();
     parameters.Add("Message", "A message from ViewA");
     
     //uses the overload to navigate using a class as the key
     //when navigating within a NavigationPage, set useModalNavigation = false
     NavigationService.Navigate<ViewCViewModel>(parameters);
 }
开发者ID:martindiguilio,项目名称:Prism,代码行数:9,代码来源:ViewAViewModel.cs

示例15: CanNavigate

        public bool CanNavigate(NavigationParameters parameters)
        {
            OnConfirmNavigationCalled = true;

            if (parameters.ContainsKey("canNavigate"))
                return (bool)parameters["canNavigate"];

            return true;
        }
开发者ID:ruxo,项目名称:Prism,代码行数:9,代码来源:ContentPageMock.cs


注:本文中的NavigationParameters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。