0
后空我有一个用户控制,具有框架作为一个依赖属性依赖属性是价值分配
public partial class NavigationBar : UserControl
{
public NavigationBar()
{
this.InitializeComponent();
}
public Frame NavigationFrame
{
get { return (Frame)GetValue(NavigationFrameProperty); }
set { SetValue(NavigationFrameProperty, value); }
}
// Using a DependencyProperty as the backing store for NavigationFrame. This enables animation, styling, binding, etc...
public static readonly DependencyProperty NavigationFrameProperty =
DependencyProperty.Register("NavigationFrame", typeof(Frame), typeof(NavigationBar), new UIPropertyMetadata());
}
使用用户控件代码:
<userControls:NavigationBar NavigationFrame="{Binding ElementName=masterPage, Path=frameNavigations}" />
<Frame x:Name="frameNavigations"/>
为什么NavigationFrame依赖加载后属性仍为null?
在此先感谢