Skip to content

Commit

Permalink
fix: Only remove ProgressRing for Windows WinUI3 platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
kazo0 committed Jun 3, 2022
1 parent 631e2f5 commit 1c5351f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/library/Uno.Material/MaterialResourcesV2.cs
Expand Up @@ -112,7 +112,8 @@ private IEnumerable<(string ResourceKey, string SharedKey, bool IsDefaultStyle)>
Add("MaterialOutlinedPasswordBoxStyle");
Add("MaterialOutlinedTextBoxStyle");
Add("MaterialProgressBarStyle", isImplicit: true);
#if !WinUI
//WinUI 3 currently does not support the DeterminateSource and IndeterminateSource properties on Windows
#if !WinUI_Desktop
Add("MaterialProgressRingStyle", isImplicit: true);
#endif
Add("MaterialRadioButtonStyle", isImplicit: true);
Expand Down
6 changes: 4 additions & 2 deletions src/library/Uno.Material/Styles/Controls/v2/ProgressRing.xaml
Expand Up @@ -3,6 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:lottie_win="using:Microsoft.Toolkit.Uwp.UI.Lottie"
xmlns:lottie_not_win="using:Microsoft.Toolkit.Uwp.UI.Lottie"
xmlns:IsNotWinUI3="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsTypeNotPresent(Microsoft.UI.Xaml.FrameworkElement)"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:not_win="http://uno.ui/not_win"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Expand All @@ -19,7 +20,8 @@
<lottie_not_win:LottieVisualSource x:Key="M3MaterialIndeterminateAnimation_Uno"
UriSource="embedded://Uno.Material/Uno.Material.Assets.MaterialIndeterminate.json" />

<Style x:Key="MaterialProgressRingStyle"
<!-- WinUI 3 currently does not support the DeterminateSource and IndeterminateSource properties on Windows -->
<IsNotWinUI3:Style x:Key="MaterialProgressRingStyle"
TargetType="muxc:ProgressRing">
<win:Setter Property="DeterminateSource"
Value="{StaticResource M3MaterialDeterminateAnimation_Win}" />
Expand All @@ -33,6 +35,6 @@
Value="{StaticResource PrimaryBrush}" />
<Setter Property="Background"
Value="{StaticResource PrimaryLowBrush}" />
</Style>
</IsNotWinUI3:Style>

</ResourceDictionary>

0 comments on commit 1c5351f

Please sign in to comment.