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


C# Page.GetType方法代码示例

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


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

示例1: SwitchPage

 internal static void SwitchPage(Page page)
 {
     if (Pages.First(x => x.GetType() == page.GetType()) != null)
     {
         Pages.RemoveAll(x => x.GetType() == page.GetType());
     }
     Pages.Add(page);
     PageContent.Content = page.Content;
 }
开发者ID:pinsorn,项目名称:WpfApplication1,代码行数:9,代码来源:Class1.cs

示例2: AddFrame

 public TabItem AddFrame(Page _window)
 {
     TabItem tabitem = new TabItem();
     tabitem.Header = "Tab: " + _window.GetType().Name;
     Frame tabFrame = new Frame();
     _window.GetType();
     tabitem.Tag = _window.GetType().Name;
     tabFrame.Content = _window;
     tabitem.Content = tabFrame;
     TabControl.Items.Add(tabitem);
     tabitem.Focus();
     return tabitem;
 }
开发者ID:jkevinp,项目名称:ergoMC,代码行数:13,代码来源:ErgoMcApp.xaml.cs

示例3: SwitchPage

 /// <summary>
 /// Switches the contents of the frame to the requested page. Also sets background on
 /// the button on the top to show what section you are currently on.
 /// </summary>
 internal static void SwitchPage(Page page)
 {
     IsOnPlayPage = page is PlayPage;
     //Dont cache important pages
     if (!(page is LoginPage ||
           page is CustomGameLobbyPage ||
           page is ChampSelectPage ||
           page is CreateCustomGamePage))
     {
         foreach (Page p in Pages) //Cache pages
         {
             if (p.GetType() == page.GetType())
             {
                 Container.Content = p.Content;
                 return;
             }
         }
     }
     Container.Content = page.Content;
     if (!(page is FakePage))
         Pages.Add(page);
 }
开发者ID:Battler624,项目名称:LegendaryClient,代码行数:26,代码来源:Client.cs

示例4: ClearPage

 /// <summary>
 /// Clears the cache of a certain page if not used anymore
 /// </summary>
 internal static void ClearPage(Page page)
 {
     foreach (Page p in Pages.ToArray())
     {
         if (p.GetType() == page.GetType())
         {
             Pages.Remove(p);
             return;
         }
     }
 }
开发者ID:ResQue1980,项目名称:LegendaryClient,代码行数:14,代码来源:Client.cs

示例5: SwitchPage

 /// <summary>
 /// Switches the contents of the frame to the requested page. Also sets background on
 /// the button on the top to show what section you are currently on.
 /// </summary>
 internal static void SwitchPage(Page page)
 {
     IsOnPlayPage = page is PlayPage;
     foreach (Page p in Pages) //Cache pages
     {
         if (p.GetType() == page.GetType())
         {
             Container.Content = p.Content;
             return;
         }
     }
     Container.Content = page.Content;
     if (!(page is FakePage))
         Pages.Add(page);
 }
开发者ID:ResQue1980,项目名称:LegendaryClient,代码行数:19,代码来源:Client.cs

示例6: SwitchPage

        /// <summary>
        ///     Switches the contents of the frame to the requested page. Also sets background on
        ///     the button on the top to show what section you are currently on.
        /// </summary>
        internal static void SwitchPage(Page page)
        {
            Log("Switching to the page: " + page.GetType());
            IsOnPlayPage = page is PlayPage;
            BackgroundImage.Visibility = page is ChampSelectPage
                ? Visibility.Hidden
                : Visibility.Visible;

            if (page is MainPage)
            {
                Page p = Pages.FirstOrDefault(x => x is MainPage);
                var mainPage = p as MainPage;
                if (mainPage != null)
                    mainPage.UpdateSummonerInformation();
            }

            TrueCurrentPage = page;
            foreach (Page p in Pages.Where(p => p.GetType() == page.GetType()))
            {
                Container.Content = p.Content;
                return;
            }

            Container.Content = page.Content;
            Pages.Add(page);
        }
开发者ID:TheDangerBoy,项目名称:LegendaryClient,代码行数:30,代码来源:Client.cs

示例7: Navigate

 /// <summary>
 /// Navigates the specified page.
 /// </summary>
 /// <param name="page">The page.</param>
 internal void Navigate(Page page)
 {
     _logger.Info("Navigating to " + page.GetType().Name);
     
     Dispatcher.InvokeAsync(() => PageFrame.NavigateWithTransition(page));
 }
开发者ID:EchoDemon,项目名称:MediaBrowser.Theater,代码行数:10,代码来源:MainWindow.xaml.cs

示例8: Navigate

 public void Navigate(Page page)
 {
     CurrentPage = page.GetType().ToString().Replace("WPBackup.", "");
     if (OnNavigate != null)
     {
         NavigationHandler = null;
         OnNavigate(this, new NavigateEventArgs(page));
         Refresh();
     }
 }
开发者ID:ultrashot,项目名称:wpbackup,代码行数:10,代码来源:MainViewModel.cs


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