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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:46:45+00:00 2026-05-23T21:46:45+00:00

My app looks like this: SectionHeader SectionHeader Content SectionHeader Content SectionHeader is a user

  • 0

My app looks like this:


SectionHeader

SectionHeader

Content

SectionHeader

Content


SectionHeader is a user control with two dependency properties = Title and Apps.

Title does not change but Apps needs to be bound to the main window view model Apps property. The Apps property is only required for two of the three section headers.

<c:SectionHeader DockPanel.Dock="Top" x:Name="SectionResources" Title="RESOURCES"
   Apps="{Binding Path=Apps}" />

This is how it is at the moment. The problem is that the Apps don’t show up.

In SectionHeader the DataContext is set to itself as follows which allows the Title to show up.

DataContext="{Binding RelativeSource={RelativeSource Self}}"

Apps is the ItemsSource for a ItemsControl in the UserControl:

<ItemsControl
      ItemsSource="{Binding Apps}">

So my questions are:

  • How can I data bind to a UserControl DP?
  • Is their an easier way of doing this layout without UserControls?

EDIT:

Forgot to mention that Apps is an ObservableCollection of AppsItems.

This is what my DP looks like:

public static readonly DependencyProperty AppsProperty = DependencyProperty.Register("Apps",
  typeof (ObservableCollection<AppsItem>), typeof (SectionHeader),
  new PropertyMetadata(null, OnAppsPropertyChanged));

private static void OnAppsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
  Console.WriteLine("Hello!!!");
  var sectionHeader = d as SectionHeader;
  var value = e.NewValue as ObservableCollection<AppsItem>;
  sectionHeader.Apps = value;
}
  • 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-23T21:46:46+00:00Added an answer on May 23, 2026 at 9:46 pm

    Give a name to your usecontrol and try binding like this

    ItemsSource="{Binding Apps,ElementName=root}"
    

    and root is the name give to your usercontrol

      <UserControl x:Class="WpfApplication1.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 Height="350" Width="525"
         x:Name="root">
    

    it is element binding to user control which has Apps property

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

Sidebar

Related Questions

My .app packages looks like this: MyApp.app/ Contents/ MacOS/ MyApp libA.dylib libB.dylib libC.dylib PlugIns/
I have a SQL query in my ASP.net web app that looks like this:
I have a Rack application that looks like this: class Foo def initialize(app) @app
The top of my web.xml file looks like this: <?xml version=1.0 encoding=UTF-8?> <web-app xmlns=http://java.sun.com/xml/ns/j2ee
This is an ASP.Net 2.0 web app. The Item template looks like this, for
I'm automating Visio 2003 from a VB.NET app. My code looks like this (with
I am using this middleware to make my app restful, but it looks like
I have a array inside my PHP app that looks like this: Array (
Say our folder structure looks like this: /app /app/data ... /app/secondary /app/secondary/data I want
My folder structure looks like this: /app /app/data ... /app/secondary /app/secondary/data I want to

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.