简体   繁体   中英

Windows Universal App (10) Hiding Bar

I'm creating universal application on windows 10, where I can create simple list.

And I have problem. I would like to create hiding top bar. When user swipe down, bar fade in to screen from top (something like status bar, when swipe it shows all content). Can you give my any tips where I should look for solution or gave me one? I use also GestureRecognizer but it does not work well with Scroll Viewer. Here is my User Control with bar:

 <Grid>
    <Grid Margin="0">
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Rectangle Fill="DarkOrange" Grid.Row="0" Margin="0"/>
        <TextBox Name="TextBox"  KeyDown="TextBox_KeyDown" Grid.Row="0" Margin="-2,5,2,13" Style="{StaticResource TextBoxStyle1}" Grid.RowSpan="2"/>

        <Polygon Grid.Row="1" Points="0,0, 40,25, 0,50" Fill="DarkOrange" Margin="172.584,-30.584,186.416,-7.25" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" >
            <Polygon.RenderTransform>
                <CompositeTransform Rotation="90"/>
            </Polygon.RenderTransform>
        </Polygon>
    </Grid>

Here is page where I would like to use this bar:

    <Grid Background="Black" Name="LayoutRoot"  PointerPressed="OnPointerPressed" PointerReleased="OnPointerReleased" Margin="0,-76,0,0" >
    <Grid.RowDefinitions>
        <RowDefinition Height="49*"/>
        <RowDefinition Height="309*"/>
    </Grid.RowDefinitions>
    <ScrollViewer Grid.Row="1" Name="scrollViewer" VerticalScrollMode="Enabled" ManipulationMode="All" ManipulationStarted="ScrollViewer_ManipulationStarted" DirectManipulationCompleted="ScrollViewer_DirectManipulationCompleted" DirectManipulationStarted="ScrollViewer_DirectManipulationStarted" IsEnabled="True" >
        <StackPanel Name="sc" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollMode="Enabled">
        </StackPanel>
    </ScrollViewer>

</Grid>

Finally, I stared looking for pull to refresh. And I found this! pull to refresh Sample

Very nice samples :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM