-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Bug explanation
why my app show bind error ?
this is Error description:
bindPath: ExpandDirection
target: RotateTransform.Angle
description: Unable to find resources: RelativeSource FindAncestor, AncestorType='System.Windows.Controls.Expander', AncestorLevel='1'
this is my code :
<ListBox.ItemTemplate>
<materialDesign:PackIcon
Width="24"
Height="24"
Margin="0,0,5,0"
Foreground="White"
Kind="{Binding Icon}" />
<Expander.Header>
<StackPanel x:Name="ExpandHeader" Orientation="Horizontal">
<materialDesign:PackIcon
Width="24"
Height="24"
Margin="0,0,5,0"
Foreground="White"
Kind="{Binding Icon}" />
<TextBlock
Margin="10,0,10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
FontWeight="Bold"
Foreground="White"
Text="{Binding Header}" />
</StackPanel>
</Expander.Header>
<ListView
x:Name="ListViewMenu"
Foreground="White"
ItemsSource="{Binding SubItems}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionChanged="ListViewMenu_SelectionChanged">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel
x:Name="subItemPanel"
Margin="18,0,0,0"
Orientation="Horizontal">
<materialDesign:PackIcon
Width="20"
Height="20"
Margin="0,0,10,0"
VerticalAlignment="Center"
Foreground="White"
Kind="{Binding Icon}" />
<TextBlock
Padding="5"
VerticalAlignment="Center"
FontSize="14"
Text="{Binding Header}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Expander>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
Version
5.2.1