|
16 | 16 | d:DesignWidth="700" |
17 | 17 | x:DataType="dialogs:SafetensorMetadataViewModel" |
18 | 18 | mc:Ignorable="d"> |
19 | | - <Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto"> |
| 19 | + <Grid RowDefinitions="Auto,Auto,Auto"> |
20 | 20 | <TextBlock |
21 | 21 | Margin="8" |
22 | 22 | HorizontalAlignment="Center" |
|
31 | 31 | FontWeight="SemiBold" |
32 | 32 | Text="{Binding ModelName}" /> |
33 | 33 |
|
34 | | - <!-- List of tags --> |
35 | 34 | <TextBlock |
36 | 35 | Grid.Row="2" |
37 | | - Margin="8" |
38 | | - HorizontalAlignment="Left" |
39 | | - FontSize="16" |
40 | | - FontWeight="SemiBold" |
41 | | - IsVisible="{Binding Metadata.TagFrequency, Converter={x:Static ObjectConverters.IsNotNull}}" |
42 | | - Text="Trained Tags" /> |
43 | | - <ItemsControl |
44 | | - Grid.Row="3" |
45 | | - Margin="8" |
46 | | - IsVisible="{Binding Metadata.TagFrequency, Converter={x:Static ObjectConverters.IsNotNull}}" |
47 | | - ItemsSource="{Binding Metadata.TagFrequency}"> |
48 | | - <ItemsControl.ItemTemplate> |
49 | | - <DataTemplate> |
50 | | - <Button |
51 | | - Command="{Binding $parent[ItemsControl].((dialogs:SafetensorMetadataViewModel)DataContext).CopyTagToClipboardCommand}" |
52 | | - CommandParameter="{Binding Name}" |
53 | | - Cursor="Hand"> |
54 | | - <StackPanel Orientation="Horizontal"> |
55 | | - <TextBlock FontWeight="SemiBold" Text="{Binding Name}" /> |
56 | | - <TextBlock Margin="5,0,0,0" Text="{Binding Frequency}" /> |
57 | | - </StackPanel> |
58 | | - </Button> |
59 | | - </DataTemplate> |
60 | | - </ItemsControl.ItemTemplate> |
61 | | - <ItemsControl.ItemsPanel> |
62 | | - <ItemsPanelTemplate> |
63 | | - <panels:FlexPanel |
64 | | - ColumnSpacing="5" |
65 | | - RowSpacing="5" |
66 | | - Wrap="Wrap" /> |
67 | | - </ItemsPanelTemplate> |
68 | | - </ItemsControl.ItemsPanel> |
69 | | - </ItemsControl> |
70 | | - |
71 | | - <!-- All other metadata --> |
72 | | - <TextBlock |
73 | | - Grid.Row="4" |
74 | | - Margin="8" |
75 | | - HorizontalAlignment="Left" |
76 | | - FontSize="16" |
77 | | - FontWeight="SemiBold" |
78 | | - Text="Other Metadata" /> |
79 | | - |
80 | | - <TextBlock |
81 | | - Grid.Row="5" |
82 | | - Margin="8" |
| 36 | + Margin="10,20" |
| 37 | + HorizontalAlignment="Center" |
83 | 38 | FontSize="16" |
84 | 39 | FontStyle="Italic" |
85 | | - IsVisible="{Binding !Metadata.OtherMetadata.Count}" |
| 40 | + IsVisible="{Binding Metadata, Converter={x:Static ObjectConverters.IsNull}}" |
86 | 41 | Text="No Metadata" /> |
87 | | - <ItemsControl |
88 | | - Grid.Row="5" |
89 | | - Margin="8" |
90 | | - ItemsSource="{Binding Metadata.OtherMetadata}"> |
91 | | - <ItemsControl.ItemTemplate> |
92 | | - <DataTemplate> |
93 | | - <StackPanel Margin="5" Orientation="Vertical"> |
94 | | - <TextBlock FontWeight="SemiBold" Text="{Binding Name}" /> |
95 | | - <TextBlock Text="{Binding Value}" /> |
96 | | - </StackPanel> |
97 | | - </DataTemplate> |
98 | | - </ItemsControl.ItemTemplate> |
99 | | - </ItemsControl> |
| 42 | + |
| 43 | + <Grid |
| 44 | + Grid.Row="2" |
| 45 | + IsVisible="{Binding Metadata, Converter={x:Static ObjectConverters.IsNotNull}}" |
| 46 | + RowDefinitions="Auto,Auto,Auto,Auto"> |
| 47 | + |
| 48 | + <!-- List of tags --> |
| 49 | + <TextBlock |
| 50 | + Grid.Row="0" |
| 51 | + Margin="8" |
| 52 | + HorizontalAlignment="Left" |
| 53 | + FontSize="16" |
| 54 | + FontWeight="SemiBold" |
| 55 | + IsVisible="{Binding Metadata.TagFrequency, Converter={x:Static ObjectConverters.IsNotNull}}" |
| 56 | + Text="Trained Tags" /> |
| 57 | + <ItemsControl |
| 58 | + Grid.Row="1" |
| 59 | + Margin="8" |
| 60 | + IsVisible="{Binding Metadata.TagFrequency, Converter={x:Static ObjectConverters.IsNotNull}}" |
| 61 | + ItemsSource="{Binding Metadata.TagFrequency}"> |
| 62 | + <ItemsControl.ItemTemplate> |
| 63 | + <DataTemplate> |
| 64 | + <Button |
| 65 | + Command="{Binding $parent[ItemsControl].((dialogs:SafetensorMetadataViewModel)DataContext).CopyTagToClipboardCommand}" |
| 66 | + CommandParameter="{Binding Name}" |
| 67 | + Cursor="Hand"> |
| 68 | + <StackPanel Orientation="Horizontal"> |
| 69 | + <TextBlock FontWeight="SemiBold" Text="{Binding Name}" /> |
| 70 | + <TextBlock Margin="5,0,0,0" Text="{Binding Frequency}" /> |
| 71 | + </StackPanel> |
| 72 | + </Button> |
| 73 | + </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> |
| 84 | + |
| 85 | + <!-- All other metadata --> |
| 86 | + <TextBlock |
| 87 | + Grid.Row="2" |
| 88 | + Margin="8" |
| 89 | + FontSize="16" |
| 90 | + FontWeight="SemiBold" |
| 91 | + IsVisible="{Binding !!Metadata.OtherMetadata.Count}" |
| 92 | + Text="Other Metadata" /> |
| 93 | + <ItemsControl |
| 94 | + Grid.Row="3" |
| 95 | + Margin="8" |
| 96 | + IsVisible="{Binding !!Metadata.OtherMetadata.Count}" |
| 97 | + ItemsSource="{Binding Metadata.OtherMetadata}"> |
| 98 | + <ItemsControl.ItemTemplate> |
| 99 | + <DataTemplate> |
| 100 | + <StackPanel Margin="5" Orientation="Vertical"> |
| 101 | + <TextBlock FontWeight="SemiBold" Text="{Binding Name}" /> |
| 102 | + <TextBlock Text="{Binding Value}" /> |
| 103 | + </StackPanel> |
| 104 | + </DataTemplate> |
| 105 | + </ItemsControl.ItemTemplate> |
| 106 | + </ItemsControl> |
| 107 | + </Grid> |
100 | 108 | </Grid> |
101 | 109 | </controls:UserControlBase> |
0 commit comments