using System.Windows.Controls; namespace WPFluent.Extensions; /// /// Set of extensions for . /// public static class FrameExtensions { /// /// Cleans journal. /// /// Selected frame. public static void CleanNavigation(this Frame frame) { while(frame.CanGoBack) { _ = frame.RemoveBackEntry(); } } /// /// Gets from . /// /// Selected frame. /// DataContext of currently active element, otherwise . public static object? GetDataContext(this Frame frame) { return frame.Content is not FrameworkElement element ? null : element.DataContext; } }