Windowscommunitytoolkit: ScrollHeader not work

Created on 9 Feb 2017  路  22Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

I run UWPCommunityToolkit app is work but when i build a app is not work?

bug controls

Most helpful comment

the scroll header behavior is only called on mode change and not on initial set in xaml.
in the sample app the mode is set with binding and the scroll header behavior is called.

All 22 comments

Please give more information as what you did and what happens, better with some source code.

ScrollHeader modes not work. it's like a normal Listview
This is my code:



TargetListViewBase="{x:Bind listView}">
MinHeight="250"
Background="Green"

                    <StackPanel HorizontalAlignment="Center"
                                VerticalAlignment="Center">
                        <TextBlock Margin="12"
                                   FontSize="48"
                                   FontWeight="Bold"
                                   Text="Scroll Header"
                                   TextAlignment="Center"
                                   TextWrapping="WrapWholeWords" />
                        <TextBlock Margin="12,0,12,12"
                                   VerticalAlignment="Center"

                                   Text="The scroll header supports quick return, sticky and fade behavior. If fade is enabled the header fades out while scrolling down. If quick return is enabled the header hides when the ListView is scrolled down and reappears immediately as soon as the ListView is scrolled up again. If sticky is enabled the header is displayed regardless of scrolling."
                                   TextAlignment="Center"
                                   TextWrapping="WrapWholeWords" />
                    </StackPanel>
                </Grid>
            </controls:ScrollHeader>
        </ListView.Header>
        <ListViewItem>aaaa</ListViewItem>
        <ListViewItem>aaaa</ListViewItem>
        <ListViewItem>aaaa</ListViewItem>
        <ListViewItem>aaaa</ListViewItem>
        <ListViewItem>aaaa</ListViewItem>
        <ListViewItem>aaaa</ListViewItem>
        <ListViewItem>aaaa</ListViewItem>
    </ListView>

Does it work on your computer if you use the Sample App?

both computer and phone

I updated version 1.3.1

sample app in the store fine

can you share your project?

the scroll header behavior is only called on mode change and not on initial set in xaml.
in the sample app the mode is set with binding and the scroll header behavior is called.

ping @pdehne :)

@DanielSchiermeier Ok thanks! it work 馃槃

How to use WrapPanel in this listview ?

933 fixes the initial issue and correctly initializes the ScrollHeader if no binding is used.

@iamstudentVN I dont think the WrapPanel is supported in UWP apps, right?

@pdehne the toolkit now has a wrap panel control

@pdehne maybe the property TargetListViewBase shoud be changed to ListViewBase so we can use the scroll header in ListView and in GridView

@DanielSchiermeier It is already :-)

        public static readonly DependencyProperty TargetListViewBaseProperty =
            DependencyProperty.Register(nameof(TargetListViewBase), typeof(ListViewBase), typeof(ScrollHeader), new PropertyMetadata(null));

WrapPanel does not inherit from ListViewBase. Therefore ScrollHeader can't be used with WrapPanel. It only works with controls that inherit from ListViewBase.

@pdehne yes the dependency property TargetListViewBaseProperty but not the property TargetListViewBase :)

public ListView TargetListViewBase { get { return (ListView)GetValue(TargetListViewBaseProperty); } set { SetValue(TargetListViewBaseProperty, value); } }

Oooh, right. Thanks for pointing that out. I'll fix that :-)

image
which way do this look like?

Ok, it worked 馃槃

Was this page helpful?
0 / 5 - 0 ratings