13,347
社区成员
发帖
与我相关
我的任务
分享
public static DependencyProperty FrontContentProperty
= DependencyProperty.Register(
"FrontSideContentProperty",
typeof(UIElement),
typeof(FlipPanel),//FlipPanel是此Usercontrol的类名
new UIPropertyMetadata(
null,
new PropertyChangedCallback(OnFrontSideContentChanged)),
new ValidateValueCallback(ContentValueValidate)
);
public UIElement FrontSideContent
{
get
{
return (UIElement)GetValue(FrontContentProperty);
}
set
{
SetValue(FrontContentProperty, value);
}
}
private static void OnFrontSideContentChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
FlipPanel target = o as FlipPanel;
target.FrontContentBorder.Child = (UIElement)e.NewValue; // 这是最终目的 把value设置到border的child属性
}