Add resource dictionary and all controls disappears

5 posts, 2 answers
  1. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 06 Sep Link to this post

    Hi to all,

    I'm creating new project with a Common Style Dictionary, and merged with application resource.

    When I apply style to my control, this one disappers!

    I tryed with RadWindow and Radbutton, same result.

     

    I've attach several screeshots.

    Can you help me to understand?

  2. Answer
    Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    368 posts

    Posted 06 Sep Link to this post

    Hello Dario,

    When using implicit styles, you need to base these styles on the default styles that the theme provides.
    The convention is the following: the key for every control`s default style consists of the name of the control followed by a "Style" suffix.

    So, in this case, the two styles from your dictionary should be defined like so:

    <Style x:Key="RadButtonDialogStyle" TargetType="telerik:RadButton" BasedOn="{StaticResource RadButtonStyle}">
        <!-- -->
    </Style>
    <Style x:Key="RadWindowDialogModalFreezeStyle" TargetType="telerik:RadWindow" BasedOn="{StaticResource RadWindowStyle}">
        <!-- -->
    </Style>

    I hope that this solves your issue. Please let me know if any further questions or concerns arise.

    Regards,
    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 06 Sep in reply to Dilyan Traykov Link to this post

    Perfect!

    Thank you.

  5. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 09 Sep Link to this post

    Why it shows me this error, now?

    What am I missing?

  6. Answer
    Martin
    Admin
    Martin avatar
    60 posts

    Posted 09 Sep Link to this post

    Hello Dario,

    Make sure you are merging the needed resource dictionaries in you App.xaml. Try to clean, rebuild, restart VisualStudio if needed. Or empty the bin an obj folders of the project.

    Is the project running property, without any errors? If it visualizes properly, then you don't need to worry about it.

    Regards,
    Martin
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WPF is Visual Studio 2017 Ready