Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
4.5 KiB

<controls:UserControlBase xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dialogs="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Dialogs"
xmlns:ui="using:FluentAvalonia.UI.Controls"
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages"
d:DataContext="{x:Static mocks:DesignData.SelectDataDirectoryViewModel}"
x:DataType="dialogs:SelectDataDirectoryViewModel"
x:CompileBindings="True"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="StabilityMatrix.Avalonia.Views.Dialogs.SelectDataDirectoryDialog">
<Grid RowDefinitions="Auto,1*,1*"
Margin="16,0,16,16"
MinHeight="450"
MaxWidth="700" >
<StackPanel Grid.Row="0" Margin="0,0,0,16">
<ui:InfoBar
IsClosable="False"
IsOpen="True"
Margin="0,0,0,16"
IsVisible="{Binding HasOldData}"
Title="Welcome back! In this update, you can optionally choose a custom location to store all data. If you choose a new location, or opt to use Portable Mode, you'll be able to migrate your existing data on the next page."/>
<Label
Content="{x:Static lang:Resources.Label_DataDirectory}"
FontSize="13"
Margin="0,16,0,0" />
<Grid ColumnDefinitions="*,Auto">
<TextBox
Height="36"
IsEnabled="{Binding !IsPortableMode}"
Margin="0,0,8,0"
Watermark="{Binding DefaultInstallLocation}"
Text="{Binding DataDirectory}"
VerticalAlignment="Stretch" />
<Button
Command="{Binding ShowFolderBrowserDialogCommand}"
Grid.Column="1"
Height="36"
HorizontalAlignment="Stretch"
IsEnabled="{Binding !IsPortableMode}">
<ui:SymbolIcon Symbol="OpenFolder" />
</Button>
</Grid>
<TextBlock
Text="{x:Static lang:Resources.Label_DataDirectoryExplanation}"
TextWrapping="Wrap"
Foreground="LightGray"
FontSize="12"
Margin="0,8,0,0" />
<TextBlock
Text="{x:Static lang:Resources.Label_FatWarning}"
TextWrapping="Wrap"
Foreground="Yellow"
IsVisible="{Binding ShowFatWarning}"
FontSize="14"
Margin="0,8,0,0" />
<CheckBox
Content="{x:Static lang:Resources.Label_PortableMode}"
IsChecked="{Binding IsPortableMode, Mode=TwoWay}"
Margin="0,32,0,0" />
<ui:InfoBar
IsClosable="False"
IsOpen="True"
FontSize="13"
Margin="0,8,0,0"
Padding="16"
Title="{x:Static lang:Resources.Label_PortableModeExplanation}" />
</StackPanel>
<!-- Indicator of existing or new data directory -->
<StackPanel
Grid.Row="1"
HorizontalAlignment="Center"
Margin="8,0,8,8"
Orientation="Horizontal"
IsVisible="{Binding IsStatusBadgeVisible}">
<controls:RefreshBadge DataContext="{Binding ValidatorRefreshBadge}" />
<TextBlock
FontSize="14"
Text="{Binding DirectoryStatusText}"
VerticalAlignment="Center" />
</StackPanel>
<Button
Content="{x:Static lang:Resources.Action_Continue}"
IsDefault="True"
Command="{Binding OnPrimaryButtonClick}"
FontSize="16"
Grid.Row="2"
HorizontalAlignment="Center"
IsEnabled="{Binding IsDirectoryValid}"
Padding="16,8" />
</Grid>
</controls:UserControlBase>