0

I am using the MahApps Panorama Control in my project by linking the Mahapps.Metro.dll so I can't change the XAML-Code of the Panorama Control directly. I thought it would be possible to override values in my MainWindow.xaml but when I do so nothing changes or maybe I change the wrong property.

The problem with the Panorama Control is that the selected item has a white border and I can't find a way to remove this selection style. I tried several solutions like changing the style or changing the control template (How to disable highlighting on listbox but keep selection?) but my changes have no influence of the Panorama Control.

There you can see the Panorama Control XAML.

ucMedia
  • 4,105
  • 4
  • 38
  • 46
seveves
  • 1,282
  • 4
  • 17
  • 37

1 Answers1

0

This is an issue with the way that the Styles are inherited, and it's tricky to see how the ListViewItems and ListBoxItems work together. I fixed this by inserting the following in the code behind. It does, however, lose your selected item:

var listbox = MyPanorama.FindChildByType<ListBox>();
if (listbox != null)
{
    listbox.SelectedIndex = -1;
}

FindChildByType is a simple search to return the first ListBox that is found under the Panorama. If you have a search by name the x:Name of the template listbox is "items".

Remoraz
  • 13
  • 1
  • 3