Hi
Ive created my own UserControl (contains of label + UltraTextEditor - and similar controls)Then in my UserControl class Ive added Browseable prop returning this contol
Like this:
[Browsable(true)] public Control _Editor { get { return this.ultraControl; } }
Then in design mode I can see in Visual Studio what Ive expected (_Editor node) - can do changes, changes are reflected in design preview.But issue is that those changes are not being saved. So if I close and open this file, or compile app - all changes I did in design mode are lost
Can you please help me understand what Im doing wrong here ?How to archive that?
I thought it should work out of the box, as you have already programmed your editor / serialization etc
If this is such complex topic - Im giving up - it is not that critical to me
I tried this out with both a TextBox and an UltraTextEditor and I get the same results. So I don't think your question is specific to the Infragistics controls.
But as a control developer, I've had a lot of experience with designer serialization - and I can tell you it's a lot more complicated than this. :)
I'm not sure simply exposing a control to the designer like this is a good idea. You will almost certainly run into a lot of weird issues with sub-objects and property change notifications that may or may not dirty the designer for some properties. I'm sure Microsoft has extensive documentation on the subject of developing your own controls and providing designer support for a wide range of scenarios, so if you want a really robust designer experience for your UserControl, you should probably start there. But as I said, it's a lot more complicated than you seem to be making it out to be. Having said all that, I was able to get a lot of stuff working in my sample using the DesignerSerializationVisibility.Content. This works for simple properties like Text. But I did not test it for anything more complex than that.
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public UltraTextEditor UltraTextEditor { get { return this.ultraTextEditor1; } }
Hello Maciej,
Does this happen with inbox controls? I saw a similar post on stackoverflow:
https://stackoverflow.com/questions/7093732/vb-net-usercontrol-with-designer-browsable-property-not-saving-value-at-run-time