FixedTickProvider DependencyProperty question

2 posts, 0 answers
  1. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 07 Apr 2014 Link to this post

    Hi,

    I have a UserControl which contain a RadScheduleView with a WeekViewDefinition. In my control, I would like to have a DependencyProperty to set the number of minutes (int) for the MinorTickLength. I would like to know how I can acheive this.

    Thank's
    Alain
  2. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 09 Apr 2014 Link to this post

    Hello Alain,

    In order to achieve the desired you would need to expose a DependencyProperty of type int in your UserControl code behind. Afterwards in the PropertyChanged method you will be able to set the MinorTickLength property of the WeekViewDefinition the following way:

    if (e.NewValue != e.OldValue)
    {
        var viewDefinition = ((ScheduleViewUserControl)d).ScheduleView.ActiveViewDefinition as WeekViewDefinition;
        viewDefinition.MinorTickLength = new FixedTickProvider(new DateTimeInterval((int)e.NewValue, 0, 0, 0, 0));
    }

    Hope this helps.

    Regards,
    Kalin
    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top