mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
66 lines
4.0 KiB
XML
66 lines
4.0 KiB
XML
<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"
|
|
xmlns:visualScripting="clr-namespace:Artemis.UI.Screens.VisualScripting"
|
|
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
|
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
|
|
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
|
mc:Ignorable="d" d:DesignWidth="650" d:DesignHeight="450"
|
|
x:Class="Artemis.UI.Screens.VisualScripting.NodePickerView"
|
|
x:DataType="visualScripting:NodePickerViewModel"
|
|
Width="600"
|
|
Height="400">
|
|
<UserControl.Styles>
|
|
<Style Selector="TextBox#SearchBox">
|
|
<Setter Property="VerticalAlignment" Value="Top"></Setter>
|
|
<Setter Property="InnerRightContent">
|
|
<Template>
|
|
<StackPanel Orientation="Horizontal">
|
|
<controls:Button Content=""
|
|
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
|
Classes="AppBarButton"
|
|
Command="{Binding $parent[TextBox].Clear}"
|
|
IsVisible="{Binding $parent[TextBox].Text, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" />
|
|
<controls:Button Content=""
|
|
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
|
Classes="AppBarButton"
|
|
IsHitTestVisible="False" />
|
|
</StackPanel>
|
|
</Template>
|
|
</Setter>
|
|
</Style>
|
|
</UserControl.Styles>
|
|
<Border Classes="picker-container">
|
|
<Grid RowDefinitions="Auto,*">
|
|
<TextBox Name="SearchBox" Text="{CompiledBinding SearchText}" Margin="0 0 0 15" Watermark="Search"></TextBox>
|
|
<TreeView Name="NodeTree"
|
|
Grid.Row="1"
|
|
Items="{CompiledBinding Categories}"
|
|
IsVisible="{CompiledBinding Categories.Count}"
|
|
SelectedItem="{CompiledBinding SelectedNode}"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
|
<TreeView.Styles>
|
|
<Style Selector="TreeViewItem">
|
|
<Setter Property="IsExpanded" Value="True" />
|
|
</Style>
|
|
</TreeView.Styles>
|
|
<TreeView.DataTemplates>
|
|
<TreeDataTemplate DataType="{x:Type core:NodeData}">
|
|
<StackPanel Margin="-15 1 0 1" Background="Transparent" PointerReleased="InputElement_OnPointerReleased">
|
|
<TextBlock Classes="BodyStrongTextBlockStyle" Text="{Binding Name}" TextWrapping="Wrap"></TextBlock>
|
|
<TextBlock Foreground="{DynamicResource TextFillColorSecondary}" Text="{Binding Description}" TextWrapping="Wrap"></TextBlock>
|
|
</StackPanel>
|
|
</TreeDataTemplate>
|
|
<TreeDataTemplate ItemsSource="{Binding Items}">
|
|
<TextBlock Text="{Binding Key}"></TextBlock>
|
|
</TreeDataTemplate>
|
|
</TreeView.DataTemplates>
|
|
</TreeView>
|
|
<StackPanel Grid.Row="1" VerticalAlignment="Center" Spacing="20" IsVisible="{CompiledBinding !Categories.Count}">
|
|
<avalonia:MaterialIcon Kind="CloseCircle" Width="64" Height="64"></avalonia:MaterialIcon>
|
|
<TextBlock Classes="h4" TextAlignment="Center">None of the nodes match your search</TextBlock>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</UserControl> |