Themes

13 posts, 2 answers
  1. Zack
    Zack avatar
    112 posts
    Member since:
    Jun 2012

    Posted 19 Apr 2012 Link to this post

    I couldn't find a better place to put this request or opinion...
    I would also like to see the ganttview work with the different themes as I am finding it is the one control in our entire application that you can't read and looks out of place if the user select certain themes, especially expression_dark.

    It would be really nice if you could simply
    StyleManager.ApplicationTheme = (Theme)themeUserSelected;
    InitializeComponent();
    and have the ganttview match the rest of the application without having to use downloaded resource dictionaries or workarounds.
  2. Answer
    Dani
    Admin
    Dani avatar
    848 posts

    Posted 20 Apr 2012 Link to this post

    Hi Zack,

    Since RadGanttView is at this stage a CTP version, it does not yet provide full functionality as other RadControls. Also, it does not have all themes as other RadControls. RadGanttView can currently be styled with Office Black, Office Blue, Office Silver, Metro and Windows7 themes.

    All other themes for RadGanttView will be included in 2012 Q2 release in June.

    Other important key note here is that the control cannot be styled via the Telerik StyleManager. We are introducing a new theming mechanism which relies heavily on implicit styling, and the StyleManager is not part of it. In fact, while the StyleManager is still supported, it will be dropped in 2012 Q3. RadGanttView supports the new theming mechanism only and support for Telerik StyleManager is not planned.

    While this may seem confusing at first, it is in fact good news because implicit styles have many benefits over the regular theming with the StyleManager. These include easier application of custom styles based on a theme, simple runtime themes switch and others. At this stage you can style RadGanttView by referencing the RadGanttView assembly (or an external WPF theme of your choice) and merging the theme in App.xaml as showed in this help article on styling RadGanttView.

    Hope this info will be helpful.

    Regards,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Zack
    Zack avatar
    112 posts
    Member since:
    Jun 2012

    Posted 20 Apr 2012 Link to this post

    Thanks for the detailed explanation. Is there info already available on the implicit styling? If it is replacing stylemanager in 6 months, I'm sure many users would appreciate having enough time to change their applications and test things so they can continue to keep the programs up to date with your quarterly releases.

    Personally I know there are existing possibilities for binding themes to controls for runtime switching, but I love the simplicity of stylemanager global theme setting even if it does require us to restart the application instance in order to handle user theme changes.
  5. Dani
    Admin
    Dani avatar
    848 posts

    Posted 24 Apr 2012 Link to this post

    Hi Zack,

    Please, check the introductory Implicit Styles article that will provide some important details on the theming changes.

    We encourage our clients to consider using implicit styling as a replacement for the StyleManager. The StyleManager is still supported and it will be supported at least for some more additional time to ensure the transition between the old and new theming is as smooth as possible for our clients. Yet, the StyleManager will eventually be dropped at some point in the future.

    Greetings,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  6. Zack
    Zack avatar
    112 posts
    Member since:
    Jun 2012

    Posted 29 Jun 2012 Link to this post

    I just changed our large application to no longer use stylemanager but to use implicit styling through merged noxaml dictionaries.
    Everything works great and changing design at runtime is super easy but any of our windows that inherit RadWindow still show up with only the default theme... we use ribbonview, datafilter, combobox, docking, gridview, properties and ganttview in this app and here is the code we use to change implicit styling at runtime:

    var s = String.Format("/Telerik.Windows.Themes.{0};component/Themes/", theme);
    Application.Current.Resources.MergedDictionaries.Clear();
    Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(String.Format("{0}System.Windows.xaml", s), UriKind.RelativeOrAbsolute) });
    Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(String.Format("{0}Telerik.Windows.Controls.xaml", s), UriKind.RelativeOrAbsolute) });
    Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(String.Format("{0}Telerik.Windows.Controls.Data.xaml", s), UriKind.RelativeOrAbsolute) });
    Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(String.Format("{0}Telerik.Windows.Controls.Input.xaml", s), UriKind.RelativeOrAbsolute) });
    Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(String.Format("{0}Telerik.Windows.Controls.Navigation.xaml", s), UriKind.RelativeOrAbsolute) });
    Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(String.Format("{0}Telerik.Windows.Controls.RibbonView.xaml", s), UriKind.RelativeOrAbsolute) });
    Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(String.Format("{0}Telerik.Windows.Controls.Docking.xaml", s), UriKind.RelativeOrAbsolute) });
    Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(String.Format("{0}Telerik.Windows.Controls.GridView.xaml", s), UriKind.RelativeOrAbsolute) });
    Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(String.Format("{0}Telerik.Windows.Controls.GanttView.xaml", s), UriKind.RelativeOrAbsolute) });
  7. Dani
    Admin
    Dani avatar
    848 posts

    Posted 29 Jun 2012 Link to this post

    Hi Zack,

    Are you using the 2012 Q1 SP1 version of RadControls? We introduced a fix for RadWindow particularly with the 2012 Q2 release. If using the latter version, you should have no problems with RadWindow implicit styling.  You might need to upgrade.

    Let me know if you have problems applying implicit styles.

    All the best,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  8. Zack
    Zack avatar
    112 posts
    Member since:
    Jun 2012

    Posted 29 Jun 2012 Link to this post

    Using: 2012.2.607.40

    Each of these windows are made like the following:
    XAML:
    <telerik:RadWindow x:Class="Tools.Options"
            Header="Options" Height="273" MinHeight="273" MaxWidth="284" MinWidth="284" CanClose="False" IsTopmost="True" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">
        <Grid></Grid>
    </telerik:RadWindow>
    CODE:
    public partial class Options : RadWindow{}

    Every(controls) show the correct theming but the window frame and background do not. See attached images of the issue happening and my VS Project References.
  9. Answer
    Dani
    Admin
    Dani avatar
    848 posts

    Posted 02 Jul 2012 Link to this post

    Hi Zack,

    Thank you for the shared details. When you use RadWindow as a UserControl, you need to add a separate Style to make sure implicit styles apply correctly.

    The Style must be targetted at your own local RadWindow and based on RadWindowStyle.

    For example:
    <Style TargetType="local:Options" BasedOn="{StaticResource RadWindowStyle}" />

    Place this style on application level.

    I hope this will be helpful.

    Greetings,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  10. Zack
    Zack avatar
    112 posts
    Member since:
    Jun 2012

    Posted 02 Jul 2012 Link to this post

    Thanks applying the style to this staticresource does the trick. Since we have many windows I am setting the Style attribute of each window as opposed to the suggestion of having it in the app.xaml and it works well.

    Are there any other controls that you have to specifically set the style for other than RadWindow? What about RadRibbonWindow?
  11. Dani
    Admin
    Dani avatar
    848 posts

    Posted 05 Jul 2012 Link to this post

    Hi Zack,

    Placing the style on application level will be needed only if you apply it implicitly as is. If you apply it explicitly to each inherited RadWindow, it will apply just fine as a regular StaticResource.

    It is not needed to add an additional style for the RadRibbonWindow in particular.  It is not needed to add such a style for another of our controls either. Implicit styling should work properly without addition of styles. 

    However, please note that anytime you inherit a RadControl you will need to add an additional style which has a TargetType pointing to your own derived control. This is a specific issue of the framework . And usually additional implicit styles are added when inheriting RadWindow or RadPane. The case with using RadWindow as a UserControl is just this type of usage which requires adding the style mentioned in my previous post. 

    I hope this information will be helpful.

    Kind regards,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  12. Zack
    Zack avatar
    112 posts
    Member since:
    Jun 2012

    Posted 05 Jul 2012 Link to this post

    Everything is great except for the grid. We try to apply cellstyle and it just shows blank rows. You can't left click them, but you can right click and get a fully functioning context menu that shows data from the row properly.

    We are referencing the assemblies from the binaries.noxaml/wpf40 and have our merged dictionary list in what I believe to be correct order.

    Here is how we are setting the cellstyle:
    //(gc = (GridViewBoundColumnBase) grid cell)
    gc.CellStyle = new Style(typeof(GridViewCell));
    gc.CellStyle.BasedOn = Resources["GridViewCellStyle"] as Style;
    if (c.Background != null) gc.CellStyle.Setters.Add(new Setter(GridViewCell.BackgroundProperty, c.Background));
    if (c.Foreground != null) gc.CellStyle.Setters.Add(new Setter(GridViewCell.ForegroundProperty, c.Foreground));
    if (c.FontWeight != null) gc.CellStyle.Setters.Add(new Setter(GridViewCell.FontWeightProperty, c.FontWeight));
    gc.TextWrapping = c.FontWrapping ? TextWrapping.Wrap : TextWrapping.NoWrap;
    if (gc.UniqueName.EndsWith("DATE")) gc.DataFormatString = "{0: MM/dd/yyyy}";



  13. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 06 Jul 2012 Link to this post

    Hello Zack,

     

    Generally the cells will be blank if the corresponding GridViewCellStyle is not found. Will you verify that the corresponding ResourceDictionary Telerik.Windows.Controls.GridView.xaml is correctly found?
    You may always submit a new support ticket and attach small repro application which can help us to understand what went wrong.   



    Kind regards,
    Vanya Pavlova
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  14. Zack
    Zack avatar
    112 posts
    Member since:
    Jun 2012

    Posted 06 Jul 2012 Link to this post

    I did recreate the issue in a project and submitted a support ticket 562669 for it, thanks.
Back to Top
UI for WPF is Visual Studio 2017 Ready