Does Visual Studio 2010 view designer allow data to be loaded through external XML files during design time?
It appears that I can add it through D: Datacontext, but I have a lot of data and it is easy to load it via XML. Is it possible?
You can do a design time version of the repository (or other object) that you can run A simple approach that I use on a regular basis is similar.
In App.xaml:
& lt; Application ... & gt; & Lt; Application.Resources & gt; & Lt; Local: MyClass x: key = "DesignData" /> & Lt; /Application.Resources> & Lt; / Application & gt; Then you can find out in the category creator that you are in design mode and can populate the data accordingly:
public class MyClass {Public MyClass () {Bool is InDesign = DesignerProperties.GetIsInDesignMode (New dependency object ()); If (indesign) {// load your XML + other setup routine} // normal CTOR code}} Finally, use this item and its data as your reference Please.
& lt; Window ... & gt; & Lt; Grid D: Datacentext = "{Static Resources Design Data}" & gt; ... & lt; / Grid & gt; & Lt; / Window & gt; This is probably a simple approach, which you can use to get complex design time data. Of course you may need to use subclasses of 'Myclass' or other methods for very complex scenarios, but it seems that you know enough to understand it, speaking from personal experience, Use can be used to create design data for any program condition that you can think of, and if you want to get live data from DB you can Can. Of course, before you start thinking about the design data in your application, in fact it has to work really.
Comments
Post a Comment