Does Expression Blend and Visual Studio Render WPF Controls Differently

孤街浪徒 提交于 2019-12-19 09:09:55

问题


In my WPF App, I have designed the Form using Expression Blend. To my surprise, the rendering is quite different when I load the solution using Visual Studio 2008. What is even more surprising, when I run the application, the resulting UI is different from the rendering done by both VS and Blend. Though I have not provided by XAML code, but in general is this a known Issue?


回答1:


This is most definitely a known issue. Visual Studio uses what's known as the Cider designer to render WPF code. It most definitely renders XAML differently from Blend. Cider in VS2008 is pretty terrible, but gets much better in 2010 (but is still pretty terrible compared to Blend). One of the main differences between Cider and Blend is that Cider will read the code behind file (*.xaml.cs) while Blend will completely ignore it. Another notable difference is that Cider doesn't really understand things like Visual States and Blend SDK Behaviors (especially when you mix the two) while Blend completely understands them.

If you're constructing your view classes where you set your DataContext in XAML and then provide design time data (using Blend or a view model locator), you'll find that there are very few differences between Blend and how something actually looks at runtime.



来源:https://stackoverflow.com/questions/7108895/does-expression-blend-and-visual-studio-render-wpf-controls-differently

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!