2023-08-24 22:28:37 -04:00
|
|
|
<UserControl 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:convt="using:SPTInstaller.Converters"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
2024-05-01 10:31:55 -04:00
|
|
|
x:Class="SPTInstaller.CustomControls.StatusSpinner">
|
2023-08-24 22:28:37 -04:00
|
|
|
|
|
|
|
<UserControl.Resources>
|
2024-05-01 10:31:55 -04:00
|
|
|
<convt:StatusSpinnerIsStateConverter x:Key="IsStateConverter" />
|
|
|
|
<convt:StatusSpinnerIsProcessingConverter x:Key="IsInProcessingStateConverter" />
|
2023-08-24 22:28:37 -04:00
|
|
|
</UserControl.Resources>
|
|
|
|
<UserControl.Styles>
|
|
|
|
<Style Selector="Arc.running">
|
2024-05-01 10:31:55 -04:00
|
|
|
<Setter Property="Stroke" Value="DodgerBlue" />
|
2023-08-24 22:28:37 -04:00
|
|
|
</Style>
|
|
|
|
|
|
|
|
<Style Selector="Path.ok">
|
2024-05-01 10:31:55 -04:00
|
|
|
<Setter Property="Data" Value="{StaticResource CircledCheck}" />
|
|
|
|
<Setter Property="Fill" Value="Green" />
|
2023-08-24 22:28:37 -04:00
|
|
|
</Style>
|
|
|
|
|
|
|
|
<Style Selector="Path.warning">
|
2024-05-01 10:31:55 -04:00
|
|
|
<Setter Property="Data" Value="{StaticResource CircledWarn}" />
|
|
|
|
<Setter Property="Fill" Value="Goldenrod" />
|
2023-08-24 22:28:37 -04:00
|
|
|
</Style>
|
2024-05-01 10:31:55 -04:00
|
|
|
|
2023-08-24 22:28:37 -04:00
|
|
|
<Style Selector="Path.error">
|
2024-05-01 10:31:55 -04:00
|
|
|
<Setter Property="Data" Value="{StaticResource CircledX}" />
|
|
|
|
<Setter Property="Fill" Value="Red" />
|
2023-08-24 22:28:37 -04:00
|
|
|
</Style>
|
|
|
|
|
|
|
|
<Style Selector="Arc">
|
2024-05-01 10:31:55 -04:00
|
|
|
<Setter Property="Stroke" Value="Gray" />
|
|
|
|
<Setter Property="IsVisible"
|
|
|
|
Value="{Binding State, RelativeSource={RelativeSource AncestorType=UserControl},
|
|
|
|
Converter={StaticResource ResourceKey=IsInProcessingStateConverter}}" />
|
2023-08-24 22:28:37 -04:00
|
|
|
<Style.Animations>
|
|
|
|
<Animation Duration="0:0:1" IterationCount="Infinite">
|
|
|
|
<KeyFrame Cue="0%">
|
2024-05-01 10:31:55 -04:00
|
|
|
<Setter Property="RotateTransform.Angle" Value="0" />
|
2023-08-24 22:28:37 -04:00
|
|
|
</KeyFrame>
|
|
|
|
<KeyFrame Cue="100%">
|
2024-05-01 10:31:55 -04:00
|
|
|
<Setter Property="RotateTransform.Angle" Value="360" />
|
2023-08-24 22:28:37 -04:00
|
|
|
</KeyFrame>
|
|
|
|
</Animation>
|
|
|
|
</Style.Animations>
|
|
|
|
</Style>
|
|
|
|
</UserControl.Styles>
|
2024-05-01 10:31:55 -04:00
|
|
|
|
2023-08-24 22:28:37 -04:00
|
|
|
<Grid>
|
|
|
|
<Canvas Margin="0 3 0 0" Height="20" Width="20"
|
2024-05-01 10:31:55 -04:00
|
|
|
IsVisible="{Binding State, RelativeSource={RelativeSource AncestorType=UserControl},
|
2023-08-24 22:28:37 -04:00
|
|
|
Converter={StaticResource ResourceKey=IsInProcessingStateConverter}, ConverterParameter=invert}">
|
2024-05-01 10:31:55 -04:00
|
|
|
<Ellipse Fill="White" Height="15" Width="15" Canvas.Top="3" Canvas.Left="3" />
|
2023-08-24 22:28:37 -04:00
|
|
|
<Path StrokeThickness="2"
|
|
|
|
Classes.ok="{Binding State, RelativeSource={RelativeSource AncestorType=UserControl},
|
|
|
|
Converter={StaticResource ResourceKey=IsStateConverter},
|
|
|
|
ConverterParameter=OK}"
|
|
|
|
Classes.warning="{Binding State, RelativeSource={RelativeSource AncestorType=UserControl},
|
|
|
|
Converter={StaticResource ResourceKey=IsStateConverter},
|
|
|
|
ConverterParameter=Warning}"
|
|
|
|
Classes.error="{Binding State, RelativeSource={RelativeSource AncestorType=UserControl},
|
|
|
|
Converter={StaticResource ResourceKey=IsStateConverter},
|
2024-05-01 10:31:55 -04:00
|
|
|
ConverterParameter=Error}" />
|
2023-08-24 22:28:37 -04:00
|
|
|
</Canvas>
|
|
|
|
|
|
|
|
<Arc StartAngle="280" SweepAngle="80" Margin="0 3 0 0" StrokeThickness="3"
|
|
|
|
Width="20" Height="20" VerticalAlignment="Top"
|
|
|
|
Classes.running="{Binding State, RelativeSource={RelativeSource AncestorType=UserControl},
|
|
|
|
Converter={StaticResource ResourceKey=IsStateConverter},
|
2024-05-01 10:31:55 -04:00
|
|
|
ConverterParameter=Running}" />
|
2023-08-24 22:28:37 -04:00
|
|
|
</Grid>
|
2024-05-01 10:31:55 -04:00
|
|
|
</UserControl>
|