Skip to content

Commit 3a02c82

Browse files
committed
Switch to FluentAvalonia controls
1 parent 6a42aa6 commit 3a02c82

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

Directory.Packages.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
<PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
9393
<PackageVersion Include="Avalonia.HtmlRenderer" Version="11.0.0" />
9494
<PackageVersion Include="Avalonia.Labs.Controls" Version="11.2.0" />
95-
<PackageVersion Include="Avalonia.Labs.Panels" Version="11.2.0" />
9695
<PackageVersion Include="Avalonia.Xaml.Behaviors" Version="11.2.0" />
9796
<PackageVersion Include="AvaloniaEdit.TextMate" Version="11.0.6" />
9897
<PackageVersion Include="TextMateSharp.Grammars" Version="1.0.56" />

StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" />
8787
<PackageReference Include="Avalonia.HtmlRenderer" />
8888
<PackageReference Include="Avalonia.Labs.Controls" />
89-
<PackageReference Include="Avalonia.Labs.Panels" />
9089
<PackageReference Include="Avalonia.Xaml.Behaviors" />
9190
<PackageReference Include="AvaloniaEdit.TextMate" />
9291
<PackageReference Include="bodong.Avalonia.PropertyGrid" />

StabilityMatrix.Avalonia/Views/Dialogs/SafetensorMetadataDialog.axaml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1010
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
1111
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core"
12-
xmlns:panels="using:Avalonia.Labs.Panels"
1312
xmlns:ui="using:FluentAvalonia.UI.Controls"
1413
d:DataContext="{x:Static mocks:DesignData.SafetensorMetadataViewModel}"
1514
d:DesignHeight="550"
@@ -54,15 +53,22 @@
5453
FontWeight="SemiBold"
5554
IsVisible="{Binding Metadata.TagFrequency, Converter={x:Static ObjectConverters.IsNotNull}}"
5655
Text="Trained Tags" />
57-
<ItemsControl
56+
57+
<ui:ItemsRepeater
5858
Grid.Row="1"
5959
Margin="8"
6060
IsVisible="{Binding Metadata.TagFrequency, Converter={x:Static ObjectConverters.IsNotNull}}"
6161
ItemsSource="{Binding Metadata.TagFrequency}">
62-
<ItemsControl.ItemTemplate>
62+
<ui:ItemsRepeater.Layout>
63+
<ui:FlowLayout
64+
MinColumnSpacing="4"
65+
MinRowSpacing="4"
66+
Orientation="Horizontal" />
67+
</ui:ItemsRepeater.Layout>
68+
<ui:ItemsRepeater.ItemTemplate>
6369
<DataTemplate>
6470
<Button
65-
Command="{Binding $parent[ItemsControl].((dialogs:SafetensorMetadataViewModel)DataContext).CopyTagToClipboardCommand}"
71+
Command="{Binding $parent[ui:ItemsRepeater].((dialogs:SafetensorMetadataViewModel)DataContext).CopyTagToClipboardCommand}"
6672
CommandParameter="{Binding Name}"
6773
Cursor="Hand">
6874
<StackPanel Orientation="Horizontal">
@@ -71,39 +77,37 @@
7177
</StackPanel>
7278
</Button>
7379
</DataTemplate>
74-
</ItemsControl.ItemTemplate>
75-
<ItemsControl.ItemsPanel>
76-
<ItemsPanelTemplate>
77-
<panels:FlexPanel
78-
ColumnSpacing="5"
79-
RowSpacing="5"
80-
Wrap="Wrap" />
81-
</ItemsPanelTemplate>
82-
</ItemsControl.ItemsPanel>
83-
</ItemsControl>
80+
</ui:ItemsRepeater.ItemTemplate>
81+
</ui:ItemsRepeater>
8482

8583
<!-- All other metadata -->
8684
<TextBlock
8785
Grid.Row="2"
8886
Margin="8"
8987
FontSize="16"
9088
FontWeight="SemiBold"
91-
IsVisible="{Binding !!Metadata.OtherMetadata.Count}"
9289
Text="Other Metadata" />
93-
<ItemsControl
90+
<TextBlock
91+
Grid.Row="3"
92+
Margin="8"
93+
FontSize="16"
94+
FontStyle="Italic"
95+
IsVisible="{Binding !Metadata.OtherMetadata.Count}"
96+
Text="No Other Metadata" />
97+
<ui:ItemsRepeater
9498
Grid.Row="3"
9599
Margin="8"
96100
IsVisible="{Binding !!Metadata.OtherMetadata.Count}"
97101
ItemsSource="{Binding Metadata.OtherMetadata}">
98-
<ItemsControl.ItemTemplate>
102+
<ui:ItemsRepeater.ItemTemplate>
99103
<DataTemplate>
100104
<StackPanel Margin="5" Orientation="Vertical">
101105
<TextBlock FontWeight="SemiBold" Text="{Binding Name}" />
102106
<TextBlock Text="{Binding Value}" />
103107
</StackPanel>
104108
</DataTemplate>
105-
</ItemsControl.ItemTemplate>
106-
</ItemsControl>
109+
</ui:ItemsRepeater.ItemTemplate>
110+
</ui:ItemsRepeater>
107111
</Grid>
108112
</Grid>
109113
</controls:UserControlBase>

0 commit comments

Comments
 (0)