Skip to content

Instantly share code, notes, and snippets.

@vnbaaij
Created July 18, 2022 09:07
Show Gist options
  • Save vnbaaij/5ee7cf01e52cd3579ac37866eb92323e to your computer and use it in GitHub Desktop.
Save vnbaaij/5ee7cf01e52cd3579ac37866eb92323e to your computer and use it in GitHub Desktop.
<FluentTreeView OnExpandedChange="HandleOnExpandedChanged">
<FluentTreeItem Text="Root item 1">
<FluentTreeItem Text="Flowers">
<FluentTreeItem Disabled="true" Text="Daisy" />
<FluentTreeItem Text="Sunflower" />
<FluentTreeItem Text="Rose" />
</FluentTreeItem>
<FluentTreeItem Text="Nested item 2" />
<FluentTreeItem Text="Nested item 3" />
</FluentTreeItem>
<FluentTreeItem Text="Root item 2" >
<FluentDivider></FluentDivider>
<FluentTreeItem Text="Flowers">
<FluentTreeItem Disabled="true" Text="Daisy" />
<FluentTreeItem Text="Sunflower" />
<FluentTreeItem Text="Rose" />
</FluentTreeItem>
<FluentTreeItem Text="Nested item 2" />
<FluentTreeItem Text="Nested item 3" />
</FluentTreeItem>
<FluentTreeItem Text="Root item 3 - Leaf Erikson" />
</FluentTreeView>
<p>Current expanded/collapsed tree item is @currentAffected?.Text</p>
@code {
FluentTreeItem? currentAffected;
private void HandleOnExpandedChanged(FluentTreeItem item)
{
currentAffected = item;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment