一个DataTemplate的设计视图在Visual Studio中的ResourceDictionary [英] Design View of a DataTemplate in a ResourceDictionary in Visual Studio
问题描述
有没有办法在一个DataTemplate preVIEW GUI?例如如果我有一个资源字典,包含一个DataTemplate,数据模板包含GUI code,像
Is there a way to preview GUI in a DataTemplate? e.g. if I have a Resource Dictionary, containing a DataTemplate, and the Data template contains GUI code, like
<DataTemplate x:Key="MyTemplate">
<StackPanel>
<TextBox Text="AAA"/>
</StackPanel>
</DataTemplate>
我可以只查看了StackPanel的? (如previewing在设计视图中的用户控件)。如果无法与原来的VS,有一个插件是什么?
Can I view just the stackpanel? (like previewing a UserControl in design view). If not possible with original VS, is there a plugin for that?
推荐答案
Visual Studio中不支持这样做,但前pression交融呢,如果你能访问它。这里有几种方法可以编辑模板资源的一些说明:
Visual Studio doesn't support doing this, but Expression Blend does, if you can get access to it. Here's some instructions on several ways to edit template resources:
<一个href="http://msdn.microsoft.com/en-us/library/cc294908%28v=ex$p$pssion.40%29.aspx">http://msdn.microsoft.com/en-us/library/cc294908(v=ex$p$pssion.40).aspx
在特定的,如果你想编辑位于ResourceDictionary中一个DataTemplate你会:
In particular, if you'd like to edit a DataTemplate located in a ResourceDictionary you would:
- 加载该项目在混合
- 找到包含的ResourceDictionary在资源面板的.xaml文件(右停靠默认情况下)
- 找到的DataTemplate中的资源(由Key)名单
- 点击修改资源
- Load the project in Blend
- Locate the .xaml file containing the ResourceDictionary in the Resources panel (docked right by default)
- Locate the DataTemplate in the list of resources (by Key)
- Click Edit Resource
我知道这一个老问题,但我希望这可以帮助!
I know this an old question but I hope this helps!
这篇关于一个DataTemplate的设计视图在Visual Studio中的ResourceDictionary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!