Table of Contents
  • Getting Started
  • EO.Pdf
  • EO.Web
  • EO.WebBrowser
  • EO.Wpf
  • Common Topics
  • Reference
    • .NET API Reference
      • EO.Base
      • EO.Base.UI
      • EO.Extensions
      • EO.Pdf
      • EO.Pdf.Acm
      • EO.Pdf.Contents
      • EO.Pdf.Drawing
      • EO.Pdf.Mvc
      • EO.Web
      • EO.WebBrowser
      • EO.WebBrowser.DOM
      • EO.WebEngine
      • EO.WinForm
      • EO.Wpf
        • EO.Wpf
        • Classes
          • BareButton Class
          • Bitmap Class
          • BitmapButton Class
          • BooleanDependencyPropertyRoutedEventArgs Class
          • Button Class
          • Calendar Class
          • CalendarDayButton Class
          • CalendarMonth Class
          • CancelEventArgs Class
          • CheckBox Class
          • ChoiceMaskedEditSegment Class
          • ComboBox Class
          • ComboBoxItem Class
          • DatePicker Class
          • DateRangeCollection Class
          • DateRangeCollectionConverter Class
          • DockContainer Class
          • DockItem Class
          • DockItemClosingEventArgs Class
          • DockItemCollection Class
          • DockItemEventArgs Class
          • DockItemNeededEventArgs Class
          • DockView Class
          • DockViewCollection Class
          • DockViewCommands Class
          • DockViewEventArgs Class
          • DockViewNeededEventArgs Class
          • DocumentItem Class
          • DropDown Class
          • DropDownButton Class
          • DropDownService Class
          • EditItemEventArgs Class
          • Effect Class
          • EffectManager Class
          • Expander Class
          • ItemDragEventArgs Class
          • ItemDragOverEventArgs Class
          • ItemDropEventArgs Class
          • ItemsControlHelper Class
          • LinkButton Class
          • ListBox Class
          • ListBoxItem Class
          • MaskedEdit Class
          • MaskedEditSegment Class
          • MaskMaskedEditSegment Class
          • Menu Class
          • MenuBase Class
          • MenuItem Class
          • MonthPicker Class
          • MultiplyConverter Class
          • NamedResourceKey Class
          • NegationConverter Class
          • NewItemRequestedEventArgs Class
          • NumericMaskedEditSegment Class
          • OpacityConverter Class
          • PatternMaskedEditSegment Class
          • PdfViewer Class
          • ProgressBar Class
          • RadialPanel Class
          • RadioButton Class
          • RangeSlider Class
          • RegexMaskedEditSegment Class
          • RingDefinition Class
          • RingDefinitionCollection Class
          • Runtime Class
          • SkinStyleInfo Class
          • Slider Class
          • SliderBase Class
          • SpinEdit Class
          • SplitButton Class
          • SplitLineHeightConverter Class
          • SplitView Class
          • StaticMaskedEditSegment Class
          • TabControl Class
          • TabItem Class
          • TabItemCloseEventArgs Class
          • TabItemEventArgs Class
          • TemplatePresenter Class
          • ThemeManager Class
          • ThemeNames Class
          • ThemeStyleInfo Class
          • TreeView Class
          • TreeViewItem Class
          • UIElementHelper Class
          • UnitConverter Class
          • WebControl Class
          • WebView Class
          • WebViewHost Class
          • WeekDaysCollection Class
          • WindowChrome Class
          • WindowCommands Class
          • YearPicker Class
        • Structures
        • Enumerations
        • Delegates
      • EO.Wpf.Gauge
      • EO.Wpf.Gauge.Shapes
      • EO.Wpf.Primitives
      • EO.Wpf.Themes.Aero
      • EO.Wpf.Themes.Classic
      • EO.Wpf.Themes.Luna
      • EO.Wpf.Themes.Metro
      • EO.Wpf.Themes.Royale
    • JavaScript API Reference
ItemBorderStyle Property

Gets or sets the styles to be applied to the outside Border element around a TreeViewItem's text area.

Syntax
 public Style ItemBorderStyle { get; set; }
Remarks

This property is typically used to customize the style of an TreeViewItem when the item is selected. The following XAML is the default ItemBorderStyle:

XML
<Style TargetType="Border">
    <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type my:TreeViewItem}}, Path=Background}"></Setter>
    <Setter Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type my:TreeViewItem}}, Path=BorderBrush}"></Setter>
    <Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type my:TreeViewItem}}, Path=BorderThickness}"></Setter>
    <Setter Property="Padding" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type my:TreeViewItem}}, Path=Padding}"></Setter>
    <Style.Triggers>
        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type my:TreeViewItem}}, Path=IsSelected}" Value="True">
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
            <Setter Property="TextBlock.Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
        </DataTrigger>
        <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type my:TreeViewItem}}, Path=IsSelected}" Value="True"></Condition>
                <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type my:TreeViewItem}}, Path=IsSelectionActive}" Value="False"></Condition>
            </MultiDataTrigger.Conditions>
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
            <Setter Property="TextBlock.Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        </MultiDataTrigger>
    </Style.Triggers>
</Style>

The above style applies different background and foreground color based on the values of the TreeViewItem's IsSelected and IsSelectionActive property.

See Also