Is there a way to load the style at design time (in visual studio)?
No, there's no way to load an ApplicationStyle at Design-time. You can create your style using AppStylist or you can style you live application using the AppStylistRunTime component.
Well, to be honest it is quite handy and I do not know why you don't include the functionality. But still, it is quite simple, here is a control that can load a style at design time. It will also load it at runtime, so you don't have to bother putting something to load it in your app main. This is edited for brevity.
Hi Gilles,
There is no way to apply a style library at design-time. It can only be done at run-time.
Ok, thank you sir.
The above sample can be changed to simply use a Component instead of a UserControl, since you don't really need a control on the form to load the library. If you add a new Component to your project, add the Style property as mentioned above:
private string m_style;public string Style{ get { return m_style; } set { m_style = value; Infragistics.Win.AppStyling.StyleManager.Load(m_style); }}
After this build your component and add it to your form. Assigning the path of an ISL file was correctly reflected at design-time in my application.
-Matt
Hi ,
I transfered this into a component and it works really fine at design time. Now I want the component to load the style only if there isn't a style loaded yet.
That means:
1. Design Time: Style should be changed by the component.
2.Run Time: Style should only be changed by the component if there isn't another style loaded.
Like:
If <no other style loaded> Then
Infragistics.Win.AppStyling.StyleManager.Load(m_style)
End If
Regards,
KurtJulius
Hi again,
not sure if this is the best solution but I get it working like this:
If String.IsNullOrEmpty(Infragistics.Win.AppStyling.StyleManager.DefaultStyleSetName) Then
Infragistics.Win.AppStyling.StyleManager.Load(myStyle)