Happy to introduce TreeView 🎉 #54
enisn
announced in
Announcements
Replies: 1 comment 3 replies
-
Hi @enisn, do I need to set a property to click to expand in a treeview item? <uranium:UraniumContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:uranium="clr-namespace:UraniumUI.Pages;assembly=UraniumUI"
xmlns:attachment="clr-namespace:UraniumUI.Material.Attachments;assembly=UraniumUI.Material"
xmlns:material="clr-namespace:UraniumUI.Material.Controls;assembly=UraniumUI.Material"
xmlns:m="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
xmlns:input="clr-namespace:InputKit.Shared.Controls;assembly=InputKit.Maui"
xmlns:vm="clr-namespace:GenericContainer.ViewModel"
x:Class="GenericContainer.MainPage"
xmlns:local="clr-namespace:GenericContainer"
x:Name="page">
<uranium:UraniumContentPage.BindingContext>
<vm:TreeViewFileSystemViewModel/>
</uranium:UraniumContentPage.BindingContext>
<uranium:UraniumContentPage.Resources>
<Style TargetType="Frame">
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource SecondaryContainer}, Dark={StaticResource SecondaryContainerDark}}" />
</Style>
</uranium:UraniumContentPage.Resources>
<uranium:UraniumContentPage.MenuBarItems DockPanel.Dock="Top">
<MenuBarItem Text="File">
<MenuFlyoutItem Text="New"/>
<MenuFlyoutItem Text="Open"/>
<MenuFlyoutItem Text="Save"/>
<MenuFlyoutItem Text="Save As..."/>
<MenuFlyoutItem Text="Import Wizard"/>
<MenuFlyoutItem Text="Exit"/>
</MenuBarItem>
<MenuBarItem Text="Tools">
<MenuFlyoutItem Text="Fill Form"/>
<MenuFlyoutItem Text="Show JSonViewer"/>
<MenuFlyoutItem Text="Deploy ZipFile"/>
</MenuBarItem>
<MenuBarItem Text="Help">
<MenuFlyoutItem Text="About"/>
</MenuBarItem>
</uranium:UraniumContentPage.MenuBarItems>
<ScrollView
Padding="30,0"
VerticalOptions="Center">
<material:TreeView
ItemsSource="{Binding Nodes}"
LoadChildrenCommand="{Binding LoadChildrenCommand}">
<material:TreeView.ItemTemplate>
<DataTemplate>
<HorizontalStackLayout Spacing="5" VerticalOptions="Center">
<Image>
<Image.Triggers>
<DataTrigger TargetType="Image" Binding="{Binding IsDirectory}" Value="True">
<Setter Property="Source" Value="{FontImageSource FontFamily=MaterialRegular, Glyph={x:Static m:MaterialRegular.Folder}, Color={AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}}" />
</DataTrigger>
<DataTrigger TargetType="Image" Binding="{Binding IsDirectory}" Value="False">
<Setter Property="Source" Value="{FontImageSource FontFamily=MaterialRegular, Glyph={x:Static m:MaterialRegular.Insert_drive_file}, Color={AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}}" />
</DataTrigger>
</Image.Triggers>
</Image>
<Label Text="{Binding Name}" FontAttributes="Bold" />
</HorizontalStackLayout>
</DataTemplate>
</material:TreeView.ItemTemplate>
</material:TreeView>
</ScrollView>
</uranium:UraniumContentPage> |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TreeView has been released in version 0.12.0.
TreeView is a component that displays a hierarchical list of items. It's a MAUI layer control with complex logic. It also comes with some pre-built behaviors like hierarchical selection.
Beta Was this translation helpful? Give feedback.
All reactions