WP7 - show hide application panel

In many Windows Phone 7 applications, the application bar is hidden by default, and when you press and hold it on the screen, the application bar becomes visible. Since many of the WP7 applications have this behavior, I was wondering if there was built-in support for this behavior with the ApplicationBar and how should I use it?

+3
source share
2 answers

You can use the GestureService in the toolkit to detect the event Hold.

For instance.
If you had this xaml on the page:

<TextBlock TextWrapping="Wrap" Text="lorem ipsum ...">
    <toolkit:GestureService.GestureListener>
        <toolkit:GestureListener Hold="TapAndHold" />
    </toolkit:GestureService.GestureListener>
</TextBlock>

and for the event handler:

private void TapAndHold(object sender, GestureEventArgs e)
{
    this.ApplicationBar.IsVisible = !this.ApplicationBar.IsVisible;
}

and then holding everything where the ApplicationBar will be displayed on the text block.

, , . .

<Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <toolkit:GestureService.GestureListener>
        <toolkit:GestureListener Hold="TapAndHold" />
    </toolkit:GestureService.GestureListener>
+6

ApplicationBar IsVisible , / ApplicationBar. ApplicationBar , .

+1

Source: https://habr.com/ru/post/1785360/


All Articles