Re-template control, loss radTickBar

2 posts, 1 answers
  1. Martin
    Martin avatar
    3 posts
    Member since:
    Jul 2013

    Posted 22 Jul 2013 Link to this post


    hi

    I used Blend 2012, when I retemplate the control (without doing anything to the generated style) i loss the top left radTickBar

    attached image of it working, not working and code (not working but remove style={} and it works)

    I am using 2012.3.1017.40

    thanks
    martin

         <telerik1:RadSlider Height="100"
       HandlesVisibility="Visible"
       TickPlacement="TopLeft"
       TickFrequency="1"
       IsSnapToTickEnabled="True"
       SelectionStart="0"  
       SelectionEnd="21"  
       MinimumRangeSpan="1"
       Minimum="0"
       SmallChange="1"
       LargeChange="1"
       Maximum="21"
       IsSelectionRangeEnabled="True" Style="{DynamicResource NotWorkingStyle}" >
       <telerik1:RadSlider.TickTemplate>
        <DataTemplate>
         <Grid>
          <TextBlock Text="{Binding}" FontSize="11"/>
         </Grid>
        </DataTemplate>
       </telerik1:RadSlider.TickTemplate>
      </telerik1:RadSlider>
  2. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 Jul 2013 Link to this post

    Hi Martin,

    Unfortunately Blend can't properly extract the ControlTemplate of the Slider and particularly it can't extract the default values of the ItemsSource proeprties of the two RadTickBars in teh ControlTemplate of the Slider.

    We've looked into this but at this point we haven't found a solution. However, you can easily fix your style by adding the ItemsSource of the two RadTickBar controls defined in the RadSlider Template:
    <!--  Set the ItemsSource property  -->
    <telerik:RadTickBar x:Name="TopTickBar"
            Grid.Column="1"
            Grid.ColumnSpan="3"
            IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
            ItemTemplate="{TemplateBinding TickTemplate}"
            ItemTemplateSelector="{TemplateBinding TickTemplateSelector}"
            ItemsSource="{TemplateBinding ResultTicks}"
            Maximum="{TemplateBinding Maximum}"
            Minimum="{TemplateBinding Minimum}"
            RenderTransformOrigin="0.5,0.5"
            Style="{TemplateBinding TickBarStyle}">
       ...
    </telerik:RadTickBar>
    ...
    <!--  If you want to display ticks at the bottom of the slider, you need to set the ItemsSource of this RadTickBar as well  -->
    <telerik:RadTickBar x:Name="BottomTickBar"
        Grid.Row="2"
        Grid.Column="1"
        Grid.ColumnSpan="3"
        IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
        ItemTemplate="{TemplateBinding TickTemplate}"
        ItemTemplateSelector="{TemplateBinding TickTemplateSelector}"
        ItemsSource="{TemplateBinding ResultTicks}"
        Maximum="{TemplateBinding Maximum}"
        Minimum="{TemplateBinding Minimum}"
        RenderTransformOrigin="0.5,0.5"
        Style="{TemplateBinding TickBarStyle}">
           ...
    </telerik:RadTickBar>

    For your convenience I also attached a sample solution where you can find the proper Template of the control.

    Regards,
    Tina Stancheva
    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
Back to Top