Reputation: 1180
I'm making a simple note taking app in C# for windows phone 7.8. And I would like to know how to retrieve properties of the item clicked on through the context menu...
Here's the code for the HubTile
<toolkit:HubTile Title="{Binding Title}" Message="{Binding Details}" HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalContentAlignment="Left" VerticalContentAlignment="Bottom" Tap="HubTile_Tap" toolkit:TiltEffect.IsTiltEnabled="True" Hold="HubTile_Hold">
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu>
<toolkit:MenuItem Header="Open" Click="hubTileOpen_Click"/>
<toolkit:MenuItem Header="Edit" Click="hubTileEdit_Click"/>
<toolkit:MenuItem Header="Delete" Click="hubTileDelete_Click"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</toolkit:HubTile>
So basically I want to be able to retrieve the Message and Title property of the HubTile though one of the context menu events.
Thanks, all help appreciated
Upvotes: 0
Views: 235
Reputation: 8440
Inside click event:
(((sender as MenuItem).Parent as ContextMenu).Owner as HubTile).Title
Upvotes: 1