Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5988191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:55:27+00:00 2026-05-22T22:55:27+00:00

I have a data template for my listbox and I must use project resources

  • 0

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>
</DataTemplate>

One thing to note we are using the resources in other XAML files with no problems. This file however is a resource dictionary and is added to the app.xaml resources. What’s with this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:55:28+00:00Added an answer on May 22, 2026 at 10:55 pm

    We are working on this project in a team and I just copied the line for using resources… I just forgot to copy the xmlns attribute as well. What I find strange is that the error isn’t really descriptive and doesn’t give any real hints as to what the problem is.

    Moral of the story: if copying lines of code make sure that all references to namespaces are also copied.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Data Template applied to a ListBox: <DataTemplate x:Key=MyTemplate DataType={x:Type DAL:Person}>
I have a data template that I use in many pages, the data template
I have a data template formatting items in a ListBox <DataTemplate x:Key=ChildViewModelTemplate> <Border BorderBrush=#FFDC1C1C
I have DataTemplate containing a TextBox . I'm setting this template to a listbox
I have a ComboBox in WPF which is databound, and has data template which
I bind observable collection on listBox. I have data tempate on listbox item. It
I have a ListBox data bound to the collection of my PersonCollection class. Next,
I have a ListBox which contains all the Categories and each category will contain
I have a listbox, and I have the following ItemTemplate for it: <DataTemplate x:Key=ScenarioItemTemplate>
I have a databound and itemtemplated ListBox: <ListBox x:Name=lbLista ScrollViewer.VerticalScrollBarVisibility=Visible> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation=Horizontal>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.