本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
}
}
示例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);
}
示例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);
}
示例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));
}
示例8: Navigate
public void Navigate(Page page)
{
CurrentPage = page.GetType().ToString().Replace("WPBackup.", "");
if (OnNavigate != null)
{
NavigationHandler = null;
OnNavigate(this, new NavigateEventArgs(page));
Refresh();
}
}