Hide Expander ToggleButton if no child items in WPF
问题 I am using an expander control inside the Listbox to show a Hierarchical list of items and i am getting the visibility correctly. Here is the code i used in xaml to bind the data <Window.Resources> <ControlTemplate x:Key="WithoutToggleButton" TargetType="{x:Type Expander}"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="True"> <ToggleButton x:Name=