Hello,
I like to use the Tile Manager without the headers, with this Forum help i found out how. But now the question,how can I miximize a current Tile via Code. I can only found a reference of a tile if I have a Item, but when i click of a button inside the Tile i found now "actualTile" or "currentNode" or whatever.
For example: this work for the fix first Item, but I search the current...
private void _tm_MouseDoubleClick(object sender, MouseButtonEventArgs e) { XamTile tileToMaximize = this._tm.TileFromItem(this._tm.Items[0]); tileToMaximize.IsMaximized = true;
}
Thanks for help, and greetings from germany
Thomas
OK, now it works fine.
thanks for your quickly support
Greetings from germany
thomas
Since you use ItemsSource I can suggest you change the Button’s Click event handler like this:
(((sender as Button).TemplatedParent as ContentPresenter).TemplatedParent as XamTile).IsMaximized = true;
Please let me know if this helps you or you need further assistance on this matter.
Hello Stefan,
thanks for you support, i think i have as beginner some easy wpf problems :(But in my application i use datatemplates and then the parent of the Button is Null.
Hmmmm, can you help a beginner....
Here a little example where the parent is null, i hope you understand.
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" xmlns:ig="http://schemas.infragistics.com/xaml"> <Window.Resources> <DataTemplate x:Key="LargeTileView"> <Button Name="myTestButton" Content="{Binding Source}" Click="Button_Click"/> </DataTemplate> </Window.Resources> <Grid> <ig:XamTileManager Name="xamTileManager1" ItemTemplate="{StaticResource LargeTileView}" ItemsSource="{x:Static Fonts.SystemFontFamilies}"> </ig:XamTileManager> </Grid></Window>
---- code behind
private void Button_Click(object sender, RoutedEventArgs e) { ((sender as Button).Parent as XamTile).IsMaximized = true; }
Hello Thomas,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I handled the Click event of the Button I put inside the XamTile and set its Parent’s (which is the XamTile) IsMaximized Property to True. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.