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

  • Home
  • SEARCH
  • 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 571059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:28:02+00:00 2026-05-13T13:28:02+00:00

I’ve been trying to solve this problem for over an hour now, and can’t

  • 0

I’ve been trying to solve this problem for over an hour now, and can’t figure it out. Hopefully someone can see what I’m doing wrong.

I have two separate projects, both of which populate a combobox with an array of Doubles in the UserControl.Resources section, then databind to it in the GUI. What I’m doing is essentially just this, which works fine in kaxaml and in one of my two projects.

<Page>
  <Page.Resources>
    <x:Array x:Key="Increments" Type="sys:Double">
      <sys:Double>0.01</sys:Double>
      <sys:Double>0.02</sys:Double>
      <sys:Double>0.03</sys:Double>
      <sys:Double>0.04</sys:Double>
    </x:Array>
  </Page.Resources>

  <Grid>  
    <ComboBox ItemsSource="{StaticResource Increments}" />
  </Grid>
</Page>

The other project gives me the following error:

Cannot convert the value in attribute
‘ItemsSource’ to object of type
‘System.Collections.IEnumerable’.
‘System.Windows.Markup.ArrayExtension’
is not a valid value for property
‘ItemsSource’. Error at object
‘System.Windows.Controls.ComboBox’ in
markup file …

I cannot figure out why this is happening. I’ve tried looking at the schemas referenced in both XAML files, but they are the same… I don’t have any errors or messages in the Output window. I got desperate and ran it through FxCop to see if it would catch something related, and although it has caught several valid errors, none of them were related.

  • 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-13T13:28:03+00:00Added an answer on May 13, 2026 at 1:28 pm

    I had to wrap this in an ObjectDataProvider to get it to work, and replace the StaticResource with a binding to the StaticResource:

    <!-- Resources -->
    <ObjectDataProvider x:Key="Incs2">
      <ObjectDataProvider.ObjectInstance>
        <x:Array Type="sys:Double">
          <sys:Double>0.01</sys:Double>
          <sys:Double>0.02</sys:Double>
          <sys:Double>0.03</sys:Double>
          <sys:Double>0.04</sys:Double>
        </x:Array>
      </ObjectDataProvider.ObjectInstance>
    </ObjectDataProvider>
    
    <!-- Page content -->
    <ComboBox ItemsSource="{Binding Source={StaticResource Incs2}}" />
    

    EDIT: I’ve also found that if I move the x:Array resource to the top of my Resources section, before any other resource declaration, I can use your original ItemsSource="{StaticResource ...}" and I no longer get the exception (or need the ObjectDataProvider). This would seem to be a bug in WPF.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm looking for suggestions for debugging... If you view this site in Firefox or
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6

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.