|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | 4 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
5 | 5 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 6 | + xmlns:local="clr-namespace:OnnxStack.UI.Dialogs" |
| 7 | + xmlns:userControls="clr-namespace:OnnxStack.UI.UserControls" |
6 | 8 | mc:Ignorable="d" |
7 | 9 | Name="UI" |
8 | 10 | Icon="/Images/Icon.png" |
9 | | - MinWidth="400" |
| 11 | + MinWidth="500" |
10 | 12 | SizeToContent="WidthAndHeight" |
11 | 13 | WindowStartupLocation="CenterOwner" |
12 | 14 | SnapsToDevicePixels="True" |
13 | 15 | UseLayoutRounding="True" |
14 | 16 | Style="{StaticResource BaseWindow}" |
15 | | - ContentRendered="OnContentRendered"> |
| 17 | + ContentRendered="OnContentRendered" |
| 18 | + Title="Add Model"> |
16 | 19 | <DockPanel DataContext="{Binding ElementName=UI}" Margin="15, 15, 15, 10"> |
17 | 20 | <StackPanel DockPanel.Dock="Top"> |
18 | | - <TextBlock Text="{Binding ErrorMessage}" FontSize="13" FontWeight="DemiBold" HorizontalAlignment="Center" Foreground="Red" Margin="0,10"> |
19 | | - <TextBlock.Style> |
20 | | - <Style TargetType="{x:Type TextBlock}"> |
21 | | - <Setter Property="Visibility" Value="Visible" /> |
22 | | - <Style.Triggers> |
23 | | - <DataTrigger Binding="{Binding ErrorMessage.Length, ElementName=UI}" Value="0"> |
24 | | - <Setter Property="Visibility" Value="Collapsed" /> |
25 | | - </DataTrigger> |
26 | | - </Style.Triggers> |
27 | | - </Style> |
28 | | - </TextBlock.Style> |
29 | | - </TextBlock> |
30 | | - <TextBlock Text="Model Pipleine"/> |
31 | | - <ComboBox ItemsSource="{Binding Source={StaticResource DiffuserPipelineType}}" SelectedItem="{Binding PipelineType}" /> |
32 | | - <TextBlock Text="Model Name"/> |
33 | | - <TextBox Text="{Binding TextResult, UpdateSourceTrigger=PropertyChanged}" /> |
| 21 | + |
| 22 | + <UniformGrid Columns="2"> |
| 23 | + <StackPanel> |
| 24 | + <TextBlock Text="Model Pipeline"/> |
| 25 | + <ComboBox ItemsSource="{Binding Source={StaticResource DiffuserPipelineType}}" SelectedItem="{Binding PipelineType}" /> |
| 26 | + </StackPanel> |
| 27 | + <StackPanel> |
| 28 | + <TextBlock Text="Model Type"/> |
| 29 | + <ComboBox ItemsSource="{Binding Source={StaticResource ModelType}}" SelectedItem="{Binding ModelType}" /> |
| 30 | + <StackPanel.Style> |
| 31 | + <Style TargetType="{x:Type StackPanel}"> |
| 32 | + <Setter Property="IsEnabled" Value="False" /> |
| 33 | + <Style.Triggers> |
| 34 | + <DataTrigger Binding="{Binding PipelineType, ElementName=UI}" Value="StableDiffusionXL"> |
| 35 | + <Setter Property="IsEnabled" Value="True" /> |
| 36 | + </DataTrigger> |
| 37 | + <DataTrigger Binding="{Binding PipelineType, ElementName=UI}" Value="LatentConsistencyXL"> |
| 38 | + <Setter Property="IsEnabled" Value="True" /> |
| 39 | + </DataTrigger> |
| 40 | + </Style.Triggers> |
| 41 | + </Style> |
| 42 | + </StackPanel.Style> |
| 43 | + </StackPanel> |
| 44 | + </UniformGrid> |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + <StackPanel Margin="0,10,0,0"> |
| 51 | + <TextBlock Text="Model Folder"/> |
| 52 | + <userControls:FilePickerTextBox FileName="{Binding ModelFolder, Mode=TwoWay}" IsFolderPicker="True" /> |
| 53 | + </StackPanel> |
| 54 | + |
| 55 | + <StackPanel Margin="0,10,0,0"> |
| 56 | + <TextBlock Text="Model Name"/> |
| 57 | + <TextBox Text="{Binding ModelName, UpdateSourceTrigger=PropertyChanged}" /> |
| 58 | + </StackPanel> |
| 59 | + |
| 60 | + <StackPanel Margin="5"> |
| 61 | + <StackPanel Orientation="Horizontal" Visibility="{Binding IsNameInvalid, Converter={StaticResource BooleanToVisibilityConverter}}"> |
| 62 | + <userControls:FontAwesome Icon="" Color="Red" /> |
| 63 | + <TextBlock Text="Name" Margin="5,0,0,3" /> |
| 64 | + </StackPanel> |
| 65 | + |
| 66 | + <ItemsControl ItemsSource="{Binding ValidationResults}"> |
| 67 | + <ItemsControl.ItemTemplate> |
| 68 | + <DataTemplate DataType="{x:Type local:ValidationResult}"> |
| 69 | + <StackPanel Orientation="Horizontal"> |
| 70 | + <userControls:FontAwesome > |
| 71 | + <userControls:FontAwesome.Style> |
| 72 | + <Style TargetType="{x:Type userControls:FontAwesome}"> |
| 73 | + <Setter Property="Color" Value="Red" /> |
| 74 | + <Setter Property="Icon" Value="" /> |
| 75 | + <Style.Triggers> |
| 76 | + <DataTrigger Binding="{Binding IsValid}" Value="True"> |
| 77 | + <Setter Property="Color" Value="LimeGreen" /> |
| 78 | + <Setter Property="Icon" Value="" /> |
| 79 | + </DataTrigger> |
| 80 | + </Style.Triggers> |
| 81 | + </Style> |
| 82 | + </userControls:FontAwesome.Style> |
| 83 | + </userControls:FontAwesome> |
| 84 | + <TextBlock Text="{Binding ModelType}" Margin="5,0,0,3" /> |
| 85 | + </StackPanel> |
| 86 | + </DataTemplate> |
| 87 | + </ItemsControl.ItemTemplate> |
| 88 | + </ItemsControl> |
| 89 | + |
| 90 | + </StackPanel> |
| 91 | + |
| 92 | + |
34 | 93 | </StackPanel> |
35 | 94 | <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,20,0,0"> |
36 | 95 | <UniformGrid Columns="2" Height="30"> |
|
0 commit comments