Is there a way to load the style at design time (in visual studio)?
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)
End If
KurtJulius
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)
Regards,
Wow, this liitle control works wonders. I don't know if they fixed this in the newer versions, but I still have and 08 version and this control has made my life alot easier. If there is an approved fix let me know.
Thanks,Joe
jaimi said:But - honestly - has it really never occurred to you that we want to see what things look like while designing?
No, that's not what I said. I said it never occurred to me that you could show the AppStylistRun-time at design-time by deriving your own form. In fact, this approach is not completely new - it came up when we were designing the feature.
There are a couple of caveats to doing this, however. For one thing, if you are going to do this, you should make sure that only one form does it - or at least that only one form is open at a time. Otherwise, you will have two conflicting AppStylist libraries running at once and one could affect the other.
Another pitfall is that loading the AppStylist Runtime at design-time may affect the control designers.
Also, I don't think it will work on InBox control, since those controls require an InboxControlStyler and this component will not exist on the Form Designer itself at run-time.
These issues may not matter to you if you are writing a relatively simple application with a single form (or at least a single main form), but in a complex application where you are loading more than one form, or you have more than one project, or reference other assemblies that are not in the same solution, it can get very complex, vrey quickly.
The AppStylistRunTime was designed to let you run your application and style it while it is actually running and this allows you to style the Inbox controls, the Infragistics controls, save the library, load a library and everything else you would need to do to style your application. So it was not considered a high priority to allow styling at Design-time.
The first post control works also, and doesn't require special forms.
But - honestly - has it really never occurred to you that we want to see what things look like while designing?
It's simple enough for some of us to write our own controls, or create our own forms, but for some people it's not that intuitive. Personally, I have used other controls from other vendors that had this functionality. I wasted half a day looking through documentation trying to figure out the "official and correct way" to get it done. It took 5 minutes to write the control above (and then an additional 2 hours to create a better one that would pull from the application dir or a central repository). I still wonder why this sort of thing isn't done in your control library itself.