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


C# PageInfo.GetArguments方法代码示例

本文整理汇总了C#中System.PageInfo.GetArguments方法的典型用法代码示例。如果您正苦于以下问题:C# PageInfo.GetArguments方法的具体用法?C# PageInfo.GetArguments怎么用?C# PageInfo.GetArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.PageInfo的用法示例。


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

示例1: Activate

        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="pageInfo">Information on the arguments and state passed to the page.</param>
        public async void Activate(PageInfo pageInfo)
        {
            // TODO: Create an appropriate data model for your problem domain to replace the sample data

            string itemId = pageInfo.GetArguments<string>();
            var item = await SampleDataSource.GetItemAsync(itemId);
            this.Item = item;
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:13,代码来源:ItemDetailViewModel.cs

示例2: Constructor_SetsArguments_Struct

        public void Constructor_SetsArguments_Struct()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", new StructState() { Text = "Text Value", Number = 42 });

            var args = navigationEntry.GetArguments<StructState>();
            Assert.Equal("Text Value", args.Text);
            Assert.Equal(42, args.Number);
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:8,代码来源:PageInfoFixture.cs

示例3: Activate

        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="pageInfo">Information on the arguments and state passed to the page.</param>
        public async void Activate(PageInfo pageInfo)
        {
            // TODO: Create an appropriate data model for your problem domain to replace the sample data

            string groupId = pageInfo.GetArguments<string>();
            var group = await SampleDataSource.GetGroupAsync(groupId);
            this.Group = group;
            this.Items = group.Items;
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:14,代码来源:SectionViewModel.cs

示例4: Activate

 public void Activate(PageInfo pageInfo)
 {
     this.Message = String.Format("Clicked on {0}", pageInfo.GetArguments<string>());
 }
开发者ID:Andy-Wilkinson,项目名称:OkraSplitView,代码行数:4,代码来源:BasicSubPageViewModel.cs

示例5: Constructor_SetsArguments_NullReturnsDefaultInt

        public void Constructor_SetsArguments_NullReturnsDefaultInt()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", null);

            Assert.Equal(0, navigationEntry.GetArguments<int>());
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:6,代码来源:PageInfoFixture.cs

示例6: Constructor_SetsArguments_NullClass

        public void Constructor_SetsArguments_NullClass()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", (ClassState)null);

            Assert.Equal(null, navigationEntry.GetArguments<ClassState>());
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:6,代码来源:PageInfoFixture.cs

示例7: Constructor_SetsArguments_Int

        public void Constructor_SetsArguments_Int()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", 42);

            Assert.Equal(42, navigationEntry.GetArguments<int>());
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:6,代码来源:PageInfoFixture.cs

示例8: Constructor_SetsArguments_NullString

        public void Constructor_SetsArguments_NullString()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", (string)null);

            Assert.Equal(null, navigationEntry.GetArguments<string>());
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:6,代码来源:PageInfoFixture.cs

示例9: Constructor_SetsArguments_String

        public void Constructor_SetsArguments_String()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", "Arguments");

            Assert.Equal("Arguments", navigationEntry.GetArguments<string>());
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:6,代码来源:PageInfoFixture.cs

示例10: Activate

        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="pageInfo">Information on the arguments and state passed to the page.</param>
        public async void Activate(PageInfo pageInfo)
        {
            // TODO: Create an appropriate data model for your problem domain to replace the sample data

            string groupId = pageInfo.GetArguments<string>();
            var group = await SampleDataSource.GetGroupAsync(groupId);
            this.Group = group;
            this.Items = group.Items;

            // Restore the selected item

            string selectedItemId;

            if (pageInfo.TryGetState<string>("SelectedItem", out selectedItemId))
                SelectedItem = await SampleDataSource.GetItemAsync(selectedItemId);
            else
                SelectedItem = null;
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:23,代码来源:SplitViewModel.cs


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