Skip to content

Commit

Permalink
Merge pull request #409 from Keboo/treeViewSMTX
Browse files Browse the repository at this point in the history
Adding ShowMeTheXAML support to TreeView Page
  • Loading branch information
SKProCH authored Oct 21, 2024
2 parents dcd9914 + b0e3d4d commit 9e7758b
Showing 1 changed file with 122 additions and 118 deletions.
240 changes: 122 additions & 118 deletions Material.Avalonia.Demo/Pages/TreeViewsDemo.axaml
Original file line number Diff line number Diff line change
@@ -1,130 +1,134 @@
<UserControl xmlns="https://github.com/avaloniaui"
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
x:Class="Material.Avalonia.Demo.Pages.TreeViewsDemo">
<StackPanel Margin="16, 0">
<StackPanel.Styles>
<Style Selector="controls|Card.ChildDemo">
<Setter Property="Width" Value="320" />
<Setter Property="Height" Value="320" />
<Setter Property="Padding" Value="0" />
</Style>
</StackPanel.Styles>
<StackPanel Margin="16, 0">
<StackPanel.Styles>
<Style Selector="controls|Card.ChildDemo">
<Setter Property="Width" Value="320" />
<Setter Property="Height" Value="320" />
<Setter Property="Padding" Value="0" />
</Style>
</StackPanel.Styles>

<!-- Content title -->
<TextBlock Classes="Headline4 Subheadline" Text="TreeViews" />
<!-- Content title -->
<TextBlock Classes="Headline4 Subheadline" Text="TreeViews" />

<WrapPanel>
<!-- Demos -->
<controls:Card Classes="ChildDemo">
<!-- TODO: StackPanel could ignore height of parent. -->
<Grid RowDefinitions="Auto, *">
<TextBlock Classes="Headline6" Margin="8" Text="Operation systems: " />

<TreeView Grid.Row="1">
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="AppleFinder" />
<TextBlock Text="Apple MacOS" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="AppleIos" />
<TextBlock Text="Apple iOS" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="MicrosoftWindows" />
<TextBlock Text="Windows" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Linux" />
<TextBlock Text="Linux" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>

<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Android" />
<TextBlock Text="Android" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<WrapPanel>
<!-- Demos -->
<showMeTheXaml:XamlDisplay UniqueId="TreeView0">

<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Arch" />
<TextBlock Text="Arch Linux" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>

<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Fedora" />
<TextBlock Text="Fedora" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Centos" />
<TextBlock Text="CentOS" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>

<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Debian" />
<TextBlock Text="Debian" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Ubuntu" />
<TextBlock Text="Ubuntu" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="LinuxMint" />
<TextBlock Text="Mint Linux" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem Header="Pop!_OS"/>
<TreeViewItem Header="Lubuntu"/>
<TreeViewItem Header="Zorin OS"/>
</TreeViewItem>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</Grid>
</controls:Card>
</WrapPanel>
</StackPanel>
<controls:Card Classes="ChildDemo">
<!-- TODO: StackPanel could ignore height of parent. -->
<Grid RowDefinitions="Auto, *">
<TextBlock Classes="Headline6" Margin="8" Text="Operation systems: " />

<TreeView Grid.Row="1">
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="AppleFinder" />
<TextBlock Text="Apple MacOS" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="AppleIos" />
<TextBlock Text="Apple iOS" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="MicrosoftWindows" />
<TextBlock Text="Windows" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Linux" />
<TextBlock Text="Linux" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>

<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Android" />
<TextBlock Text="Android" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>

<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Arch" />
<TextBlock Text="Arch Linux" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>

<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Fedora" />
<TextBlock Text="Fedora" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Centos" />
<TextBlock Text="CentOS" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>

<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Debian" />
<TextBlock Text="Debian" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Ubuntu" />
<TextBlock Text="Ubuntu" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="LinuxMint" />
<TextBlock Text="Mint Linux" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem Header="Pop!_OS" />
<TreeViewItem Header="Lubuntu" />
<TreeViewItem Header="Zorin OS" />
</TreeViewItem>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</Grid>
</controls:Card>
</showMeTheXaml:XamlDisplay>
</WrapPanel>
</StackPanel>
</UserControl>

0 comments on commit 9e7758b

Please sign in to comment.