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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:30:49+00:00 2026-06-11T17:30:49+00:00

I have an Observablecollection with type of EntityBase. EntityBase is a base class for

  • 0

I have an Observablecollection with type of EntityBase. EntityBase is a base class for Ticket,Project,… classes. Now I want to bind that collection to treeview but when debugging there is no data showing. Also there is no binding error at output debug window.

There is the codes:

public partial class ReminderExtendedWindow : Window , INotifyPropertyChanged
    {
        private ObservableCollection<EntityBase> coll;
        public ObservableCollection<EntityBase> Coll  
        { 
            get
            { if (coll == null) coll = new ObservableCollection<EntityBase>(); return coll; }
            set { coll = value; NotifiyPropertyChanged("Coll"); }
        }

        public ReminderExtendedWindow()
        {
            InitializeComponent();
            this.ResizeMode = ResizeMode.NoResize;
            Ticket ticket = new Ticket();
            ticket.TicketId = 3535;
            ticket.TicketUrl = "http://www.google.com";
            ticket.TicketRequestTypeName = "denemeticket";
            Project project = new Project();
            project.ProjectUrl = "http://www.google.com";
            project.ProjectId = 1221;
            project.ProjectTypeName = "denemeproj";
            Coll.Add(ticket);
            Coll.Add(project);

        }
}

The XAML file codes:

<TreeView Height="500" Width="375" Background="Transparent" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,50,0,0" 
               BorderThickness="0,0,0,0" x:Name="EntityTree" ItemsSource="{Binding Coll}">
            <TreeView.Resources>
                  <HierarchicalDataTemplate DataType="{x:Type BusinessLayerEntity:Ticket}" ItemsSource="{Binding}">
                    <TextBlock>
                <Hyperlink RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="{Binding TicketUrl}">
                    <TextBlock Text="{Binding TicketId}"></TextBlock>
                </Hyperlink>
                       <TextBlock Text="{Binding TicketRequestTypeName}"></TextBlock>
                  </TextBlock>
                </HierarchicalDataTemplate>
                <HierarchicalDataTemplate DataType="{x:Type BusinessLayerEntity:Project}" ItemsSource="{Binding}">
                    <TextBlock>
                <Hyperlink RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="{Binding ProjectUrl}">
                    <TextBlock Text="{Binding ProjectId}" ></TextBlock>
                </Hyperlink>
                        <TextBlock Text="{Binding ProjectTypeName}"></TextBlock>
            </TextBlock>
                </HierarchicalDataTemplate>
            </TreeView.Resources>
        </TreeView>

Here is classes: (Ticket class also have the same properties)

public class Project : EntityBase, IEntityBase
{
    private string projectUrl;
    private string projectTypeName;
    private int projectId;

    public string ProjectUrl { get { return projectUrl; } set { projectUrl = value; } }
    public string ProjectTypeName { get { return projectTypeName; } set { projectTypeName = value; } }
    public int ProjectId { get { return projectId; } set { projectId = value; } }
}

Any help will be greatly appreciated 🙂 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-11T17:30:50+00:00Added an answer on June 11, 2026 at 5:30 pm

    Try adding DataContext = this; to the end of your ReminderExtendedWindow constructor

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

Sidebar

Related Questions

I have an ObservableCollection<Object> that contains two different types. I want to bind this
I have a collection ObservableCollection<Foo> , and I want to bind this to a
I have a collection private ObservableCollection<Contact> _contacts; In the constructor of my class I
I want to create an attached property of type ObservableCollection<Notification> and bind it to
I have a ObservableCollection which holds records of custom type Item. I use that
I have an observablecollection of type frameworkelement that I would like to display in
I have two ObservableCollection lists, that i want to unite. My naive approach was
I have added several elements to an ObservableCollection and now I want to modify
I have a wpf treeview bound to collection. The model collection is of type:
I have a class ShipmentsCollection that inherits ObservableCollection which contains shipment objects (entities). This

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.