Skip to content

Commit

Permalink
Add the .disable-content-cover-animations class
Browse files Browse the repository at this point in the history
  • Loading branch information
SKProCH committed Jun 22, 2024
1 parent eed09f9 commit 72b470d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions DialogHost.Avalonia/DialogHost.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@
</ControlTemplate>
</Setter>

<Style Selector="^:not(.disable-content-cover-animations) /template/ Rectangle#PART_ContentCover">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Property="Opacity" Easing="LinearEasing" Duration="0.3" />
</Transitions>
</Setter>
</Style>

<Style Selector="^[IsOpen=True] /template/ Rectangle#PART_ContentCover">
<Setter Property="IsHitTestVisible" Value="True" />
<Setter Property="Opacity" Value="0.56" />
Expand Down
3 changes: 2 additions & 1 deletion DialogHost.Demo/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
MinHeight="200" MinWidth="200"
BorderThickness="1" BorderBrush="Black">
<dialogHostAvalonia:DialogHost Identifier="NoAnimationDialogHost"
DisableOpeningAnimation="True">
DisableOpeningAnimation="True"
Classes="disable-content-cover-animations">
<Button HorizontalAlignment="Center" VerticalAlignment="Center"
Click="OpenNoAnimationDialog">
Open
Expand Down

0 comments on commit 72b470d

Please sign in to comment.