C1RibbonForm.ThemeChanged in subclass not called, wrong theme version error

Posted by: wknauf on 29 October 2024, 6:30 am EST

  • Posted 29 October 2024, 6:30 am EST - Updated 29 October 2024, 6:36 am EST

    See attached sample - it has three questions/problems: I have a C1RibbonForm subclass and override “ThemeChanged” (yes, the comment states “Use internal only for theming support.”, but it is virtual and I thought it would me ;-)).

    The reason to do so is that I wanted to do some post processing after the theme was applied.

    ThemeTest.zip

    When doing so, some things break:

    Problem 1:

    A messagebox about a non matching theme version is shown:



    The reason is probably that your code internally tries to find the theme version from the assembly of my form, which is not “C1.Win.Themes” here and does not contain the expected “ControlThemeVersion” type

    Type type = a.Assembly.GetType("C1.Win.Themes.ControlThemeVersion", throwOnError: false, ignoreCase: false);

    Problem 2:

    My override “ThemeChanging” is not called.

    Problem 3:

    I implemented “IC1Themeable”, and here “IC1Themeable.OnThemeChanged” is also not called.

    It works if my form does not implement “ThemeChanging”. In this case, “IC1Themeable.OnThemeChanged” is called as expected. So this is probably the suggested solution.

    Just want to bring this to your attention. If it is not supported, you probably should hide “ThemeChanged” or make it internal?

    Best regards

    Wolfgang

  • Posted 30 October 2024, 12:37 am EST

    Hello Wolfgang,

    Thank you for sharing the details and bringing the behavior to our attention. We have shared your concerns with the development team and will get back to you once we have more information.

    [Internal Tracking ID: C1WIN-33248]

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels