English 中文(简体)
WPF, MVVER, Data binding, and ResourceDictionaries
原标题:WPF, MVVM, Databinding, and ResourceDictionaries

I ve got a View (MainView),其中载有一个主要内容领域(MainContent)。 这一观点得到了相应的观点(MainViewModel)的支持。 当然,主要内容根据申请的目前状况作了改动,并作为财产在《意见书》中作了表述。 MainContent的内容与SAML中的现行刑事判决一样:

Content="{Binding Path=CurrentPrimaryViewModel}"

有一个资源库,包含一个观点宝库; 观察数据模板。 因此,如果目前的普通意见是XViewModel,那么就解决了X意见。

所有这一切都奏效。

问题是,每当现行立法意见发生变化时,都会形成一种新的观点。 我所喜欢的是,只要把数据内容改为正确的观点,那么这种观点就变成了主线。 基本上与卡斯特拉一样? 来自 Java的布局,或没有明显表格的塔布特。

处理这种情况的适当技术是什么? 难道我只得在主会的总结下提出各种意见,并探讨其可见度或Z-Order? 是否有良好的模式? 为了达到这一目的,主文和主文之间应该有什么样的约束?

问题回答

AFAIK对此没有控制。 然而,在我看来,这样做似乎非常容易(你知道,友好是灵魂)。 你们都需要做的是创建一种习俗:DataTemplateSelector,这将为你的Contratrols提供模板。





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

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. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签