CommunityToolkit/WindowsCommunityToolkit

Expander Animation isn't smooth when bottom aligned

Open

#3.404 geöffnet am 30. Juli 2020

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C# (1.403 Forks)batch import
animations :izakaya_lantern:bug :bug:controls :control_knobs:good first issuehelp wanted

Repository-Metriken

Stars
 (5.708 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Describe the bug

The Expander doesn't animate nicely in certain layout scenarios.

Steps to Reproduce

<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

  <Page.Resources>
    <SolidColorBrush Color="{ThemeResource SystemChromeLowColor}" x:Key="SystemControlForegroundChromeLowBrush"/>
  </Page.Resources>

  <Grid>
        <controls:Expander x:Name="Expander" 
                           VerticalAlignment="Bottom"
                           Header="This is the header - expander 2"
                           HorizontalContentAlignment="Stretch"
                           IsExpanded="True">
          <Grid Height="256"
                Background="{ThemeResource SystemControlBackgroundBaseHighBrush}">
            <TextBlock HorizontalAlignment="Center"
                       TextWrapping="Wrap"
                       Text="This is the expanded content without a content overlay"
                       VerticalAlignment="Center"
                       Foreground="{ThemeResource SystemControlForegroundChromeLowBrush}" />
          </Grid>
        </controls:Expander>
  </Grid>
</Page>
  1. Use XAML above in sample app (Expander)
  2. Click on the Expander to collapse
  3. Note how that it 'jumps' to the bottom after the animation has played.

Expected behavior

Expander's height should animate along with content collapsing so it smoothly collapses?

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

Store App

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041)
  • Insider Build (build number: )

Contributor Guide