mirror of
https://github.com/jie65535/ChineseChess.git
synced 2024-07-27 18:55:00 +08:00
24 lines
519 B
C#
24 lines
519 B
C#
namespace System.Windows.Controls
|
|
{
|
|
public static class FrameExtensions
|
|
{
|
|
public static object GetDataContext(this Frame frame)
|
|
{
|
|
if (frame.Content is FrameworkElement element)
|
|
{
|
|
return element.DataContext;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public static void CleanNavigation(this Frame frame)
|
|
{
|
|
while (frame.CanGoBack)
|
|
{
|
|
frame.RemoveBackEntry();
|
|
}
|
|
}
|
|
}
|
|
}
|