All, I am running the AppStylist for the first time. I havn't been able to find any code samples to use in Visual Studio (2005).
I want to use (atleast at first) one of the default style libraries (such as "FlatNature.isl" or "TheBlues.isl").
I can add a appStylistRuntime, but can't seem to load a library.
What is the fastest, simplest way to load a library?
Also, where can I get technical (i.e. C#) documentation on AppStylist
dap
I'm not sure exactly what you're trying to do with AppStylist. There is no programmatic interface to use within AppStylist itself, though you can use code in your application to load style libraries, or resolve appearances for a given role. To load a style library in your application, you can use:
Infragistics.Win.AppStyling.StyleManager.Load("myFile.isl");
Could you be a little more specific with what you're trying to accomplish?
-Matt
My problem is in the loading of the style library.
when I use the following. It does not does not appear to work.
I have added the appStylistRunTime object
I have added the following lines of code
using Infragistics.Win;
using Infragistics.Win.AppStyling;
using Infragistics.Win.AppStyling.Runtime;
It does not seem to use the default style
Do the controls on the form have the UseAppStyling property set to True (the default)? Are you certain that the styleset you're using targets those controls (i.e. you can see the controls properly styled when loading the style from within AppStylist)? It's difficult to say what's going on here without seeing your code, so it may be best to submit this issue to the support group so that they can look into it:
Get Help
It seems to work if I use the following code
StyleManager.Load(@"C:\style_libs\black.isl");
How do I set it up to have it use a style that is in a "styles" directory within the project directory?
This would be the same as trying to programmatically open a FileStream with a file, since the path that you specify to this method is relative to the location of the running application, so you could have @"..\..\styles\black.isl", assuming that your styles directory is two levels above the directory of the exe. Of course, this isn't a good solution in the long-term unless you know that you're deploying your application with the styles directory in the same relative location.
What is the typcial method of deploying applications using the AppStylist?
Do you set a default directory (relative to the executeable) where you store your styles?
Can the styles be incorporated into the executeable durring the build?
I can't say how most users are deploying their applications with ISL libraries, so perhaps someone will chime in here with his/her experiences on deployment, but you could certainly create your own directory to look for in the installation directory, or you could make the ISL an embedded resource of the solution and load it into a stream. In order to do this, you need to have a type that exists in your assembly/project, such as your derived Form. Additionally, you need to make sure that the isl is included in the project and its Build Action is set to Embedded Resource. Then, you could use code similar to the following:
Type type = typeof(Form1);using (System.IO.Stream stream = type.Assembly.GetManifestResourceStream(type, "Styles.Aero.isl")){ Infragistics.Win.AppStyling.StyleManager.Load(stream);}
Note that a period is used to separate directories in addition to file extentions (i.e. 'Styles' is the project folder that contains 'Aero.isl').
Calling StyleManager.Load and passing in an isl file applies to the entire application. You do not have to do it for each form.
If you want to style the inbox (non-Infragistics) controls, like the TextBox, Button, etc. then you will need to place an InboxControlStyler component on each form/usercontrol which contains any of those controls.
Thanks, I had the same question, one follow up one, do I need to set this on each form, or can I do it one for the entire application?
Thanks again for the help. Where can I get additional styles?
That was it. Had a dumb ass attack. Thanks everyone. Much appreciated
Are you sure that you've included Aero.isl as an embedded resource in the project? It should be visible in Solution Explorer, right-click on the file and make sure that the Build Action is set to "Embedded Resource". Also make sure that you have this in a Styles folder within the project.