Merge pull request 'upgrade/avalonia-11' (#26) from waffle.lord/SPT-AKI-Installer:upgrade/avalonia-11 into master

Reviewed-on: CWX/SPT-AKI-Installer#26
This commit is contained in:
IsWaffle 2023-08-21 23:14:14 +00:00
commit ecdca6ba8b
11 changed files with 51 additions and 50 deletions

View File

@ -1,13 +1,14 @@
<Application xmlns="https://github.com/avaloniaui" <Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SPTInstaller" xmlns:local="using:SPTInstaller"
x:Class="SPTInstaller.App"> x:Class="SPTInstaller.App"
RequestedThemeVariant="Light">
<Application.DataTemplates> <Application.DataTemplates>
<local:ViewLocator/> <local:ViewLocator/>
</Application.DataTemplates> </Application.DataTemplates>
<Application.Styles> <Application.Styles>
<FluentTheme Mode="Light"/> <FluentTheme />
</Application.Styles> </Application.Styles>
<Application.Resources> <Application.Resources>

View File

@ -14,7 +14,7 @@
<Setter Property="Stroke" Value="Gray"/> <Setter Property="Stroke" Value="Gray"/>
<Setter Property="IsVisible" Value="{Binding IsPending, RelativeSource={RelativeSource AncestorType=UserControl}}"/> <Setter Property="IsVisible" Value="{Binding IsPending, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
<Style.Animations> <Style.Animations>
<Animation Duration="0:0:1" RepeatCount="infinite"> <Animation Duration="0:0:1" IterationCount="Infinite">
<KeyFrame Cue="0%"> <KeyFrame Cue="0%">
<Setter Property="RotateTransform.Angle" Value="0"/> <Setter Property="RotateTransform.Angle" Value="0"/>
</KeyFrame> </KeyFrame>

View File

@ -14,7 +14,7 @@
<Setter Property="Stroke" Value="Gray"/> <Setter Property="Stroke" Value="Gray"/>
<Setter Property="IsVisible" Value="{Binding IsPending, RelativeSource={RelativeSource AncestorType=UserControl}}"/> <Setter Property="IsVisible" Value="{Binding IsPending, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
<Style.Animations> <Style.Animations>
<Animation Duration="0:0:1" RepeatCount="infinite"> <Animation Duration="0:0:1" IterationCount="Infinite">
<KeyFrame Cue="0%"> <KeyFrame Cue="0%">
<Setter Property="RotateTransform.Angle" Value="0"/> <Setter Property="RotateTransform.Angle" Value="0"/>
</KeyFrame> </KeyFrame>

View File

@ -1,4 +1,4 @@
<UserControl xmlns="https://github.com/avaloniaui" <UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -19,7 +19,7 @@
<Setter Property="Stroke" Value="{Binding RunningColor, RelativeSource={RelativeSource AncestorType=UserControl}}"/> <Setter Property="Stroke" Value="{Binding RunningColor, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
<Setter Property="Margin" Value="7 3"/> <Setter Property="Margin" Value="7 3"/>
<Style.Animations> <Style.Animations>
<Animation Duration="0:0:1" PlaybackDirection="Alternate" RepeatCount="INFINITE"> <Animation Duration="0:0:1" PlaybackDirection="Alternate" IterationCount="Infinite">
<KeyFrame Cue="0%"> <KeyFrame Cue="0%">
<Setter Property="ScaleTransform.ScaleX" Value="1"/> <Setter Property="ScaleTransform.ScaleX" Value="1"/>
<Setter Property="ScaleTransform.ScaleY" Value="1"/> <Setter Property="ScaleTransform.ScaleY" Value="1"/>

View File

@ -1,4 +1,4 @@
<UserControl xmlns="https://github.com/avaloniaui" <UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -11,24 +11,21 @@
<UserControl.Resources> <UserControl.Resources>
<convt:InvertedProgressConverter x:Key="invtProgressConvt"/> <convt:InvertedProgressConverter x:Key="invtProgressConvt"/>
</UserControl.Resources> </UserControl.Resources>
<ItemsControl Name="itemsControl" Items="{Binding Tasks, RelativeSource={RelativeSource AncestorType=UserControl}}"
Padding="5"> <Grid>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<cc:DistributedSpacePanel>
<ProgressBar Orientation="Vertical" <ProgressBar Orientation="Vertical"
Value="{Binding TaskProgress, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource ResourceKey=invtProgressConvt}}" Value="{Binding TaskProgress, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource ResourceKey=invtProgressConvt}}"
Background="{Binding CompletedColor, RelativeSource={RelativeSource AncestorType=UserControl}}" Background="{Binding CompletedColor, RelativeSource={RelativeSource AncestorType=UserControl}}"
Foreground="{Binding PendingColor, RelativeSource={RelativeSource AncestorType=UserControl}}" Foreground="{Binding PendingColor, RelativeSource={RelativeSource AncestorType=UserControl}}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Margin="20 3" Margin="25 20"
MinHeight="0"
Grid.RowSpan="6"
bh:SpanBehavior.Span="True"
/> />
</cc:DistributedSpacePanel> <ItemsControl Name="itemsControl" ItemsSource="{Binding Tasks, RelativeSource={RelativeSource AncestorType=UserControl}}"
Padding="5">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<cc:DistributedSpacePanel/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
@ -44,4 +41,5 @@
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</Grid>
</UserControl> </UserControl>

View File

@ -1,4 +1,4 @@
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Threading; using Avalonia.Threading;

View File

@ -9,8 +9,8 @@
<PackageIcon>icon.ico</PackageIcon> <PackageIcon>icon.ico</PackageIcon>
<ApplicationIcon>Assets\icon.ico</ApplicationIcon> <ApplicationIcon>Assets\icon.ico</ApplicationIcon>
<Configurations>Debug;Release;TEST</Configurations> <Configurations>Debug;Release;TEST</Configurations>
<AssemblyVersion>2.8</AssemblyVersion> <AssemblyVersion>2.9</AssemblyVersion>
<FileVersion>2.8</FileVersion> <FileVersion>2.9</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -30,16 +30,17 @@
<ItemGroup> <ItemGroup>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Include="Avalonia" Version="0.10.19" /> <PackageReference Include="Avalonia" Version="11.0.4" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.19" /> <PackageReference Include="Avalonia.Desktop" Version="11.0.4" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.19" /> <PackageReference Include="Avalonia.Diagnostics" Version="11.0.4" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.19" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.4" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.4" />
<PackageReference Include="FubarCoder.RestSharp.Portable.HttpClient" Version="4.0.8" /> <PackageReference Include="FubarCoder.RestSharp.Portable.HttpClient" Version="4.0.8" />
<PackageReference Include="MegaApiClient" Version="1.10.3" /> <PackageReference Include="MegaApiClient" Version="1.10.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="SharpCompress" Version="0.33.0" /> <PackageReference Include="SharpCompress" Version="0.33.0" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.6.1" /> <PackageReference Include="System.Reactive" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,4 +1,4 @@
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Templates; using Avalonia.Controls.Templates;
using SPTInstaller.ViewModels; using SPTInstaller.ViewModels;
@ -6,7 +6,7 @@ namespace SPTInstaller;
public class ViewLocator : IDataTemplate public class ViewLocator : IDataTemplate
{ {
public IControl Build(object data) public Control Build(object data)
{ {
var name = data.GetType().FullName!.Replace("ViewModel", "View"); var name = data.GetType().FullName!.Replace("ViewModel", "View");
var type = Type.GetType(name); var type = Type.GetType(name);

View File

@ -30,7 +30,7 @@
/> />
<ScrollViewer Grid.Row="4" Grid.ColumnSpan="5"> <ScrollViewer Grid.Row="4" Grid.ColumnSpan="5">
<ItemsControl Items="{Binding PreChecks}"> <ItemsControl ItemsSource="{Binding PreChecks}">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel HorizontalAlignment="Stretch" Margin="10 0"/> <StackPanel HorizontalAlignment="Stretch" Margin="10 0"/>

View File

@ -15,6 +15,7 @@
ExtendClientAreaChromeHints="NoChrome" ExtendClientAreaChromeHints="NoChrome"
ExtendClientAreaTitleBarHeightHint="-1" ExtendClientAreaTitleBarHeightHint="-1"
Background="{StaticResource AKI_Background_Light}" Background="{StaticResource AKI_Background_Light}"
MinWidth="800" MinHeight="400"
> >
<Window.Styles> <Window.Styles>

View File

@ -27,7 +27,7 @@
Command="{Binding StartInstallCommand}" Command="{Binding StartInstallCommand}"
/> />
<ItemsControl Items="{Binding PreChecks}" Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="4" HorizontalAlignment="Center"> <ItemsControl ItemsSource="{Binding PreChecks}" Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="4" HorizontalAlignment="Center">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<WrapPanel/> <WrapPanel/>