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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:20:00+00:00 2026-05-25T19:20:00+00:00

My friends, i Have a problem in WPF which i just cannot solve. I

  • 0

My friends,

i Have a problem in WPF which i just cannot solve. I have two Windows, Mainwindow and Window1. I’d like to bind a ListView in my child-window to a controls property in the parent-window. In detail:

Mainwindow has a control declared in XAML,

<local:MyControl x:Name="View"/>

Further down i have a Listview which get’s fed by a public property of ‘View’, ‘Session.Events’ (Observable Collection)

<ListView ItemsSource="{Binding ElementName=View, Path=Session.Events}"/>

Which works fine, but now i have a second Window spawned from Mainwindow in such manner:

Window1 MyWin1 = new Window1();
MyWin1.Owner = this;
MyWin1.ShowDialog();

And this second window has a ListView which also needs to be fed by my ‘View’ control. I’d like to do it via binding but i bite my teeth out. It does not work, whatever i try. I do have a working version via code-behind …

Window1 Parent = (Window1)this.Owner;
MyListView.ItemsSource = Parent.CCView.Session.Events;

But i would prefer doing the bind in XAML and save the extra-code. Also i hope it will help me to understand bindings better, which for me are still a mystery to some extend.

Thank you so much and my best regards,
Paul

  • 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-25T19:20:00+00:00Added an answer on May 25, 2026 at 7:20 pm

    You can bind across the logical tree of your XAML. The second window is not part of the first window’s tree. I’d think the most simple way in your situation should be to pass over the DataContext to your child window:

    MyWin1 = new Window1 {
      DataContext = this.DataContext,
      Owner = this 
    };
    MyWin1.ShowDialog();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Friends, I have a strange need and cannot think my way through the problem.
I have two professional programmer friends who are going to teach me, and they
I have a many-to-many relationship between two tables, let's say Friends and Foods. If
Greetings friends, In my MySQL database, I have 'MAB' table which contains information about
friends i have problem with using get or set in class in c# when
Hallo,friends we have the following problem syms t u0 u1 u0=sin(t); R1= diff(u0,'t',2)+u0-u0^3; u1=dsolve('D2u1+u1=R1','t')
I have a problem selecting 6 random friends This is the query I've got
Hey friends I have one problem related to SQL Server 2008 R2. I set
I have a table called user_relationship. which has two foreign keys refering back to
Hi friends hope all r doing well. I have a problem while reading xml

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.