/// <summary> /// Gets the container for item override. /// </summary> /// <returns></returns> protected override DependencyObject GetContainerForItemOverride() { // as far as I know there is no way to change Container in .xaml var customListBoxItem = new SimpleThemingListBoxItem { Height = ItemHeight }; customListBoxItem.SetBinding( SimpleThemingListBoxItem.PointerOverItemBackgroundBrushProperty, new Binding { Source = this, Path = new PropertyPath("PointerOverItemBackground") }); customListBoxItem.SetBinding( SimpleThemingListBoxItem.PointerOverItemForegroundBrushProperty, new Binding { Source = this, Path = new PropertyPath("PointerOverItemForeground") }); return(customListBoxItem); }
/// <summary> /// Gets the container for item override. /// </summary> /// <returns></returns> protected override DependencyObject GetContainerForItemOverride() { // as far as I know there is no way to change Container in .xaml var customListBoxItem = new SimpleThemingListBoxItem { Height = ItemHeight }; customListBoxItem.SetBinding( SimpleThemingListBoxItem.PointerOverItemBackgroundBrushProperty, new Binding { Source = this, Path = new PropertyPath("PointerOverItemBackground") }); customListBoxItem.SetBinding( SimpleThemingListBoxItem.PointerOverItemForegroundBrushProperty, new Binding { Source = this, Path = new PropertyPath("PointerOverItemForeground") }); return customListBoxItem; }