SPT-AKI-Installer/SPTInstaller/CustomControls/ProgressableTaskList.axaml

43 lines
2.6 KiB
Plaintext
Raw Normal View History

2023-08-21 18:57:48 -04:00
<UserControl xmlns="https://github.com/avaloniaui"
2023-05-11 23:11:39 -04:00
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"
2024-05-01 10:31:55 -04:00
xmlns:cc="using:SPTInstaller.CustomControls"
xmlns:bh="using:SPTInstaller.Behaviors"
xmlns:convt="using:SPTInstaller.Converters"
2023-05-11 23:11:39 -04:00
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
2024-05-01 10:31:55 -04:00
x:Class="SPTInstaller.CustomControls.ProgressableTaskList">
<UserControl.Resources>
<convt:InvertedProgressConverter x:Key="invtProgressConvt" />
</UserControl.Resources>
2023-08-21 18:57:48 -04:00
<Grid>
<ProgressBar Orientation="Vertical"
Value="{Binding TaskProgress, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource ResourceKey=invtProgressConvt}}"
Background="{Binding CompletedColor, RelativeSource={RelativeSource AncestorType=UserControl}}"
Foreground="{Binding PendingColor, RelativeSource={RelativeSource AncestorType=UserControl}}"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
2024-05-01 10:31:55 -04:00
Margin="25 20" />
<ItemsControl Name="itemsControl"
ItemsSource="{Binding Tasks, RelativeSource={RelativeSource AncestorType=UserControl}}"
Padding="5">
2023-08-21 18:57:48 -04:00
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
2024-05-01 10:31:55 -04:00
<cc:DistributedSpacePanel />
2023-08-21 18:57:48 -04:00
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<cc:ProgressableTaskItem TaskId="{Binding Id}"
TaskName="{Binding Name}"
IsRunning="{Binding IsRunning}"
IsCompleted="{Binding IsCompleted}"
PendingColor="{Binding PendingColor, RelativeSource={RelativeSource AncestorType=UserControl}}"
RunningColor="{Binding RunningColor, RelativeSource={RelativeSource AncestorType=UserControl}}"
2024-05-01 10:31:55 -04:00
CompletedColor="{Binding CompletedColor, RelativeSource={RelativeSource AncestorType=UserControl}}" />
2023-08-21 18:57:48 -04:00
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
2024-05-01 10:31:55 -04:00
</UserControl>