Catalog/imagecatalog/Controls/PathPickerField.axaml
Maddo 398cfa310e
Some checks failed
Build Windows Avalonia / build (push) Failing after 1m46s
Build Windows Avalonia / release (push) Has been skipped
Refactor path handling in UI components
- Removed redundant folder and file opening methods from AiTabView and FaceAiTabView.
- Introduced PathPickerField control to streamline path selection and opening functionality across multiple views.
- Updated FaceAiTabView and GeneralTabView to utilize PathPickerField for source and destination path selection.
- Created PathShellService to encapsulate logic for opening paths in the file explorer.
- Simplified XAML structure by replacing manual grid definitions with PathPickerField components.
- Removed unused namespaces and cleaned up code for better readability and maintainability.
2026-05-24 19:07:17 +02:00

34 lines
No EOL
1.6 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iconPacks="https://github.com/MahApps/IconPacks.Avalonia"
x:Class="ImageCatalog_2.Controls.PathPickerField"
x:Name="Root">
<Grid ColumnDefinitions="Auto,*,Auto,Auto" ColumnSpacing="6">
<TextBlock Grid.Column="0"
Text="{Binding Label, ElementName=Root}"
VerticalAlignment="Center"
Margin="0,0,8,0" />
<TextBox Grid.Column="1"
Text="{Binding Text, ElementName=Root, Mode=TwoWay}"
IsReadOnly="{Binding IsTextReadOnly, ElementName=Root}"
Watermark="{Binding Watermark, ElementName=Root}"
VerticalAlignment="Center" />
<Button Grid.Column="2"
Width="104"
IsVisible="{Binding ShowPickerButton, ElementName=Root}"
Click="PickPath_Click">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="6">
<iconPacks:PackIconMaterial Kind="FolderOpenOutline" Width="14" Height="14" />
<TextBlock Text="Scegli..." />
</StackPanel>
</Button>
<Button Grid.Column="3"
Width="72"
Click="OpenPath_Click">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="6">
<iconPacks:PackIconMaterial Kind="Folder" Width="14" Height="14" />
<TextBlock Text="Apri" />
</StackPanel>
</Button>
</Grid>
</UserControl>