Wisej designer removing code, the Text property

2
0

Hi Wisej,

while porting webgui project, I have found interesting scary behaviour. When I open the user control in designer and save it, it removes the Text property of the user control, in which we regularly store the title of window to appear.

Please see the svn compare screenshot attached.

How to solve this?

Regards,

Pavel Weiss

  • You must to post comments
0
0

Hi Alaa,

please see attached screenshot. It happens regularly, the Text property is missing on UserControl even if I create complete fresh project with Wisej-3

Legend to attached screenshot:

A … missing property

B … wisej-3 reference

C … strangely in Toolbox there is only Wisej 2.2 controls section, even if I completely removed all Wisej installations and installed v 3.0.12 only.

Please help on how to solve this.

Regards,

Pavel Weiss

  • Alaa (ITG)
    The UserControl doesn’t serialize the Text property by design. It doesn’t do anything on the UserControl, so it’s hidden. The property actually exists and so you can assign it by code, or use the Tag or UserData properties to save the value in, but in this case since it doesn’t make a difference visually, it won’t be serialized by the designer. And for your issue regarding the ToolBox controls, you can go to https://docs.wisej.com/docs/releases/whats-new-in-3.0/visual-studio-designer#toolbox for a quick fix!
  • Pavel Weiss
    Ok, I understand your point. In reality, we are having UserControls with Text set, and showing them by wrapper function, something like “instantiate form on the fly, put the UserControl in it, Dock.Fill,. and change the Title of the form to the Text of the original control. This way it worked in webgui, and in my opinion it would be nice to have such similar functionality in Wisej as well, not to break the upgrade process of webgui projects. Please think about it if you can have this if future updates, otherwise, we need to manually change this in 1000+ controls. Ufff.
  • Luca (ITG)
    We try not to replicate all the (very many) webgui mistakes. The text property is available in code but not in the designer since it doesn’t have any functionality in a user control. You can very easily extend the UserControl class (MyUserControl : UserControl) and override the Text property (use base,Text) and simply add the Browsable true and DesignerSerializationVisibility attributes.
  • You must to post comments
0
0

Hi Pavel,

Is it always happening the first time you open a Control after porting it to Wisej, or does it happen often?
The designer would always attempt to reserialize everything when saving, for example if you have commented out any lines of code and you would save the Control from the designer tab, those comments are going to be deleted.

HTH,
Alaa

//

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.