如何让SemanticZoom缩放到正确的区域

时间:2012-11-06 17:05:16

标签: semantic-zoom

我看到的所有SemanticZoom示例都涉及在缩放视图时链接到数据源,当您单击缩放视图时,它缩放到放大视图中的正确位置。

我的问题是我没有显示数据只是由几个包含文本框和文本块的网格组成的界面。

我已经让SemanticZoom在视觉上有效,但当我在缩小视图中选择一个类别时,它总是把我带到放大视图的开头。

我知道这样做是因为缩小视图中没有引用它告诉它去哪里但我不知道我必须添加什么才能工作。我的XAML时间很长:

 <SemanticZoom Grid.Row="1">
        <SemanticZoom.ZoomedInView>
    <GridView  IsRightTapEnabled="False" IsTapEnabled="False" IsHoldingEnabled="False" SelectionMode="None">


                    <!-- Length Input Area -->
        <Grid Margin="70,0,70,0" Background="#FFBFFFD9" Width="320" Height="545" IsDoubleTapEnabled="False" IsHoldingEnabled="False" IsRightTapEnabled="False">
               <Grid.ColumnDefinitions>
                    <ColumnDefinition Width ="*"/>
                    <ColumnDefinition Width ="*"/>
               </Grid.ColumnDefinitions>
               <Grid.RowDefinitions>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>

                </Grid.RowDefinitions>

                Various Text Boxes and Textblocks                   
            </Grid>

            <!-- Weight Input Area -->
                <Grid Margin="0,0,70,0" Background="#FFC7D6FF" Width="320" Height="545">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width ="*"/>
                    <ColumnDefinition Width ="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>

                </Grid.RowDefinitions>

                 Various Text Boxes and Textblocks                      </Grid>

            <!-- Speed Input Area -->
                <Grid Margin="0,0,70,0" Background="#FFF0B2BA" Width="320" Height="545">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width ="*"/>
                    <ColumnDefinition Width ="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>

                </Grid.RowDefinitions>

                 Various Text Boxes and Textblocks                    </Grid>

            <!-- Area Input Area -->
                <Grid Margin="0,0,70,0" Background="#FFFFFBB0" Width="320" Height="545">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width ="*"/>
                    <ColumnDefinition Width ="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>

                </Grid.RowDefinitions>

                Various Text Boxes and Textblocks                    </Grid>

            <!-- Volume Input Area -->
                <Grid Margin="0,0,70,0" Background="#FFFFD9A2" Width="320" Height="545">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width ="*"/>
                    <ColumnDefinition Width ="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>

                </Grid.RowDefinitions>

                 Various Text Boxes and Textblocks                    </Grid>

            <!-- Fuel Input Area -->
                <Grid Margin="0,0,70,0" Width="320"  Height="545" Background="#FFAA9C9B">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width ="*"/>
                    <ColumnDefinition Width ="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>

                </Grid.RowDefinitions>

                Various Text Boxes and Textblocks    
            </Grid>

            <!-- Pressure Input Area -->
                <Grid Margin="0,0,0,0" Width="320" Background="#FFB9F8FB" Height="545">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width ="*"/>
                    <ColumnDefinition Width ="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>

                </Grid.RowDefinitions>

                Various Text Boxes and Textblocks    
            </Grid>

    </GridView>

        </SemanticZoom.ZoomedInView>

        <SemanticZoom.ZoomedOutView>
             <GridView  Margin="100,0,0,0"  Height="300" IsRightTapEnabled="False" IsTapEnabled="False" IsHoldingEnabled="False" SelectionMode="None">

                    <!-- Length Input Area -->
                    <Grid Margin="0,0,0,0" Background="#FFBFFFD9" Width="150" Height="245" IsDoubleTapEnabled="False" IsHoldingEnabled="False" IsRightTapEnabled="False">


                <TextBlock TextWrapping="Wrap" Text="Length" Style="{StaticResource PageHeaderTextStyle}" Margin="10,10,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" FontSize="40"/>
         </Grid>

            <!-- Weight Input Area -->
                <Grid Margin="0,0,0,0" Background="#FFC7D6FF" Width="150" Height="245">


                <TextBlock TextWrapping="Wrap" Text="Weight" Style="{StaticResource PageHeaderTextStyle}" Margin="10,10,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" FontSize="40"/>
     </Grid>

            <!-- Speed Input Area -->
                <Grid Margin="0,0,0,0" Background="#FFF0B2BA" Width="150" Height="245">


                <TextBlock TextWrapping="Wrap" Text="Speed" Style="{StaticResource PageHeaderTextStyle}" Margin="10,10,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" FontSize="40"/>
       </Grid>

            <!-- Area Input Area -->
                <Grid Margin="0,0,0,0" Background="#FFFFFBB0" Width="150" Height="245">


                <TextBlock TextWrapping="Wrap" Text="Area" Style="{StaticResource PageHeaderTextStyle}" Margin="10,10,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" FontSize="40"/>
         </Grid>

            <!-- Volume Input Area -->
                <Grid Margin="0,0,0,0" Background="#FFFFD9A2" Width="150" Height="245">


                <TextBlock TextWrapping="Wrap" Text="Volume" Style="{StaticResource PageHeaderTextStyle}" Margin="10,10,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" FontSize="40"/>
        </Grid>

            <!-- Fuel Input Area -->
                <Grid Margin="0,0,0,0" Width="150"  Height="245" Background="#FFAA9C9B">


                <TextBlock TextWrapping="Wrap" Text="Fuel" Style="{StaticResource PageHeaderTextStyle}" Margin="10,10,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" FontSize="40"/>

            </Grid>

            <!-- Pressure Input Area -->
                <Grid Margin="0,0,0,0" Width="150" Background="#FFB9F8FB" Height="245">


                <TextBlock TextWrapping="Wrap" Text="Pressure" Style="{StaticResource PageHeaderTextStyle}" Margin="8,10,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" FontSize="40"/>

            </Grid>

    </GridView>
        </SemanticZoom.ZoomedOutView>
    </SemanticZoom>

0 个答案:

没有答案