Just a quick question...I have a form with a LOT of infragistics controls. Usually everything is styled the same...
On the code behind for the form designer...where it sets up the controls and layouts....I have A LOT OF THESE.
Infragistics.Win.Appearance appearance107 = new Infragistics.Win.Appearance();
So...I know I saw something in an Article Mike S. wrote about re-using appearences. Can I set up ONE appearence ....let's say in a glass that is global to the software..and just reuse it? I am thinking to setup a single appearence for each control type and use it this way? I am thinking in the right direction or do I not need to worry that I am up to appearance 200 on just 1 form?
Thanks. I know I ask a lot but we have a lot of people using our software. (and your controls).
Yes, you can and ashould do it that way. Assuming the property settings are the same, you can instantiate one Appearance object, set the properties on it, and set the Appearance property of the consuming control/object, rather than use the Appearance instance that is automatically created by the property getter.
One thing to note is that you might not be able to do this in the designer, but the code is rudimentary.
Do you have an example of this?
I would have to instaciate it in it's declaration I believe..outside of the constructor otherwise the designer is going to throw an error....I think.
To that effect...it would be nice for me to setup just 1 class with the appearances.
You know what though, I am using the infragistics Styles.
Infragistics.Win.AppStyling.StyleManager.Load(@"styles\blue.isl) for instance.
So, why if I am doing this, would the Infragistics controls need any appearences anyway?
Acctually, I am still not sure what to do here.
let's take into consideration a toolbarmanager. If I want to set the Image of a button at design time, it is going to create an appearance object in the designer portion of the code. So explain to me the order of operations here, I load my style when when the app loads...the image remains on the button, yet it takes the style from .isl. How?
Is the appearance merging somehow with the one that is being applied by the style?
It is the same situation when let's say I want to just make the text bold on a toolstrip label. It creates a whole new appearence object. I am not setting the style in .isl for this bold label because it not a rule that it should be bold.
Fantastic thanks!
Hello Melegant,
Appearance is a class that contains a set of properties related to the visual appearance of an object. Each of Infragistics control has a property appearance to set up them visual style like a BackColor, ForeColor, Font and act. A control which has a child control, like UltraTreeNode has a child control – UltraNode, has a appearance property for each child. (I send you a sample that demonstrates this)
You can generate own appearances manually or with “AppStylist for Windows Forms ” (more about that at: http://ko.infragistics.com/dotnet/netadvantage/appstylist/winappstylist.aspx) after that you can set your appearance to a control. If you uses AppStyle like blue.isl, your appearance settings won’t be honored, in other words the application style list file will override all of the existing appearances that are set.
Application styling framework:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/Win_Application_Styling_Framework_ASF.html
Styling , presets and Themes:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2010.1/CLR2.0/html/Win_Overview_of_Styles_Presets_and_Themes.html
I have also attached a sample how to load .isl styles.
Note that in sample there are no Infragistics.Win.Appearances in the form designer code.
Please do not hesitate to ask if you have any further questions.