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

add a delete button only in small & normal view

1 Answer 15 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 11 Jan 2016, 10:54 AM

Hello;

 

I use telerik tile view in our project.

We have customized the template to add a "remove button" in the header by editing the tileview template. The delete button is available in the different views (small, normal & large). We have been requested to set the button only in small & normal view. So, how can we remove the "delete button" from the large view only.

 

Thanks for your replies.

Best regards

 

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 11 Jan 2016, 03:18 PM
Hi Sam,

I'm assuming that you are familiar with our documentation article where we described together with code samples how you might customize the TileViewItemHeader to add close button. Since this code will result in close button for every TileState -- Maximized, Restored or Normal you might easily control at which tile state it will appear in xaml. All you need to do is to make the CloseButton Visibility Collapsed when TileState is maximized. For example:

    ...
<VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="TileStates">
                                    <VisualState x:Name="Maximized">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="IsChecked" Storyboard.TargetName="MaximizeToggleButton">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>True</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CloseButton">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
...

Let me know how this works for you.
P.S. The full source code for the sample in this help article is available in a SDK sample - here.

Regards,
Evgenia
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TileView
Asked by
Sam
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or