c# - UserControl cannot be displayed in Designer - null object reference -
I have created a user control with a compartment in it. This Cambodia has a XML population, when it does not exist, this resource The file is loaded from.
It works fine in the program, but it can not be displayed in the designer - it says: "Object references are not set to be an example of an object."
Load the list from xml Zero reference check in the responsible square is lost due to reasons beyond my understanding ...
public sortedDictionary & lt; String, string & gt; Country {Receive (if object.ReferenceEquals (countries, empty)) {GetCountryList ();} Countries of return;}}
The population of the combo box is as follows: / P>
comboBoxCountry.DataSource = new binding source (program languages, blank);
programmable language
But it does not help the designer.
The question is, how do I (combo box) to display my control in the designer? How to compile the combobox (= from XML to load list).
If possible, you can Do you want to check for this.DesignMode
and then do not load the combo box on design-time
Comments
Post a Comment