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

TileView as button

1 Answer 132 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Elgan
Top achievements
Rank 1
Elgan asked on 18 Nov 2012, 08:47 PM
I have a template for a tileview content which is application wide.  so not using direct event.


I have this;

<telerik:RadFluidContentControl.Content  >
                 <Border>
                     <Grid Margin="10 10">
                         <StackPanel>
                             <TextBlock Margin="0 0 0 5"
                                    FontFamily="Segoe UI"
                                    FontSize="24"
                                    FontWeight="Light"
                                    Text="Last Appointment" />
                             <TextBlock FontSize="14"
                                    Text="{Binding LastDate}" />
                             <Border Height="2"
                                 Margin="0 5"  />
                             <TextBlock Margin="0 0 0 5"
                                    FontFamily="Segoe UI"
                                    FontSize="24"
                                    FontWeight="Light"
                                    Text="Next Due" />
                             <TextBlock FontSize="14"
                                    Text="{Binding NextDate}" />
                         </StackPanel>
                         <Button Tag="{Binding ListID}"
                                 Command="{Binding Path=TileClicked}"
                                 Opacity="0"
                                  
                                 CommandTarget="{Binding TileClicked, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ElgEquineManager:HorsesPage}}}"></Button>
                     </Grid>
                 </Border>
             </telerik:RadFluidContentControl.Content>

I am trying to add a button to the tileview to cover the whole tile, so it can be clicked and made selected , and not just clicking on the header. make sense?

I had an Click="" event before, but now I want this as a app wide template, any ideas?

1 Answer, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 21 Nov 2012, 01:27 PM
Hi Elgan,

I am not sure that I fully understand what exactly you want to accomplish. Do you want to select the tile item by clicking on it or you want to move from one state to another for example from minimized to maximized? I will be pleased if you could provide us with more details if possible.

However, to select a tile you could use the IsSelectionEnabled property of RadTileView. That will allow you to select the tile by pressing anywhere in it.
<telerik:RadTileView IsSelectionEnabled="True">

 If you want to change states (for example from minimized to maximized) we have a command that allows you to do that. Below is a code snippet with Button covering the whole TileViewItem which changes the state when clicked:
<telerik:RadFluidContentControl.SmallContent>
    <telerik:RadButton Content="Button" Command="tileView:TileViewCommands.ToggleTileState" />
</telerik:RadFluidContentControl.SmallContent>

You are going to need following namespace in order to use the toggle state command:
xmlns:tileView="clr-namespace:Telerik.Windows.Controls.TileView;assembly=Telerik.Windows.Controls.Navigation"

If there is any more questions don't hesitate to contact us.

Greetings,
Kiril Vandov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TileView
Asked by
Elgan
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Share this question
or