How to block an Pivot?

Asked

Viewed 59 times

2

On Windows Phone, we have the Pivot structure, which has the Pivotitens, which are tabs (screens) on which the user just navigates by sliding his finger left or right.

I’m making an app and following the design of Windows 10, with hamburger menu, I arrived on a screen on which should have a pivot, but I do not want the action of sliding to navigate between the pivots, because my menu hambúrger is open with sliding to the right. I want to know if there is a way to block the Pivot slide action, and leave only Click in your titles?

My code from the Pivot:

    <Grid Name="piv01" Margin="0,-50,0,0" Width="480" Height="645" Grid.Row="1">
        <CheckBox x:Name="online" Content="Desejo fazer o cadastro online." Checked="online_Checked" Unchecked="online_Unchecked" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,10,0,0"/>
        <TextBlock x:Name="descricao" Foreground="{StaticResource PhoneAccentBrush}" HorizontalAlignment="Center" TextWrapping="Wrap" Text="Para isso será necessário enviar um e-mail com seus dados para realizarmos o cadastro. Seus dados NÃO serão usados para outro propósito." VerticalAlignment="Top" Margin="10,85,20,0"/>
        <TextBox x:Name="nome" HorizontalAlignment="Right" InputScope="Default" KeyUp="nome_KeyUp" Tap="text_Tap" VerticalAlignment="Top" Width="285" Margin="0,160,10,0"/>
        <TextBox x:Name="cpf" HorizontalAlignment="Right"  InputScope="Number" KeyUp="nome_KeyUp" Tap="text_Tap" VerticalAlignment="Top" Width="285" Margin="0,220,10,0"/>
        <TextBox x:Name="email" HorizontalAlignment="Right" InputScope="Default" KeyUp="nome_KeyUp" Tap="text_Tap" VerticalAlignment="Top" Width="285" Margin="0,280,10,0"/>
        <toolkit:DatePicker x:Name="nasc" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,340,10,0" Width="285"/>
        <toolkit:AutoCompleteBox x:Name="ocupa"  HorizontalAlignment="Right" InputScope="Default" KeyUp="nome_KeyUp" Tap="text_Tap" VerticalAlignment="Top" Margin="0,400,10,0" Width="285">
        </toolkit:AutoCompleteBox>
        <Button x:Name="go" Content="Pronto" BorderBrush="{StaticResource PhoneAccentBrush}" HorizontalAlignment="Center" VerticalAlignment="Bottom" Click="go_Click" Margin="0,0,0,30"/>
        <TextBlock x:Name="tNome" Text="Nome Completo:" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Margin="10,190,0,0" FontSize="18"/>
        <TextBlock x:Name="tCPF" Text="CPF:" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Margin="10,250,0,0" FontSize="18"/>
        <TextBlock x:Name="tEmail" Text="Email:" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Margin="10,310,0,0" FontSize="18"/>
        <TextBlock x:Name="tNasc" Text="Data de Nascimento:" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Margin="10,370,0,0" FontSize="18"/>
        <TextBlock x:Name="tOcupa" Text="Ocupação:" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Margin="10,430,0,0" FontSize="18"/>
    </Grid>
</phone:PivotItem>

<phone:PivotItem AllowDrop="False">
    <phone:PivotItem.Header>
        <Image Source="/icoTiles.png"/>
    </phone:PivotItem.Header>

    <Grid Name="piv02" Margin="0,-50,0,0" Width="480" Height="645" Grid.Row="1">
        <TextBlock x:Name="completa" HorizontalAlignment="Center" TextWrapping="Wrap" Text="Você completou todas as etapas!" VerticalAlignment="Top" FontSize="24" Margin="0,80,0,0" Visibility="Collapsed"/>
        <Image x:Name="tNormal"  Tap="tNormal_Tap" HorizontalAlignment="Center" VerticalAlignment="Top" Source="/Assets/tNormal.jpg" Width="308" Height="147" Margin="0,180,0,0"/>
        <StackPanel Background="{StaticResource PhoneAccentBrush}"  HorizontalAlignment="Center" VerticalAlignment="Top"  Width="308" Height="147" Margin="0,360,0,0">
            <Image x:Name="tTrans" Tap="tTrans_Tap" HorizontalAlignment="Center" VerticalAlignment="Top" Source="/Assets/tTrans.png" Width="308" Height="147" Margin="0,0,0,0"/>
        </StackPanel>

        <TextBlock x:Name="isPhoto" Foreground="{StaticResource PhoneAccentBrush}" HorizontalAlignment="Center" TextWrapping="Wrap" Text="Você será levado a uma tela para selecionar sua imagem." VerticalAlignment="Top" Margin="0,65,0,0"/>
        <CheckBox x:Name="myPhoto" Content="Usar minha foto" Checked="myPhoto_Checked" Unchecked="myPhoto_Unchecked" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,10,0,0"/>
        <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Selecione a tile desejada:" VerticalAlignment="Top" FontSize="24" Margin="0,140,0,0"/>

    </Grid>
</phone:PivotItem>

1 answer

0

I didn’t get to test, but I found something that should be what you’re looking for in Stack in English, using the Islocked property:

<phone:Pivot IsLocked="True">
    <phone:PivotItem Header="Foo">
        <TextBox />
    </phone:PivotItem>
    <phone:PivotItem Content="Bar" Header="Bar" />
    <phone:PivotItem Content="Baz" Header="Baz" />
</phone:Pivot>

https://stackoverflow.com/a/14572243/1509954

Hugs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.