阅读背景:

如何使用DataTemplate的DataTriggers基于Window的ViewModel属性更改ContentControl的Content属性,该属性是枚举值

来源:互联网 

I ask for your help in solving something that is simply said and most likely simply done but not for me at the moment. What I'm developing is an application that looks like Office 2013 using FluidUI control set. I want to achieve view switcher from Word/Access where on ribbon there is Views tab and there are buttons which switches views. I thought that storing whole View object inside my ViewModel's property CurrentView is wrong way and I try to make this application as MVVM pure as possible. This application is more like "How to write app using MVVM" because I'm still learing WPF. Ok. So I have my Window (MainWindowModern to be correct) which has Fluid Ribbon. There are 3 buttons to switch views (I call them Editors). What they do is to change MainWindowModern's ViewModel's CurrentView property and set new enum value to it. This part of setting new enum value is done and works. Now. The main body of the window is just ContentControl. Now I want to change this ContentControl's Content property based on DataContext.CurrentView property value. Like I said it before. I don't want to do any code-behind inside view's c# (i'm writing this app in C#) file. The only thing that doesn't work is just changing ContentControl Content property. I'm trying to do this using DataTemplates and DataTemplate.TriggersI ask for your help in solving something that i




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: