How to use a custom item template containing a Path tag in a ComboBox (excluding out of range exception)
I have a field with the following DataTemplate:
<DataTemplate x:Key="ComboBoxDataTemplate">
<StackPanel>
<TextBlock Text="{Binding Path='Name'}"/>
<Path Data="{Binding Path='PathGeometry'}" Width="64" Height="64" Stroke="Black" Stretch="Fill" StrokeThickness="1"/>
</StackPanel>
</DataTemplate>
PathGeometry is something as simple as 0,1 0,0.5 0.5,0 0,1
(simple curve). When I select an item in my combo box, the entire silverlight app goes white. An exception is thrown "Value out of range" which I handle, but then it turns white after that.
Why is the exception thrown? If I remove the {Binding} from the Path tag and define my own, it works fine. For some reason, this is just data binding.
0
source to share