Hi all,
In my application I have used
appStylistssample.ShowRuntimeApplicationStylingEditor(Me, "Change Look and Feel")
to load the appstylist, where in the user can select an existing isl file or create a new one .
I have got a requirment that when the user closes the application and reloads the application, the previously selected style library should be loaded.
I have seen a function called LoadFromStylemanager of the appstylist which takes the file names as input.
Now, my question is, how does the user store the file path of the previously loaded isl?Once the ShowRunTimeapplicationstyling editor is loaded,
i dont find any reference to the loaded appstylist.
Is there a way where the opened file path can be retrieved from the appstylist?
Hi,
I don't think so. If the path is exposed, my guess is that it would be exposed by the AppStylistRunTime component. But I don't think it is.
In any case, would you really want to use the path the user chose? It seems to me like that might be a bit dangerous. If the user chooses an isl file, they probably expect the application to maintain the current settings, rather than reading it from a specific file location every time. It seems to me that the thing to do would be to get the currently loaded style library and save it to an isl file specifically used by the application, maybe in the same folder with the exe.
Yes, the requirement just demands the previous settings to be retained.I am trying to get the file path so that I could use it for the "LoadFromStylemanager" function.
I dont know as to how to do the way you suggested.
I find in the Application settings of the AppStylistEditor wherein there is a property called "StyleLibraryName".
I created a New value (I named it LoadStyleLibrary) but am not able to assign the stylelibrary that I loaded to it.
The StyleLibraryName value that I assign should get stored in the application configuration settings file. What value should i assign to the StyleLibrary Name?
My.Settings.LoadStyleLibrary = appstylist.<"something">
what should be this <something>
LoadStyleLibrary-->Bound application settings value
appstylist-->Name of the appstylistRuntime component in my application.
Can you please help me in the same?
My only clarification is how to get the name of the loaded file?
I launched the appstylist using ShowRuntimeApplicationStylingEditor, the appstylist dialog gets launched. I selected a file by using the "Load" option. The application changes its appearance based on the selected isl file.
I closed the appstylist. I have to store the file settings of the file that i just loaded. how to do that?
There are only two events for the appstylist editor Disposed and PropertyChanged. Both of them weren't helpful to achieve what i needed.
Is there something else tha I could do?
There's no way that I can see to get the file name of the loaded style, as I said. I think what you have to do is load the current style information and save it to a new file associated with your application. The code to do that would be something like this:
ApplicationStyleLibrary lib = new ApplicationStyleLibrary();lib.LoadFromStyleManager();lib.Save(filename);
Thanks....!!!
This is what I wanted.
Best regards
Sue