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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:29:11+00:00 2026-06-15T15:29:11+00:00

I am trying to create a simple logging system with a hierarchical ‘feel’. I

  • 0

I am trying to create a simple logging system with a hierarchical ‘feel’. I hope this screen shot explains my object clearly:

enter image description here

As you can see, I create a new object of type LogDetails which exposes just 4 fields:

public string Message;
        public LogStatus Status;
        public string ErrorDetails;

        public enum LogStatus
        {
            Complete, Failed, Error, FatalError, Progress, Started
        }

I have another class which has a Title property (string) and a LogDetails property.

When I bind to XAML, my tree view shows this:

enter image description here

As you can see, the root is fine and expected/desired (red) but each sub category isn’t broken down – I want to be able to bypass a level and go direct to ErrorDetails, Message and Status. So, I would like to create this (mocked up in Word, but hopefully you get the idea):

enter image description here

This is my xaml:

<Grid>
<TreeView ItemsSource="{Binding}">
    <TreeView.ItemTemplate>
        <HierarchicalDataTemplate ItemsSource="{Binding LogDetailsList}" >
            <TextBlock Text="{Binding Title}" />
            <HierarchicalDataTemplate.ItemTemplate>

                <DataTemplate>
                    <TextBlock Text="{Binding}" />
                </DataTemplate>

            </HierarchicalDataTemplate.ItemTemplate>
        </HierarchicalDataTemplate>            
    </TreeView.ItemTemplate>
</TreeView>
</Grid>

And my MainWindow code behind

public partial class MainWindow : Window
    {
        static public ObservableCollection<Log> logList;

        public MainWindow(List<Log> logs)
        {
            InitializeComponent();

            logList = new ObservableCollection<Log>();

            foreach (var item in logs)
            {
                logList.Add(item);    
            }

            this.DataContext = logList;
        }
    }

Can anyone please point me in the right direction, or at least let me know if my design is flawed?

EDIT
When I try to add another text block or ItemTEmplate, I get the error message “The property ItemTemplate is set more than once” or “The property VisualTree is set more than once”

  • 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-15T15:29:12+00:00Added an answer on June 15, 2026 at 3:29 pm

    You should provide a path to the binding expression.

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

Sidebar

Related Questions

We're trying to create a simple to use webservice for logging exceptions and messages.
I'm trying to create simple PayPal Pay API operation, when I run this code
I'm trying to create simple script that subscribes a user to a company calendar.
I'm studying webrat and cucumber and trying to create simple example. Here is my
I setup a Paypal Sandbox account and am trying to create simple purchases through
Im trying to create a simple pan and zoom app using silverlight 4, but
Im trying to create a simple input box with form validation, but im not
I'm trying to create a simple widget to retrieve a users feeds, I have
I am trying to create a simple about page that uses JQuery click to
I am trying to create a simple program using Gstreamer to take the input

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.