View Buttons Style

10 posts, 0 answers
  1. John
    John avatar
    6 posts
    Member since:
    Nov 2013

    Posted 27 Nov 2013 Link to this post

    hello, how i can change style of navigation view button after adding 
                    <telerik:DayViewDefinition />
                    <telerik:WeekViewDefinition />
                    <telerik:MonthViewDefinition />   ?
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 02 Dec 2013 Link to this post

    Hi John,

    You can change the desired Button icon by modifying the ControlTemplate with x:Key CalendarIcon. Using Implicit Styles you can that easily by extracting the default ScheduleView ControlTemplate and the Styles with Key NavigationDateTimePickerStyle and NavigationCalendarToggleButton. Please check the attached sample project which demonstrates the exact approach.

    Hope this helps.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. John
    John avatar
    6 posts
    Member since:
    Nov 2013

    Posted 06 Dec 2013 Link to this post

    Kalin, thanks. You really helped me )
    And now to insert icons for buttons of ViewDefinitions (day/week/month) i need redefine ViewModeButtonStyle?
  5. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 11 Dec 2013 Link to this post

    Hello John,

    In order to include icons for the ViewDeifinition buttons you will need to add an ItemTemplateSelector to the ListBox which holds the buttons. Afterwards you would only need to change change the image icon depending on the type of the button. I have modified the sample project in order to include the icons from the Windows8Touch theme.

    Hope this helps.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. John
    John avatar
    6 posts
    Member since:
    Nov 2013

    Posted 11 Dec 2013 Link to this post

    Kalin, in my assembly the type 'telerik:ViewModeContentTemplateSelector' was not found. :-(  My dll's are very old? ( version 2012.2.912.35 
  7. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 14 Dec 2013 Link to this post

    Hello John,

    The telerik:ViewModeContentTemplateSelector is not present in the mentioned version of the controls. But you could easily implement a custom TemplateSelector and replace our with it, the TemplateSelector class should look like this:
    public class ViewModeContentTemplateSelector : DataTemplateSelector
    {
        public DataTemplate DayViewModeButtonContentTemplate { get; set; }
             
        public DataTemplate WeekViewModeButtonContentTemplate { get; set; }
     
        public DataTemplate MonthViewModeButtonContentTemplate { get; set; }
     
        public DataTemplate TimelineViewModeButtonContentTemplate { get; set; }
             
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is WeekViewDefinition)
            {
                return this.WeekViewModeButtonContentTemplate;
            }
            else if (item is DayViewDefinition)
            {
                return this.DayViewModeButtonContentTemplate;
            }
            else if (item is MonthViewDefinition)
            {
                return this.MonthViewModeButtonContentTemplate;
            }
            else if (item is TimelineViewDefinition)
            {
                return this.TimelineViewModeButtonContentTemplate;
            }
     
            return base.SelectTemplate(item, container);
        }
    }

    Please give it a try and let me know if it works for you. However you may also need to replace the ControlTemplates in my project with the ControlTemplates from your version of the controls as there may be differences which can break the project.

    Hope this helps.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. John
    John avatar
    6 posts
    Member since:
    Nov 2013

    Posted 16 Dec 2013 Link to this post

    Yes, Kalin. It works. Thank you very much for your help!
  9. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 16 Dec 2013 Link to this post

    Hello John,

    You are welcome, I'm glad you have managed to achieve the desired appearance.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  10. John
    John avatar
    6 posts
    Member since:
    Nov 2013

    Posted 18 Dec 2013 Link to this post

    Hi, Kalin! I have a new problem ((
    Day, Month and TimeLine buttons  works well! But when i click WeekMode - appears DayMode presentation.
    Perhaps, problem in DefinitionIndex? I change only icons in your attach project.
  11. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 19 Dec 2013 Link to this post

    Hi John,

    The issue is probably caused by differences in the default templates present in your version of the controls and those I have used in my project (from the latest version). What I can suggest you is to replace the ScheduleView ControlTemplate in the project with the Template from the used version. You can find the template in the Themes.Implicit folder which is located in the installation folder of the controls, go into the folder of the desired theme, navigate to the Telerik.Windows.Controls.ScheduleView.xaml file and search for the RadScheduleViewControlTemplate. Afterwards you will need to set the CustomViewModeSelectionListBoxStyle as a Style of the ListBox named ViewModeSelection.

    Hope this helps.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WPF is Visual Studio 2017 Ready