37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using HeBianGu.Control.Explorer;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
|
|
namespace Hopetry.Provider
|
|
{
|
|
public static class NavigationBarExtensions
|
|
{
|
|
public static readonly DependencyProperty RootDisplayNameProperty =
|
|
DependencyProperty.RegisterAttached("RootDisplayName", typeof(string), typeof(NavigationBarExtensions),
|
|
new PropertyMetadata("全部文件", OnRootDisplayNameChanged));
|
|
|
|
public static string GetRootDisplayName(DependencyObject obj)
|
|
{
|
|
return (string)obj.GetValue(RootDisplayNameProperty);
|
|
}
|
|
|
|
public static void SetRootDisplayName(DependencyObject obj, string value)
|
|
{
|
|
obj.SetValue(RootDisplayNameProperty, value);
|
|
}
|
|
|
|
private static void OnRootDisplayNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
if (d is NavigationBar navigationBar)
|
|
{
|
|
// 这里可以通过反射或其他方式修改内部显示逻辑
|
|
// 或者依赖行为来处理实际修改
|
|
}
|
|
}
|
|
}
|
|
}
|