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 7866503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:25:11+00:00 2026-06-03T00:25:11+00:00

I have a WPF application using MVVM pattern, where I have many ObservableCollections. Instead

  • 0

I have a WPF application using MVVM pattern, where I have many ObservableCollections. Instead of putting these ObservableCollections into each ViewModel, I placed them into a static class called Observables, which is a member of static class AppCommon. So I can access all observable collections through AppCommon.Observables.AnyObservableINeed.

Now I need to change bindings of UserControl’s so they bind to these global ObservableCollection’s but I don’t know how to refer to these ObservableCollections without changind the DataContext.

I tried adding namespace like

xmlns:globals="clr-namespace:Demirbaş.Globals"

and then in the ListBox setting the ItemsSource property like

<ListBox ItemsSource="{Binding Source={globals:Observables.TaşınırSınıfları}}"

but that would give me following error:

'{globals:Observables.TaşınırSınıfları}' value is not a valid MarkupExtension expression. Cannot resolve 'Observables.TaşınırSınıfları' in namespace 'clr-namespace:Demirbaş.Globals'. 'Observables.TaşınırSınıfları' must be a subclass of MarkupExtension. 

What is the problem here? Am I using the right XAML syntax to bind to these collections?

EDIT
ItemsSource="{Binding Source={x:Static globals:AppCommon.Observables.TaşınırSınıfları}}" gives me error :

Cannot find the type 'AppCommon.Observables'. Note that type names are case sensitive.

I think it cannot refer to nested classes, is it right? What’s the solution?

Thanks

  • 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-06-03T00:25:13+00:00Added an answer on June 3, 2026 at 12:25 am

    I don’t know the namespace of your application but try

    xmlns:local="clr-namespace:Demirbaş"
    
    <ListBox ItemsSource="{Binding 
        Source={x:Static local:AppCommon+Observables.TaşınırSınıfları}}" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the MVVM pattern creating WPF applications you have the ViewModel providing data to
I am coding a WPF application using MVVM pattern. I don't need to have
I have a WPF Microsoft Surface Application and I'm using MVVM-Pattern. I have some
I'm developing WPF applications using MVVM pattern. I have ViewModel with code like this:
I have a WPF Application using MVVM pattern. I have a Window in my
So I have a WPF application using the MVVM pattern (Caliburn.Micro). I got the
I am developing an application in WPF using the MVVM pattern. If I have
I have an application I am creating in WPF, using MVVM pattern. In this
I'm trying to implement a WPF application using MVVM (Model-View-ViewModel) pattern and I'd like
I'm using Caliburn and the MVVM pattern in a WPF application, and am trying

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.