Thanks for the answers guys! I solved it with the following:
private void Panorama_OnSelectionChanged(object sender, SelectionChangedEventArgs e) {
this.UpdateHitTestForPanoItems(this.Panorama.SelectedItem);
}
private void Panorama_OnLoaded(object sender, RoutedEventArgs e) {
this.UpdateHitTestForPanoItems(this.Panorama.SelectedItem ?? this.Panorama.Items.FirstOrDefault());
}
private void UpdateHitTestForPanoItems(object selectedItem) {
foreach (PanoramaItem item in this.Panorama.Items) {
item.IsHitTestVisible = item == this.Panorama.SelectedItem;
}
}
Of course, you'll need to actually hook up the Loaded
and SelectionChanged
events to the Panorama_OnLoaded
and Panorama_OnSelectionChanged
methods, respectively. I could also see moving this to a Behavior
, which you could use on other Panoramas in your app.