Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Default theme + license Collapse All
Subject Author Date
Victor Derevyanko Jul 30, 2008 - 2:16 AM

Hi,

My application uses Elegant.Ribbon and ELegant.Common controls with System theme. By default, ribbon and common controls use Office2007Blue theme. I hadn’t find a way to change default settings to the system theme, so I switch theme programmatically after start of application before first using of ribbon controls.


[STAThread]
static void Main() {
Elegant.Ui.SkinManager.LoadEmbeddedTheme(Elegant.Ui.EmbeddedTheme.System, Elegant.Ui.Product.Ribbon);
Elegant.Ui.SkinManager.LoadEmbeddedTheme(Elegant.Ui.EmbeddedTheme.System, Elegant.Ui.Product.Common);
Application.EnableVisualStyles();
.... }


This approach worked fine on the trial version. Now, we have bought Elegant.Ribbon library, so i have modified the code above to:


[STAThread]
static void Main() {
Elegant.Ui.SkinManager.LoadEmbeddedTheme(Elegant.Ui.EmbeddedTheme.System, Elegant.Ui.Product.Ribbon);
Elegant.Ui.SkinManager.LoadEmbeddedTheme(Elegant.Ui.EmbeddedTheme.System, Elegant.Ui.Product.Common);
Elegant.Ui.RibbonLicenser.LicenseKey = "BLA-BLA-BLA";
Application.EnableVisualStyles();
...}


Now, my application doesn’t work without assembleis "Elegant.Ui.Common.Theme.Office2007Blue.dll" and "Elegant.Ui.Ribbon.Theme.Office2007Blue.dll" and i conldn’t find a way how to fix it. Of course, I don’t want to include these assembleis to setup - my applications doesn’t use them at all and thier size is approx 1.4 mb ...

Can anybody tell me how to avoid this problem?

Thanks a lot in advance,
Victor Derevyanko

Technical Support Jul 31, 2008 - 9:55 AM

We confirm this bug. Thank you. We will certainly fix it in the next release. Meanwhile we have just sent you a temporary fix, which allows you to use the ribbon without default theme assemblies. To make this work, please use the code as follows:

 [STAThread]
        static void Main()
        {
            LoadSystemTheme();

            ApplyLicenseKey();

            // other code goes here
        }

        private static void LoadSystemTheme()
        {
            Elegant.Ui.SkinManager.LoadEmbeddedTheme(Elegant.Ui.EmbeddedTheme.System, Elegant.Ui.Product.Ribbon);
        }

        private static void ApplyLicenseKey()
        {
            Elegant.Ui.RibbonLicenser.LicenseKey = "License code goes here";
        }
As you can see the method calls for loading a theme and apply the license key are separated. This feature is very important to make all this work, it is related to the internals of the ribbon and specifics of the JIT compiler. We’ll try to get rid of this unnecessary tricks in the code in the next version.