Created
October 4, 2011 17:46
-
-
Save clausjoergensen/1262289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListBox ItemsSource="{Binding Tiles}" SelectionChanged="ListBox_SelectionChanged"> | |
<ListBox.ItemsPanel> | |
<ItemsPanelTemplate> | |
<toolkit:WrapPanel Orientation="Horizontal" /> | |
</ItemsPanelTemplate> | |
</ListBox.ItemsPanel> | |
<ListBox.ItemTemplate> | |
<DataTemplate> | |
<toolkit:HubTile Title="{Binding Author}" | |
Margin="3" | |
Message="{Binding Name}" | |
Notification="{Binding Rating}" /> | |
</DataTemplate> | |
</ListBox.ItemTemplate> | |
</ListBox> | |
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | |
{ | |
var listbox = sender as ListBox; | |
if (listbox.SelectedIndex != -1) | |
{ | |
var tile = listbox.SelectedItem as Tile; | |
System.Diagnostics.Debug.WriteLine(tile.Author); | |
listbox.SelectedIndex = -1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment