// ReSharper disable once CheckNamespace
namespace WPFluent.Controls;
///
/// Defines attached properties for .
///
public partial class NavigationView
{
// ====
// NavigationParent Attached Property
// ====
///
/// Identifies the dependency property.
///
internal static readonly DependencyProperty NavigationParentProperty =
DependencyProperty.RegisterAttached(
nameof(NavigationParent),
typeof(NavigationView),
typeof(NavigationView),
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
// ====
// HeaderContent Attached Property
// ====
///
/// Registers attached property NavigationView.HeaderContent
///
public static readonly DependencyProperty HeaderContentProperty = DependencyProperty.RegisterAttached(
"HeaderContent",
typeof(object),
typeof(NavigationView),
new FrameworkPropertyMetadata(null));
///
/// Helper for getting from .
///
/// to read from.
/// NavigationParent property value.
[AttachedPropertyBrowsableForType(typeof(DependencyObject))]
internal static NavigationView? GetNavigationParent(DependencyObject navigationItem) => navigationItem.GetValue(
NavigationParentProperty) as NavigationView;
///
/// Gets the parent for its children.
///
internal NavigationView? NavigationParent
{
get => (NavigationView?)GetValue(NavigationParentProperty);
private set => SetValue(NavigationParentProperty, value);
}
///
/// Helper for getting from .
///
/// to read from.
/// HeaderContent property value.
[AttachedPropertyBrowsableForType(typeof(FrameworkElement))]
public static object? GetHeaderContent(FrameworkElement target) => target.GetValue(HeaderContentProperty);
///
/// Helper for setting on .
///
/// to set on.
/// HeaderContent property value.
public static void SetHeaderContent(FrameworkElement target, object? headerContent) => target.SetValue(
HeaderContentProperty,
headerContent);
}