Skip to content

Commit

Permalink
update community toolkit to version 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Nov 15, 2024
1 parent 5a22eeb commit 2e589a4
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 148 deletions.
2 changes: 0 additions & 2 deletions src/Starward/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />

<ResourceDictionary Source="Themes/CachedImageStyle.xaml" />

<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
Expand Down
8 changes: 4 additions & 4 deletions src/Starward/Controls/CachedImage.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using CommunityToolkit.WinUI.UI.Controls;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
using Scighost.WinUI.ImageEx;
using Starward.Services.Cache;
using System;
using System.Collections.Concurrent;
Expand All @@ -14,7 +14,7 @@

namespace Starward.Controls;

public sealed class CachedImage : ImageEx
public sealed partial class CachedImage : ImageEx
{


Expand All @@ -40,7 +40,7 @@ public bool IsThumbnail



protected override async Task<ImageSource> ProvideCachedResourceAsync(Uri imageUri, CancellationToken token)
protected override async Task<ImageSource?> ProvideCachedResourceAsync(Uri imageUri, CancellationToken token)
{
try
{
Expand Down
2 changes: 0 additions & 2 deletions src/Starward/Controls/GachaStatsCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@
Background="{x:Bind Converter={StaticResource GachaPityProgressBackgroundBrushConverter}}" />
<sc:CachedImage Width="28"
Height="28"
IsCacheEnabled="True"
Source="{x:Bind Icon}" />
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
Expand Down Expand Up @@ -235,7 +234,6 @@
</Grid.ColumnDefinitions>
<sc:CachedImage Width="28"
Height="28"
IsCacheEnabled="True"
Source="{x:Bind Icon}" />
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
Expand Down
1 change: 0 additions & 1 deletion src/Starward/Controls/GameBannerAndPost.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
sh:PointerCursor.CursorShape="Hand"
IsCacheEnabled="True"
IsRightTapEnabled="False"
Source="{x:Bind Image.Url}"
Stretch="UniformToFill"
Expand Down
2 changes: 0 additions & 2 deletions src/Starward/Controls/ZZZGachaStatsCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@
Background="{x:Bind Converter={StaticResource GachaPityProgressBackgroundBrushConverter}}" />
<sc:CachedImage Width="28"
Height="28"
IsCacheEnabled="True"
Source="{x:Bind Icon}" />
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
Expand Down Expand Up @@ -235,7 +234,6 @@
</Grid.ColumnDefinitions>
<sc:CachedImage Width="28"
Height="28"
IsCacheEnabled="True"
Source="{x:Bind Icon}" />
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
Expand Down
2 changes: 1 addition & 1 deletion src/Starward/Pages/DownloadGamePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:local="using:Starward.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sc="using:Starward.Controls"
xmlns:ui="using:CommunityToolkit.WinUI.UI"
xmlns:ui="using:CommunityToolkit.WinUI"
x:DefaultBindMode="OneWay"
mc:Ignorable="d">

Expand Down
2 changes: 0 additions & 2 deletions src/Starward/Pages/GachaLogPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@
<sc:CachedImage Height="80"
VerticalAlignment="Top"
CornerRadius="0,0,16,0"
IsCacheEnabled="True"
Source="{x:Bind Icon}" />
<TextBlock Margin="0,0,0,1"
HorizontalAlignment="Center"
Expand Down Expand Up @@ -330,7 +329,6 @@
HorizontalAlignment="Center"
VerticalAlignment="Top"
CornerRadius="0,12,0,0"
IsCacheEnabled="True"
Source="{x:Bind Icon}"
Stretch="Uniform" />
<Border Height="16"
Expand Down
2 changes: 0 additions & 2 deletions src/Starward/Pages/HoyolabToolbox/ApocalypticShadowPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@
<sc:CachedImage Source="{x:Bind Rarity, Converter={StaticResource RarityToSRBgConverter}}" />
<sc:CachedImage VerticalAlignment="Top"
CornerRadius="0,12,0,0"
IsCacheEnabled="True"
Source="{x:Bind Icon}"
Stretch="UniformToFill" />
<Border Height="16"
Expand Down Expand Up @@ -432,7 +431,6 @@
<sc:CachedImage Source="{x:Bind Rarity, Converter={StaticResource RarityToSRBgConverter}}" />
<sc:CachedImage VerticalAlignment="Top"
CornerRadius="0,12,0,0"
IsCacheEnabled="True"
Source="{x:Bind Icon}"
Stretch="UniformToFill" />
<Border Height="16"
Expand Down
2 changes: 0 additions & 2 deletions src/Starward/Pages/HoyolabToolbox/ForgottenHallPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@
<sc:CachedImage Source="{x:Bind Rarity, Converter={StaticResource RarityToSRBgConverter}}" />
<sc:CachedImage VerticalAlignment="Top"
CornerRadius="0,12,0,0"
IsCacheEnabled="True"
Source="{x:Bind Icon}"
Stretch="UniformToFill" />
<Border Height="16"
Expand Down Expand Up @@ -324,7 +323,6 @@
<sc:CachedImage Source="{x:Bind Rarity, Converter={StaticResource RarityToSRBgConverter}}" />
<sc:CachedImage VerticalAlignment="Top"
CornerRadius="0,12,0,0"
IsCacheEnabled="True"
Source="{x:Bind Icon}"
Stretch="UniformToFill" />
<Border Height="16"
Expand Down
3 changes: 0 additions & 3 deletions src/Starward/Pages/HoyolabToolbox/HoyolabToolboxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@
sh:PointerCursor.CursorShape="Hand"
Background="Transparent"
CornerRadius="100"
IsCacheEnabled="True"
Source="{x:Bind AvatarUrl}" />
<sc:CachedImage Name="Image_Pendant"
IsCacheEnabled="True"
IsHitTestVisible="False"
Source="{x:Bind CurrentUser.Pendant, FallbackValue={x:Null}}"
Visibility="Visible" />
Expand All @@ -76,7 +74,6 @@
sh:PointerCursor.CursorShape="Hand"
Background="Transparent"
CornerRadius="100"
IsCacheEnabled="True"
Source="{x:Bind AvatarUrl}" />
</Border>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,9 @@
<ItemsRepeater.ItemTemplate>
<DataTemplate x:DataType="scggi:ImaginariumTheaterAvatar">
<Grid Width="80" Height="97">
<sc:CachedImage IsCacheEnabled="True" Source="{x:Bind Rarity, Converter={StaticResource RarityToGIBgConverter}}" />
<sc:CachedImage Source="{x:Bind Rarity, Converter={StaticResource RarityToGIBgConverter}}" />
<sc:CachedImage VerticalAlignment="Top"
CornerRadius="0,0,12,0"
IsCacheEnabled="True"
Source="{x:Bind Image}" />
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<sp:PageBase x:Class="Starward.Pages.HoyolabToolbox.InterKnotMonthlyReportPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:cc="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:lang="using:Starward.Language"
xmlns:local="using:Starward.Pages.HoyolabToolbox"
Expand Down
2 changes: 0 additions & 2 deletions src/Starward/Pages/HoyolabToolbox/PureFictionPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@
<sc:CachedImage Source="{x:Bind Rarity, Converter={StaticResource RarityToSRBgConverter}}" />
<sc:CachedImage VerticalAlignment="Top"
CornerRadius="0,12,0,0"
IsCacheEnabled="True"
Source="{x:Bind Icon}"
Stretch="UniformToFill" />
<Border Height="16"
Expand Down Expand Up @@ -347,7 +346,6 @@
<sc:CachedImage Source="{x:Bind Rarity, Converter={StaticResource RarityToSRBgConverter}}" />
<sc:CachedImage VerticalAlignment="Top"
CornerRadius="0,12,0,0"
IsCacheEnabled="True"
Source="{x:Bind Icon}"
Stretch="UniformToFill" />
<Border Height="16"
Expand Down
7 changes: 1 addition & 6 deletions src/Starward/Pages/HoyolabToolbox/SimulatedUniversePage.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<sp:PageBase x:Class="Starward.Pages.HoyolabToolbox.SimulatedUniversePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:cc="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:lang="using:Starward.Language"
xmlns:local="using:Starward.Pages.HoyolabToolbox"
Expand Down Expand Up @@ -218,7 +218,6 @@
<StackPanel Orientation="Horizontal">
<sc:CachedImage Width="48"
Height="48"
IsCacheEnabled="True"
Source="{x:Bind Progress, Converter={StaticResource SimulatedUniverseWorldIconConverter}}" />
<TextBlock Margin="16,0,0,0"
VerticalAlignment="Center"
Expand Down Expand Up @@ -265,7 +264,6 @@
<sc:CachedImage Source="{x:Bind Rarity, Converter={StaticResource RarityToSRBgConverter}}" />
<sc:CachedImage VerticalAlignment="Top"
CornerRadius="0,12,0,0"
IsCacheEnabled="True"
Source="{x:Bind Icon}"
Stretch="UniformToFill" />
<Border Height="16"
Expand Down Expand Up @@ -334,7 +332,6 @@
Height="32"
Background="{ThemeResource ControlOnImageFillColorDefaultBrush}"
CornerRadius="16"
IsCacheEnabled="True"
Source="{x:Bind Icon}" />
</DataTemplate>
</ItemsRepeater.ItemTemplate>
Expand All @@ -359,7 +356,6 @@
<sc:CachedImage Width="24"
Height="24"
HorizontalAlignment="Left"
IsCacheEnabled="True"
Source="{x:Bind BuffType.Id, Converter={StaticResource SimulatedUniverseBuffIconConverter}}" />
<TextBlock Grid.Column="1"
Margin="32,0,0,0"
Expand Down Expand Up @@ -413,7 +409,6 @@
Height="32"
Background="{ThemeResource ControlOnImageFillColorDefaultBrush}"
CornerRadius="16"
IsCacheEnabled="True"
Source="{x:Bind Icon}"
ToolTipService.ToolTip="{x:Bind Name}" />
</DataTemplate>
Expand Down
Loading

0 comments on commit 2e589a4

Please sign in to comment.