WPF MVVM XAML 设计 - VS 2010 XAML 设计器 - 设计时数据 [英] WPF MVVM XAML design - VS 2010 XAML designer - Design time data

查看:49
本文介绍了WPF MVVM XAML 设计 - VS 2010 XAML 设计器 - 设计时数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发 WPF 应用程序.我们已将视图的开发委托给使用 VS 2010 XAML 设计器进行设计的设计人员.我们已经进入了 MVVM 模式.我们期待 XAMl 设计人员设计屏幕/视图,并基于屏幕我们将开始构建 ViewModel.但是设计人员在查看没有设计时数据的视图布局时遇到了问题.有没有办法解决这个问题?

We are in the process of developing a WPF app. We have entrusted the development of the Views to designers who would use VS 2010 XAML designer to design. We have gone in for MVVM pattern. We are expecting the XAMl designers to design the Screens/Views and based on the screens we will start constructing the ViewModel. But the designers are having a problem viewing the layout of views without design time data. Is there a way to solve this?

推荐答案

您可以遵循以下指南:

您开始向 XAML 文件添加以下命名空间声明:

You start adding the following namespace declarations to your XAML files:

mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

您可以设置在运行时忽略的属性和属性.

The you can set properties and attributes that are ignored at runtime.

例如,d:DataContext 使您能够设置独立于运行时 DataContext<的设计时 d:DataContext/代码> 属性.

For example, d:DataContext gives you the ability to set a design time d:DataContext that is separate and independent from the run-time DataContext property.

这篇关于WPF MVVM XAML 设计 - VS 2010 XAML 设计器 - 设计时数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆