0

I have a list of strings, a general formatting of:

"Header_subheader1_subheader2_item"

The problem is the actual string can vary in the amount of subheaders it contains. It might not have any, it may have 3 or 4. I've been trying to find a way to easily create a TreeView directly, or better yet a good bindable source I can create inside my ViewModel, and have so far come up empty as far as this type of scenario is concerned.

Looking for suggestions!

Thanks

1 Answer 1

1

I think that best option will be to create list of Item classes with Header and ListOfSubheaders properties. On creation it will parse your strings, also you will be able to add logic in it and after that easily create TreeView

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the reply, I'll look at that!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.