32
I have a data template for my listbox and I must use project resources for all the labels. If I remove the reference to the resource and just type in the text for the labels there are no errors. If I try to use the resources I get the above error.
Here is the data template:
<DataTemplate x:Key="CheckBoxDatePickerItemTemplate">
<Border BorderThickness="1" CornerRadius="3" BorderBrush="{StaticResource GreenBorderBrush}">
<StackPanel Orientation="Horizontal" Background="#208897EB" MinWidth="370">
<CheckBox Focusable="False" IsChecked="{Binding IsChecked}" VerticalAlignment="Top"/>
<ContentPresenter Content="{Binding Name, Mode=OneTime}" Margin="2,2" Width="140" VerticalAlignment="Top"/>
<StackPanel Orientation="Vertical" Visibility="{Binding DateDataVisible}">
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding IncludeNullDates}" VerticalAlignment="Center" Focusable="False"/>
<Label Content="{x:Static resx:Resources.Label_IncludeEmptyDates}" Margin="2,2" Width="170" VerticalAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<ContentPresenter Content="{x:Static resx:Resources.Label_From}" Margin="2,0" Width="50" VerticalAlignment="Center"/>
<DatePicker SelectedDate="{Binding StartDate}" Margin="2,2" Width="150" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<ContentPresenter Content="{x:Static resx:Resources.Label_To}" Margin="2,0" Width="50" VerticalAlignment="Center"/>
<DatePicker SelectedDate="{Binding EndDate}" Margin="2,2" Width="150" />
</StackPanel>
</StackPanel>
</StackPanel>
</Border>