|
|
|
<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:viewModels="clr-namespace:StabilityMatrix.Avalonia.ViewModels"
|
|
|
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
|
|
|
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core"
|
|
|
|
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
|
|
|
|
xmlns:designData="clr-namespace:StabilityMatrix.Avalonia.DesignData"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
|
x:DataType="viewModels:PackageManagerViewModel"
|
|
|
|
x:CompileBindings="True"
|
|
|
|
d:DataContext="{x:Static designData:DesignData.PackageManagerViewModel}"
|
|
|
|
x:Class="StabilityMatrix.Avalonia.Views.PackageManagerPage">
|
|
|
|
|
|
|
|
<Grid Margin="16" RowDefinitions="Auto,*">
|
|
|
|
<StackPanel
|
|
|
|
Grid.Row="0"
|
|
|
|
Orientation="Vertical"
|
|
|
|
IsVisible="{Binding ProgressBarVisibility, FallbackValue=True}">
|
|
|
|
|
|
|
|
<ProgressBar
|
|
|
|
IsIndeterminate="{Binding IsIndeterminate, FallbackValue=False}"
|
|
|
|
Maximum="100"
|
|
|
|
Value="{Binding ProgressValue, FallbackValue=10}"
|
|
|
|
Width="500" />
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
Padding="8"
|
|
|
|
Text="{Binding ProgressText, FallbackValue=Installing...}" />
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<StackPanel
|
|
|
|
Grid.Row="1"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
Margin="16"
|
|
|
|
Orientation="Horizontal">
|
|
|
|
<StackPanel Orientation="Vertical">
|
|
|
|
<Button
|
|
|
|
Command="{Binding ShowInstallDialogCommand}"
|
|
|
|
Height="40"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Margin="0,0,0,16"
|
|
|
|
Classes="success"
|
|
|
|
VerticalContentAlignment="Center">
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<ui:SymbolIcon Symbol="Add" />
|
|
|
|
<Label
|
|
|
|
Content="Add Package"
|
|
|
|
Margin="8,0,0,0"
|
|
|
|
VerticalContentAlignment="Center" />
|
|
|
|
</StackPanel>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<ListBox
|
|
|
|
ItemsSource="{Binding Packages}"
|
|
|
|
SelectedItem="{Binding SelectedPackage, Mode=TwoWay}"
|
|
|
|
IsVisible="{Binding !!Packages.Count}">
|
|
|
|
|
|
|
|
<ListBox.Template>
|
|
|
|
<ControlTemplate>
|
|
|
|
<Border
|
|
|
|
BorderBrush="#FFCCCCCC"
|
|
|
|
BorderThickness="1"
|
|
|
|
CornerRadius="5">
|
|
|
|
<ItemsPresenter />
|
|
|
|
</Border>
|
|
|
|
</ControlTemplate>
|
|
|
|
</ListBox.Template>
|
|
|
|
|
|
|
|
<ListBox.ItemTemplate>
|
|
|
|
<DataTemplate DataType="{x:Type models:InstalledPackage}">
|
|
|
|
<StackPanel Margin="8" VerticalAlignment="Top">
|
|
|
|
<TextBlock Margin="0,5,0,5" Text="{Binding DisplayName}" />
|
|
|
|
<TextBlock Margin="0,0,0,5" Text="{Binding DisplayVersion}" />
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListBox.ItemTemplate>
|
|
|
|
</ListBox>
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<StackPanel Margin="32,0,0,0" Orientation="Vertical">
|
|
|
|
<TextBlock
|
|
|
|
FontSize="24"
|
|
|
|
FontWeight="Bold"
|
|
|
|
Text="{Binding SelectedPackage.DisplayName,
|
|
|
|
FallbackValue='Click "Add Package" to install a package'}" />
|
|
|
|
<TextBlock FontSize="12" Margin="0,5,0,5">
|
|
|
|
<Run Text="{Binding SelectedPackage.PackageName, FallbackValue=''}" />
|
|
|
|
<Run Text="{Binding SelectedPackage.DisplayVersion, FallbackValue=''}" />
|
|
|
|
</TextBlock>
|
|
|
|
<TextBlock
|
|
|
|
FontSize="12"
|
|
|
|
Margin="0,5,0,5"
|
|
|
|
Text="{Binding SelectedPackage.FullPath, FallbackValue=''}" />
|
|
|
|
|
|
|
|
<UniformGrid
|
|
|
|
Margin="0,16,0,0"
|
|
|
|
Columns="2"
|
|
|
|
MinHeight="48"
|
|
|
|
MinWidth="208"
|
|
|
|
HorizontalAlignment="Left">
|
|
|
|
<Button
|
|
|
|
Command="{Binding Launch}"
|
|
|
|
Content="{Binding InstallButtonText}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
Margin="0,0,8,0"
|
|
|
|
IsEnabled="{Binding InstallButtonEnabled}"
|
|
|
|
IsVisible="{Binding InstallButtonEnabled}"
|
|
|
|
Classes="success"/>
|
|
|
|
<Button
|
|
|
|
Command="{Binding Uninstall}"
|
|
|
|
Content="Uninstall"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
Margin="8,0,0,0"
|
|
|
|
Classes="danger"
|
|
|
|
IsEnabled="{Binding !IsUninstalling}"
|
|
|
|
IsVisible="{Binding InstallButtonEnabled}"/>
|
|
|
|
</UniformGrid>
|
|
|
|
|
|
|
|
<StackPanel Orientation="Horizontal" IsVisible="{Binding IsUninstalling}">
|
|
|
|
<controls:ProgressRing Height="24" Width="24"
|
|
|
|
Margin="8, 16, 8, 8"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
BorderThickness="4"
|
|
|
|
IsIndeterminate="True" HorizontalAlignment="Left" />
|
|
|
|
<TextBlock Text="Uninstalling..." VerticalAlignment="Center" Margin="0,8,0,0" />
|
|
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</controls:UserControlBase>
|