Refresh colors with Citrix & Office2013Palette

10 posts, 0 answers
  1. Hans
    Hans avatar
    13 posts
    Member since:
    Feb 2013

    Posted 13 Jan 2015 Link to this post

    My WPF app allows users to select between 4 accent colors. When they do, I update the Office2013Palette colors accordingly. On my own development machine this is working great: as I change the Office2013Palette all the colors in the app are updated in real-time. But when I deploy the application on Citrix the colors do not change immediately. Instead, it seems that the controls are only updated as they are reloaded/redrawn, for example, when switching between pages in the application.

    Is there a way to perhaps force an update of the colors?
  2. christianamado
    christianamado avatar
    8 posts
    Member since:
    May 2014

    Posted 13 Jan 2015 in reply to Hans Link to this post

    Hi Hans, Are you using Implicit styles or not? If you don't, you must use the StyleManager class in order to change colors.

    Regards.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Hans
    Hans avatar
    13 posts
    Member since:
    Feb 2013

    Posted 13 Jan 2015 in reply to christianamado Link to this post

    Hi Christian,

    Yes, I'm making use of implicit styles.
  5. christianamado
    christianamado avatar
    8 posts
    Member since:
    May 2014

    Posted 13 Jan 2015 in reply to Hans Link to this post

    Aha. If you're using Implicit Style you must have Theme folder (or something like that) and all your dlls from NoXAML folder. Remember to set LocalCopy to True in all dll properties. Take care about this ;)


    Hope it helps.
  6. Sia
    Admin
    Sia avatar
    667 posts

    Posted 14 Jan 2015 Link to this post

    Hello Hans,

    We had similar reports of such behavior depending on particular environment.
    Below are our suggestions that should fix it on your end:

    1. If you set a default value for AccentColor, do this before InitializeComponent()

    Office2013Palette.Palette.AccentColor = Colors.Red;
    InitializeComponent();

    2. In order to avoid such problems with setting the AccentColor run-time, try to merge the Office2013ResourceDictionary with all keys for its resources before all other resource dictionaries as shown below:
    <telerik:Office2013ResourceDictionary />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml"/>
    <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml"/>
    <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
    <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>

    Please try these and let us know whether your issue is resolved.

    Regards,

    Sia
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. christianamado
    christianamado avatar
    8 posts
    Member since:
    May 2014

    Posted 14 Jan 2015 in reply to Sia Link to this post

    Sia, What about dynamic themes on your #1 item?

    Regards.
  8. Sia
    Admin
    Sia avatar
    667 posts

    Posted 15 Jan 2015 Link to this post

    Hello Christian,

    The first one is not applicable when customizing the colors run-time, it could be applicable if there are issues initially. However none of these are mandatory. Most of the cases such customizations apply without any problems. But as I mentioned before, on some specific environments (such as .Net 4.0 Framework on windows server 2003) the same behavior was reproduced locally and that is why I suggested the second one as possible solution.

    Merging
    <telerik:Office2013ResourceDictionary />
    before the rest of needed resource dictionaries could resolve the hit problem. If not we will need more information about the environment in order to find solution on our end. A video showing the observed behavior also would be appreciated.

    Regards,
    Sia
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  9. Hans
    Hans avatar
    13 posts
    Member since:
    Feb 2013

    Posted 15 Jan 2015 in reply to Sia Link to this post

    Hi Sia, I can confirm that by adding the resource it now works for me. Happy to see that the solution was quite easy. :-)
  10. Benjamin
    Benjamin avatar
    1 posts
    Member since:
    Jan 2015

    Posted 21 Jan 2015 Link to this post

    Hello all,

    I had exactly the same problem as Hans and so I followed all your advices and the colors are now updating dynamically when I select a color.

    However, I still have two little problems in my RadRibbonView :
    - The mouse focus color of each RadRibbonTab headers stays the same as the previous one ;
    - The mouse focus color of each Checkboxes stays the same as the previous one.

    I have really no idea what could be the solution for this because when I restart my application, all the colors are corresponding to the new one selected before.

    Thank you very much in advance for your help !

    Regards,
    Benjamin.
  11. Sia
    Admin
    Sia avatar
    667 posts

    Posted 22 Jan 2015 Link to this post

    Hello Benjamin,

    The quickest resolution of your problem will be if it is possible to send us a small application reproducing your scenario. It is very important how you merge the needed dictionaries - in code or not - and their order also.

    If this is not possible, please let me know:
    - which is the version of telerik assemblies that you use?
    - which is the theme that you apply?

    Despite that I have checked our styles for the MS Checkbox and it seems that it should work as expected in all four themes with dynamic colors - Windows8, Windows8Touch, Office2013 and VisualStudio2013. Since you said that runtime it does not apply, but initially it works as expected, it seems to me that it is related to some specifics in your application. Also I am not sure which is the focus state in RadTabControl that does not change, because as checked locally such is not implemented at all. If sending a sample application is a difficult task, a screen-shot or video will help me a lot in giving you an adequate advice.

    Regards,
    Sia
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready