|
| 1 | +<UserControl x:Class="OnnxStack.UI.Views.ImageToImage" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" |
| 7 | + xmlns:userControls="clr-namespace:OnnxStack.UI.UserControls" |
| 8 | + Name="UI" mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="800" > |
| 9 | + <Grid DataContext="{Binding ElementName=UI}" > |
| 10 | + <Grid.ColumnDefinitions> |
| 11 | + <ColumnDefinition Width="340" /> |
| 12 | + <ColumnDefinition Width="10" /> |
| 13 | + <ColumnDefinition Width="*" /> |
| 14 | + </Grid.ColumnDefinitions> |
| 15 | + |
| 16 | + <!--Control Panel--> |
| 17 | + <DockPanel Grid.Column="0" DataContext="{Binding ElementName=UI}" Margin="3"> |
| 18 | + <UniformGrid DockPanel.Dock="Bottom" Columns="2" Height="30"> |
| 19 | + <Button Content="Cancel" Command="{Binding CancelCommand}" BorderThickness="1,1,0,1"/> |
| 20 | + <Button Content="Generate" Command="{Binding GenerateCommand}" /> |
| 21 | + </UniformGrid> |
| 22 | + <DockPanel> |
| 23 | + <StackPanel IsEnabled="{Binding IsGenerating, Converter={StaticResource InverseBoolConverter}}"> |
| 24 | + <userControls:PromptControl PromptOptions="{Binding PromptOptions}" /> |
| 25 | + <userControls:SchedulerControl SchedulerOptions="{Binding SchedulerOptions, Mode=TwoWay}" ProcessType="ImageToImage" Margin="0, 10, 0 ,0"/> |
| 26 | + </StackPanel> |
| 27 | + </DockPanel> |
| 28 | + </DockPanel> |
| 29 | + |
| 30 | + <GridSplitter Grid.Column="1" Width="4" HorizontalAlignment="Stretch" /> |
| 31 | + |
| 32 | + <!--Content Panel--> |
| 33 | + <DockPanel Grid.Column="2" > |
| 34 | + |
| 35 | + <!--Generate Tab--> |
| 36 | + <TabControl SelectedIndex="{Binding SelectedTabIndex}"> |
| 37 | + <TabItem> |
| 38 | + <TabItem.Header> |
| 39 | + <StackPanel Orientation="Horizontal" Margin="15,5"> |
| 40 | + <userControls:FontAwesome Icon="" IconStyle="Light"/> |
| 41 | + <TextBlock Text="Generate" Margin="5,0,0,0"/> |
| 42 | + </StackPanel> |
| 43 | + </TabItem.Header> |
| 44 | + <UniformGrid Columns="2" VerticalAlignment="Center" HorizontalAlignment="Center"> |
| 45 | + <Viewbox Margin="40,40,20,40" > |
| 46 | + <userControls:ImageInputControl |
| 47 | + Result="{Binding InputImage, Mode=TwoWay}" |
| 48 | + HasResult="{Binding HasInputResult, Mode=TwoWay}" |
| 49 | + SchedulerOptions="{Binding SchedulerOptions}" /> |
| 50 | + </Viewbox> |
| 51 | + <Viewbox Margin="20,40,40,40" > |
| 52 | + <userControls:ImageResultControl |
| 53 | + Result="{Binding ResultImage}" |
| 54 | + HasResult="{Binding HasResult}" |
| 55 | + ProgressMax="{Binding ProgressMax}" |
| 56 | + ProgressValue="{Binding ProgressValue}" |
| 57 | + SchedulerOptions="{Binding SchedulerOptions, Mode=TwoWay}" /> |
| 58 | + </Viewbox> |
| 59 | + </UniformGrid> |
| 60 | + </TabItem> |
| 61 | + |
| 62 | + <!--History Tab--> |
| 63 | + <TabItem> |
| 64 | + <TabItem.Header> |
| 65 | + <StackPanel Orientation="Horizontal" Margin="15,5"> |
| 66 | + <userControls:FontAwesome Icon="" IconStyle="Light"/> |
| 67 | + <TextBlock Text="History" Margin="5,0,0,0"/> |
| 68 | + </StackPanel> |
| 69 | + </TabItem.Header> |
| 70 | + <DockPanel> |
| 71 | + <DockPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right"> |
| 72 | + <StackPanel Orientation="Horizontal" Margin="0,4,0,0"> |
| 73 | + <Button Command="{Binding ClearHistoryCommand}" Padding="10,3" Height="30"> |
| 74 | + <userControls:FontAwesome Icon="" IconStyle="Light"/> |
| 75 | + </Button> |
| 76 | + </StackPanel> |
| 77 | + </DockPanel> |
| 78 | + <ListBox ItemsSource="{Binding}" ItemContainerStyle="{StaticResource ImageResultListBoxItem}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" > |
| 79 | + <ListBox.DataContext> |
| 80 | + <CollectionViewSource Source="{Binding ImageResults, ElementName=UI}"> |
| 81 | + <CollectionViewSource.SortDescriptions> |
| 82 | + <scm:SortDescription PropertyName="Timestamp" Direction="Descending" /> |
| 83 | + </CollectionViewSource.SortDescriptions> |
| 84 | + </CollectionViewSource> |
| 85 | + </ListBox.DataContext> |
| 86 | + <ListBox.ItemsPanel> |
| 87 | + <ItemsPanelTemplate> |
| 88 | + <WrapPanel /> |
| 89 | + </ItemsPanelTemplate> |
| 90 | + </ListBox.ItemsPanel> |
| 91 | + </ListBox> |
| 92 | + </DockPanel> |
| 93 | + </TabItem> |
| 94 | + |
| 95 | + </TabControl> |
| 96 | + </DockPanel> |
| 97 | + </Grid> |
| 98 | +</UserControl> |
0 commit comments