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

Hide MaximizeToggleButton via VisualState

3 Answers 71 Views
TileView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Madhu
Top achievements
Rank 1
Madhu asked on 10 Nov 2011, 12:09 PM
Hi,

I would like to hide the maximizetogglebutton when the tile is in minimized state. For this purpose I am using Visual States. However this effect is not getting applied and I am still able to see this togglebutton (which I have customized to be a textblock) Can you please give me some pointers?

<VisualState x:Name="Minimized">
<ObjectAnimationUsingKeyFrames Duration="0"
 Storyboard.TargetName="MaximizeToggleButton"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>

Thanks,
Madhu

3 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 14 Nov 2011, 07:00 PM
Hello Madhu,

 At the moment there's no "Minimized" VisualState because there's no difference between the Minimized and the Restored states, so if you want to hide the button in a VisualState you'll hide the Maximize/Minimized button in both Minimized and Restored state.
Another way to hide the button is in code behind - you can handle the TileStateChanged event and hide the button in it.
For further references could you please examine the attached project and if you have more questions feel free to ask.

Greetings,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mike Shilkov
Top achievements
Rank 1
answered on 23 Feb 2012, 11:23 AM
Hello Zarko.

I want to use your way of hiding Maximize button from codebehind.
But I want to hide the button for some of tile items as soon as they are loaded, i.e. before TileStateChanged event is fired the first time.

I'm populating TileView from XAML with data binding:
<telerikNav:RadTileView ItemsSource="{Binding Entries}"...
so I don't have access to RadTileViewItem instances and I guess I can't use any of their events. Is it possible to make a TileView event handler which fires right after all items are created?

Thank you
0
Zarko
Telerik team
answered on 27 Feb 2012, 02:01 PM
Hi,
I think that the best solution for you case is to use StyleSelector for your RadTileView. This way you can select the custom buttonless style for the items you want and an empty style for the rest.
I've attached a sample project that shows how you can do this so could you please examine it and if need further assistance feel free to ask.

Kind regards,
Zarko
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
TileView
Asked by
Madhu
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Mike Shilkov
Top achievements
Rank 1
Share this question
or