Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1935
Can ISL file be changed programmically?
posted

the Forums » NetAdvantage for Windows Forms » AppStylist for Windows Forms is missing the "Write a New Post" button under the big Search bar

http://es.infragistics.com/community/forums/173.aspx

can isl file properties be changed programically ? without changing the file its self?  i am reffering to the ResolutionOrder specifically = ControlThenApplication

like :

..... = Infragistics.Win.AppStyling.ResolutionOrder.ControlThenApplication;

i found an older post here :

http://es.infragistics.com/community/forums/p/11150/42339.aspx

and i was wondering if this task can be done by the avrage developer ? :) without the need to install the " AppStylist Runtime component"

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Yes, it is possible to change the properties of the isl in memory without necessarily affecting the isl file itself. It's a bit tricky, though, and there's not a lot of documentation on it, since it's such an unusual thing to do.

    If you want to change the resolution order for one particular control, (such as UltraButton) you could do something like this:

    ApplicationStyleLibrary styleLibrary = new ApplicationStyleLibrary();
                styleLibrary.LoadFromStyleManager();

                StyleSetSettings styleSet = null;
                if (styleLibrary.StyleSets.Count > 0 && styleLibrary.DefaultStyleSet != null)
                    styleSet = styleLibrary.StyleSets[styleLibrary.DefaultStyleSet];

                if (styleSet == null)
                {
                    styleSet = styleLibrary.StyleSets.Add("Default");
                    styleLibrary.DefaultStyleSet = styleSet.Key;
                }

                ComponentStyleSettings ultraButtonComponentRole = styleSet.ComponentStyles.GetComponentStyle("UltraButton", true);
                ultraButtonComponentRole.ButtonStyle = Infragistics.Win.UIElementButtonStyle.Flat;
                ultraButtonComponentRole.ResolutionOrder = ResolutionOrder.ControlOnly;
                

                styleLibrary.UpdateStyleManager();

    To affect "All Components", the properties are directly on the styleSet object itself:

    styleSet.ResolutionOrder = ResolutionOrder.ControlThenApplication;

Children