Skip to content

TreeView not using to HierarchicalDataTemplate - #4526

Closed
ManGupt wants to merge 1 commit into
dotnet:masterfrom
ManGupt:patch-1
Closed

ManGupt wants to merge 1 commit into
dotnet:masterfrom
ManGupt:patch-1

Conversation

@ManGupt

@ManGupt ManGupt commented Mar 1, 2018

Copy link
Copy Markdown

TreeView XAML code is not referring to the previously defined HierarchicalDataTemplate code in any way.

Fixed typo

Fixed a typo in the documentation related to the code.

Summary

XAML code for TreeView is independent piece of code.

TreeView XAML code is not referring to the previously defined HierarchicalDataTemplate code in any way.
@BillWagner
BillWagner requested a review from rpetrusha March 1, 2018 15:22
@BillWagner

Copy link
Copy Markdown
Member

@rpetrusha Can you look at this? The fix looks correct, but that would leave the description of the hierarchical template without any usage.

If I'm right, would a better fix be including the template in the treeview (fixing the XAML instead of the text)?

@JRAlexander JRAlexander added the ✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository label Mar 1, 2018
@rpetrusha

Copy link
Copy Markdown
Contributor

//cc @Tanya-Solyanik

The problem here is that we've failed to present all of the XAML used by the example. If it's compiled, it shows that the template is clearly used to present the employee name, with employee workdays as a second level of the hierarchy. If the <HierarchicalDataElement> tag is removed or commented out, all EmployeeInfo information appears on a single line.

Since it is used, we need to address this issue by presenting all of the XAML and highlighting individual lines of it. Since our previous publishing system didn't have that capability, code was divided into snippets and portions of code were commonly not published, as was the case here. I'll open a new issue to revise the topic accordingly and close this PR. If you disagree, @ManGupt, please let us know.

@ManGupt

ManGupt commented Mar 2, 2018 •

Copy link
Copy Markdown
Author

I agree with @BillWagner on updating the XAML code. Here is my suggestion:
changing <HierarchicalDataTemplate DataType="EmployeeInfo"
to <HierarchicalDataTemplate x:Key="SampleTemplate" DataType="EmployeeInfo"
and
changing <TreeView ItemsSource.../>
to <TreeView ItemTemplate="{StaticResource SampleTemplate}" ItemsSource.../>

What do you think?

@rpetrusha

Copy link
Copy Markdown
Contributor

That sounds good, @ManGupt. I think we need to modify the example, present the example in a block and use highlighting, and modify the text to better reflect the example. I'll modify the issue that I opened. If you'd like to make some of the changes, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants