Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kikipoulet committed Oct 25, 2024
1 parent e19ea70 commit 71357ec
Showing 1 changed file with 34 additions and 31 deletions.
65 changes: 34 additions & 31 deletions SukiUI/Controls/BusyArea.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,8 @@
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Styles>
<Style Selector="suki|BusyArea">
<Setter Property="Template">
<ControlTemplate>
<Panel>
<ContentControl Content="{TemplateBinding Content}" />
<DockPanel Name="LoadingBusyArea"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LastChildFill="True">
<TextBlock Margin="10"
DockPanel.Dock="Bottom"
FontWeight="{DynamicResource DefaultDemiBold}"
IsVisible="{TemplateBinding BusyText,
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Text="{TemplateBinding BusyText}" />

<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
IsHitTestVisible="False" Content="{TemplateBinding IsBusy, Converter={x:Static converters:ProgressToContentCOnverter.Instance}}"></ContentPresenter>


</DockPanel>
</Panel>
</ControlTemplate>
</Setter>
</Style>



<Style Selector="suki|BusyArea DockPanel#LoadingBusyArea">
<Setter Property="Transitions">
<Transitions>
Expand All @@ -44,11 +19,11 @@
</Setter>
</Style>

<Style Selector="suki|BusyArea[IsBusy=True] DockPanel#LoadingBusyArea">
<Style Selector="suki|BusyArea[IsBusy=True] /template/ DockPanel#LoadingBusyArea">
<Setter Property="Opacity" Value="1" />
</Style>

<Style Selector="suki|BusyArea[IsBusy=False] DockPanel#LoadingBusyArea">
<Style Selector="suki|BusyArea[IsBusy=False] /template/ DockPanel#LoadingBusyArea">
<Setter Property="Opacity" Value="0" />
</Style>

Expand All @@ -60,13 +35,41 @@
</Setter>
</Style>

<Style Selector="suki|BusyArea[IsBusy=True] ContentControl">
<Style Selector="suki|BusyArea[IsBusy=True] /template/ ContentControl#BusyContent">
<Setter Property="Opacity" Value="0.1" />
</Style>

<Style Selector="suki|BusyArea[IsBusy=False] ContentControl">
<Style Selector="suki|BusyArea[IsBusy=False] /template/ ContentControl#BusyContent">
<Setter Property="Opacity" Value="1" />
</Style>


<Style Selector="suki|BusyArea">
<Setter Property="Template">
<ControlTemplate>
<Panel>
<ContentControl Name="BusyContent" Content="{TemplateBinding Content}" />
<DockPanel Name="LoadingBusyArea"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LastChildFill="True">
<TextBlock Margin="3"
DockPanel.Dock="Bottom"
FontWeight="{DynamicResource DefaultDemiBold}"
IsVisible="{TemplateBinding BusyText,
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Text="{TemplateBinding BusyText}" />

<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
IsHitTestVisible="False" Content="{TemplateBinding IsBusy, Converter={x:Static converters:ProgressToContentCOnverter.Instance}}"></ContentPresenter>


</DockPanel>
</Panel>
</ControlTemplate>
</Setter>
</Style>

</UserControl.Styles>
</UserControl>

0 comments on commit 71357ec

Please sign in to comment.