【发布时间】:2015-08-13 01:05:16
【问题描述】:
在Prism中,每个View 都是UserControl,我有一个View 包括一个dependency property,就像这样(在MyView.xaml.cs 内):
public int WidgetCornerRadius
{
get { return (int)GetValue(WidgetCornerRadiusProperty); }
set { SetValue(WidgetCornerRadiusProperty, value); }
}
public static readonly DependencyProperty CornerRadiusProperty =
DependencyProperty.Register(
"CornerRadius",
typeof(int),
typeof(MyView),
new UIPropertyMetadata(7));
我在下面的Region(Shell.xaml)中显示了MyView.xaml:
<ContentControl prism:RegionManager.RegionName="TargetRegion"/>
现在我的问题是如何从Shell 内部填充视图的CornerRadius dependency property?我需要注册一个新的RegionAdapter 吗?你能告诉我怎么做吗?
我想要这样的东西:
<ContentControl prism:RegionManager.RegionName="TargetRegion"
CornerRadius="3" />
【问题讨论】:
标签: wpf xaml user-controls prism