|
9 | 9 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
10 | 10 | xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData" |
11 | 11 | xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core" |
12 | | - xmlns:panels="using:Avalonia.Labs.Panels" |
13 | 12 | xmlns:ui="using:FluentAvalonia.UI.Controls" |
14 | 13 | d:DataContext="{x:Static mocks:DesignData.SafetensorMetadataViewModel}" |
15 | 14 | d:DesignHeight="550" |
|
54 | 53 | FontWeight="SemiBold" |
55 | 54 | IsVisible="{Binding Metadata.TagFrequency, Converter={x:Static ObjectConverters.IsNotNull}}" |
56 | 55 | Text="Trained Tags" /> |
57 | | - <ItemsControl |
| 56 | + |
| 57 | + <ui:ItemsRepeater |
58 | 58 | Grid.Row="1" |
59 | 59 | Margin="8" |
60 | 60 | IsVisible="{Binding Metadata.TagFrequency, Converter={x:Static ObjectConverters.IsNotNull}}" |
61 | 61 | 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> |
63 | 69 | <DataTemplate> |
64 | 70 | <Button |
65 | | - Command="{Binding $parent[ItemsControl].((dialogs:SafetensorMetadataViewModel)DataContext).CopyTagToClipboardCommand}" |
| 71 | + Command="{Binding $parent[ui:ItemsRepeater].((dialogs:SafetensorMetadataViewModel)DataContext).CopyTagToClipboardCommand}" |
66 | 72 | CommandParameter="{Binding Name}" |
67 | 73 | Cursor="Hand"> |
68 | 74 | <StackPanel Orientation="Horizontal"> |
|
71 | 77 | </StackPanel> |
72 | 78 | </Button> |
73 | 79 | </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> |
84 | 82 |
|
85 | 83 | <!-- All other metadata --> |
86 | 84 | <TextBlock |
87 | 85 | Grid.Row="2" |
88 | 86 | Margin="8" |
89 | 87 | FontSize="16" |
90 | 88 | FontWeight="SemiBold" |
91 | | - IsVisible="{Binding !!Metadata.OtherMetadata.Count}" |
92 | 89 | 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 |
94 | 98 | Grid.Row="3" |
95 | 99 | Margin="8" |
96 | 100 | IsVisible="{Binding !!Metadata.OtherMetadata.Count}" |
97 | 101 | ItemsSource="{Binding Metadata.OtherMetadata}"> |
98 | | - <ItemsControl.ItemTemplate> |
| 102 | + <ui:ItemsRepeater.ItemTemplate> |
99 | 103 | <DataTemplate> |
100 | 104 | <StackPanel Margin="5" Orientation="Vertical"> |
101 | 105 | <TextBlock FontWeight="SemiBold" Text="{Binding Name}" /> |
102 | 106 | <TextBlock Text="{Binding Value}" /> |
103 | 107 | </StackPanel> |
104 | 108 | </DataTemplate> |
105 | | - </ItemsControl.ItemTemplate> |
106 | | - </ItemsControl> |
| 109 | + </ui:ItemsRepeater.ItemTemplate> |
| 110 | + </ui:ItemsRepeater> |
107 | 111 | </Grid> |
108 | 112 | </Grid> |
109 | 113 | </controls:UserControlBase> |
0 commit comments