Generateing default style/template

4 posts, 0 answers
  1. Big G
    Big G avatar
    19 posts
    Member since:
    Jan 2013

    Posted 25 Jan 2013 Link to this post

    I am having trouble modifying the default style for the pickerbox. Just as the help file says, and as I do with all controls, in expression blend I right click the control, select Edit Template and then Edit a copy. I name the template and it generates the following

    Any ideas?
    <ControlTemplate x:key="MyRadPickerStyle" TargetType="telerikPrimitives:RadPickerBox"/>
  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 28 Jan 2013 Link to this post

    Hi Gareth,

    Thank you for contacting us.

    We are aware of this. It seems that for some reason Blend is not able to extract the styles when they are in merged dictionaries. The solution for now is to send you the default style for the picker box. Here it is:
    <Style TargetType="telerikPrimitives:RadPickerBox" x:Key="BasePickerBoxStyle">
        <Setter Property="PopupOpenAnimation">
            <Setter.Value>
                <telerikCore:RadPlaneProjectionAnimation FillBehavior="Stop">
                    <telerikCore:RadPlaneProjectionAnimation.Easing>
                        <CubicEase EasingMode="EaseInOut"/>
                    </telerikCore:RadPlaneProjectionAnimation.Easing>
                </telerikCore:RadPlaneProjectionAnimation>
            </Setter.Value>
        </Setter>
        <Setter Property="PopupHorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="PopupVerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikPrimitives:RadPickerBox">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <ContentControl Grid.Row="0"
                                        Content="{TemplateBinding Header}"
                                        ContentTemplate="{TemplateBinding HeaderTemplate}"
                                        Style="{TemplateBinding HeaderStyle}"/>
                        <telerikPickerBox:PickerBoxToggleButton x:Name="PART_ActionButton" Grid.Row="1"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                    IsChecked="{Binding Path=IsPopupOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                    telerikCore:InteractionEffectManager.IsInteractionEnabled="True"/>
     
                        <telerikPrimitives:RadWindow x:Name="PART_Popup"
                                                    Content="{TemplateBinding PopupContent}"
                                                    ContentTemplate="{TemplateBinding PopupContentTemplate}"
                                                    HorizontalContentAlignment="{TemplateBinding PopupHorizontalContentAlignment}"
                                                    VerticalContentAlignment="{TemplateBinding PopupVerticalContentAlignment}"
                                                    HorizontalOffset="{TemplateBinding HorizontalPopupOffset}"
                                                    VerticalOffset="{TemplateBinding VerticalPopupOffset}"
                                                    Placement="{TemplateBinding PopupPlacement}"
                                                    PlacementTarget="{TemplateBinding PopupPlacementTarget}"
                                                    IsAnimationEnabled="{TemplateBinding IsPopupAnimationEnabled}"
                                                    OpenAnimation="{TemplateBinding PopupOpenAnimation}"
                                                    CloseAnimation="{TemplateBinding PopupCloseAnimation}"
                                                    IsOpen="{Binding Path=IsPopupOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                                    IsFullScreen="{TemplateBinding IsFullScreen}"
                                                    WindowSizeMode="{TemplateBinding PopupSizeMode}"
                                                    IsClosedOnBackButton="{TemplateBinding IsPopupClosedOnBackButton}"
                                                    ApplicationBarInfo="{TemplateBinding ApplicationBarInfo}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    You will also need the following mappings:
    xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"
    xmlns:telerikCore="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Core"
    xmlns:telerikPickerBox="clr-namespace:Telerik.Windows.Controls.PickerBox;assembly=Telerik.Windows.Controls.Primitives"

    Let me know if you need additional assistance.


    Kind regards,
    Todor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Big G
    Big G avatar
    19 posts
    Member since:
    Jan 2013

    Posted 29 Jan 2013 Link to this post

    Thats brilliant thank you.

    Could you also provide the same for the PART_ActionButton which is part of the style for the PickerBox?
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 29 Jan 2013 Link to this post

    Hello Gareth,

    Thanks for writing.
    Since you are a customer, you have access to the source code for RadControls for Windows Phone. If you download it, you will be able to browse all the code and XAML including the default styles and control template. You should be able to download it from your account on our website. The picker box style is in the Primitives assembly.
    Please write again if you need further assistance.

    All the best,
    Victor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top