CommunityToolkit/WindowsCommunityToolkit

WrapLayout doesn't respond to dynamic visibility

Open

#3875 aperta il 22 mar 2021

Vedi su GitHub
 (2 commenti) (0 reazioni) (1 assegnatario)C# (1403 fork)batch import
bug :bug:controls :control_knobs:help wanted

Metriche repository

Star
 (5708 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Describe the bug

Related to investigation around #3695. Think it's a different issue as I know we updated WrapPanel logic for 7.0, but I don't think we touched WrapLayout. This probably wasn't supported initially for ItemsRepeater?

Steps to Reproduce

  • Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)

Steps to reproduce the behavior:

  1. Go to sample app WrapLayout sample
  2. Modify DataTemplate:
    <DataTemplate x:Key="WrapTemplate">
      <Border Width="{Binding Width}" Height="50" Visibility="{Binding IsChecked,ElementName=MyCheck}">
        <Border.Background>
          <SolidColorBrush Color="{Binding Color}"/>
        </Border.Background>
        <CheckBox x:Name="MyCheck" Content="{Binding Index}" FontSize="20" IsChecked="True"/>
      </Border>
    </DataTemplate>
  1. Start checking boxes...

Expected behavior

Left over spacing collapses, also scrolling and re-constituting proper layout should work. Think there's a few issues here.

Screenshots

image

FYI @skendrot

Guida contributor