This is a migrated thread and some comments may be shown as answers.

View Buttons Style

9 Answers 157 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 27 Nov 2013, 01:19 PM
hello, how i can change style of navigation view button after adding 
                <telerik:DayViewDefinition />
                <telerik:WeekViewDefinition />
                <telerik:MonthViewDefinition />   ?

9 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 02 Dec 2013, 08:58 AM
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 >>
0
John
Top achievements
Rank 1
answered on 06 Dec 2013, 11:25 AM
Kalin, thanks. You really helped me )
And now to insert icons for buttons of ViewDefinitions (day/week/month) i need redefine ViewModeButtonStyle?
0
Kalin
Telerik team
answered on 11 Dec 2013, 11:16 AM
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 >>
0
John
Top achievements
Rank 1
answered on 11 Dec 2013, 11:35 AM
Kalin, in my assembly the type 'telerik:ViewModeContentTemplateSelector' was not found. :-(  My dll's are very old? ( version 2012.2.912.35 
0
Kalin
Telerik team
answered on 14 Dec 2013, 08:37 AM
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 >>
0
John
Top achievements
Rank 1
answered on 16 Dec 2013, 11:43 AM
Yes, Kalin. It works. Thank you very much for your help!
0
Kalin
Telerik team
answered on 16 Dec 2013, 12:10 PM
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 >>
0
John
Top achievements
Rank 1
answered on 18 Dec 2013, 07:23 AM
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.
0
Kalin
Telerik team
answered on 19 Dec 2013, 01:04 PM
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 >>
Tags
ScheduleView
Asked by
John
Top achievements
Rank 1
Answers by
Kalin
Telerik team
John
Top achievements
Rank 1
Share this question
or