我有一个自定义控件,它继承自用户控件。
public class CustomControl : ContentControl
{
public static readonly DependencyProperty VisualCompareControlProperty = DependencyProperty.Register("VisualCompareControl", typeof (FrameworkElement), typeof (CustomControl), new PropertyMetadata(default(FrameworkElement)));
public FrameworkElement VisualCompareControl
{
get { return (FrameworkElement) GetValue(VisualCompareControlProperty); }
set { SetValue(VisualCompareControlProperty, value); }
}
}
这是我的“视图”:
<myNameSpace:CustomControl>
<VisualCompareControl prism:RegionManager.RegionName="MyRegion" />
</myNameSpace:CustomControl>
在此区域导航和注入视图是标准的方法:
RegionManager.RequestNavigate("MyRegion", navigation, navigationParameter);
我在调试区域“MyRegion”时,发现它没有在RegionManager
中注册。为什么?有什么想法吗?