English 中文(简体)
在两个有活力的载荷用户控制之间如何综合数据?
原标题:How do I data-bind between two dynamically loaded user controls?

在我用XAML书写的主要窗口中,我有一面内容介绍人和主要内容介绍人。 每一区域都可以根据用户在应用中所做的情况,动态地将数种不同的用户控制之一与代码挂钩。

我的问题是这个问题。 让我们说,副内容用户控制将始终包含一个称为“SideBox”的盒子。 请允许我指出,主要内容用户控制将始终包含一个称为“MainBox”的盒式文字。 我如何将“MainBox”的价值与“SideBox”的价值挂钩,而不论我所装载的主要和次要用户控制组合如何?

最佳回答

提供 拥有他人可以约束的受扶养财产或对他人有约束力的财产

一些xaml:

<local:Uc1 x:Name="uc1" DataContext="{Binding ElementName=uc2, Path=Thing}" />
<local:Uc2 x:Name="uc2" />

这也可以在法典中做到。

or bind both UserControls to the same ViewModel.

问题回答

考虑到你正在使用微型信贷额度,通过2个基本观点模型的特性对2个文本箱具有约束力,其中观点模型相互更新将只做罚款。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签