我该如何进行数据绑定? [英] How Do I do databinding?
问题描述
大家好,
我需要有关如何解决以下情况的建议:
我有三个用户控件:
- FileInfoView
-> SummaryView
-> PersonalInfoView
我使用了另一个userControl在FileOpenView中将它们分组在一起:
< UserControl.... FileInfoView>
.................
</UserControl>
#region附加属性)
{
返回(TreatmentSession)obj.GetValue(TreatmentSessionProperty); (TreatmentSessionProperty,value);
}
////使用DependencyProperty作为TreatmentSessionProperty的后备存储.这将启用动画,样式,绑定等.在这个问题中,我还使用了MwiChild(来自http://www.codeproject.com/KB/WPF/mwiwpf.aspx).目前,我在FileOpenView中具有附加的依赖项属性. .
FileInfoView具有BackgroundWorker对象,FileOpenController将使用该对象读取保存的文件.它处理worker_ProgressCompleted事件.我如何从这里更新dependencyProperties?最重要的是,我使用的是正确的方法吗?
请提出建议. :D
谢谢..
Hi All,
I need a suggestion on how do I solve the following scenario:
I have three user Controls:
-> FileInfoView
-> SummaryView
-> PersonalInfoView
I used another userControl to group them together in FileOpenView:
<UserControl .... >
<TabItem header=>
<local:FileInfoView>
.................
</UserControl>
#region Attached Properties
public static TreatmentSession GetTreatmentSessionProperty(DependencyObject obj)
{
return (TreatmentSession)obj.GetValue(TreatmentSessionProperty);
}
public static void SetTreatmentSessionProperty(DependencyObject obj,Treatmentession value)
{
obj.SetValue(TreatmentSessionProperty, value);
}
// Using a DependencyProperty as the backing store for TreatmentSessionProperty. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TreatmentSessionProperty =
DependencyProperty.RegisterAttached("TreatmentSessionProperty", typeof(ABPMSession), typeof(OpenFileView));
#endregion
In this problem, I also used a MwiChild (from http://www.codeproject.com/KB/WPF/mwiwpf.aspx)
Currently I have an attached dependency properties in the FileOpenView.
FileInfoView have a BackgroundWorker object,which will be used by a FileOpenController to read a saved file. and it handles the worker_ProgressCompleted event. How do I update the dependencyProperties from here? and most importantly, am I using the correct method?
Please advice. :D
Thanks..
推荐答案
您好,
有关数据绑定的问题,请发布在 http://forums.microsoft.com/MSDN/ShowForum.aspx? ForumID = 7& SiteID = 1
谢谢!
Harry
Hi,
For the problem about databinging ,please post on http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=7&SiteID=1
Thanks!
Harry
这篇关于我该如何进行数据绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!