优化更新代码,添加界面功能并整合
This commit is contained in:
47
WPFluent/Controls/NavigationView/NavigationViewItemHeader.cs
Normal file
47
WPFluent/Controls/NavigationView/NavigationViewItemHeader.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
|
||||
|
||||
// Based on Windows UI Library
|
||||
// Copyright(c) Microsoft Corporation.All rights reserved.
|
||||
//
|
||||
// https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.navigationviewitemheader?view=winrt-22621
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace WPFluent.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a header for a group of menu items in a NavigationMenu.
|
||||
/// </summary>
|
||||
public class NavigationViewItemHeader : System.Windows.Controls.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies the <see cref="Icon"/> dependency property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
|
||||
nameof(Icon),
|
||||
typeof(IconElement),
|
||||
typeof(NavigationViewItemHeader),
|
||||
new PropertyMetadata(null));
|
||||
/// <summary>
|
||||
/// Identifies the <see cref="Text"/> dependency property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
|
||||
nameof(Text),
|
||||
typeof(string),
|
||||
typeof(NavigationViewItemHeader),
|
||||
new PropertyMetadata(string.Empty));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the icon.
|
||||
/// </summary>
|
||||
[Bindable(true)]
|
||||
[Category("Appearance")]
|
||||
public IconElement? Icon { get => (IconElement?)GetValue(IconProperty); set => SetValue(IconProperty, value); }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text presented in the header element.
|
||||
/// </summary>
|
||||
[Bindable(true)]
|
||||
public string Text { get => (string)GetValue(TextProperty); set => SetValue(TextProperty, value); }
|
||||
}
|
||||
Reference in New Issue
Block a user