开发者

WPF quick prototyping. See changes without running

I'm doing a WPF application, using Blend4 and VS2010 for editing the XAML files.

One of the most anoying things of this is the pro开发者_运维百科cess of making small changes and see them in action. As the data in the View is populated from a ViewModel and a Model via Bindings, the things you see in the Blend designer aren't the same you get when you run your application. You need to recompile and "re-run" your application every time you make a change, no matter if it was only to change a pixel in the margin of some element.

I want to know if there is any way to perform quick changes in your XAML and watch them in the real interface.

Like in the Websites, the idea is similar to make a change in the HTML and then press F5 to see the changes.

Maybe you can run "part" of your application to bind the view data to the model, and then change only the "view code" of the xaml.

Do you know if this is possible?

Thanks!


Whether using Blend or Visual Studio, the key to rapid design of MVVM user interfaces is sample data. You can use the same view model at design-time as you you do at run time as long as the data is doesn't access services.

Whether you are using MVVM Light or not, you can use its technique to allow your view-model to detect design time and return different data. You can also read Laurent Bugnion's ideas on sample data here:

  • WPF: Simulating data in design mode in Microsoft Expression Blend
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜