0

メインページが次のように構成されているアプリケーションがあります。

グリッド (LayoutRoot)

 VisualStateManager                         (FullLandscape, FullPortrait, Filled,  Snap)

 Grid                                       (Back button and page title)

 ScrollViewer                               (FullLandscape View )

     StackPanel                             (Horizontal)

         GridView                           (non grouped GridView)

         GridView                           (grouped GridView)

         GridView                           (non grouped GridView)

         GridView                           (grouped GridView)

         GridView                           (grouped GridView)

 ScrollViewer                               (Snap View)

     Grid

         ListView                           (Vertical)

私の質問は次のとおりです。

  1. アプリケーションが認証に合格するには、アプリケーションの各ページに SemanticZoom を提供する必要がありますか?

  2. このメイン ページに SemanticZoom を提供したい場合、どうすればよいですか? つまり、どこに SemanticZoom コントロールを挿入すればよいでしょうか?

(記事を読みました: クイックスタート: SemanticZoom コントロールの追加:)

<SemanticZoom.ZoomedOutView>
    <!-- Put the GridView for the zoomed out view here. -->   
</SemanticZoom.ZoomedOutView>

<SemanticZoom.ZoomedInView>
    <!-- Put the GridView for the zoomed in view here. -->       
</SemanticZoom.ZoomedInView>

ありがとう、エイタンB

4

3 に答える 3

3

あなたが上に書いたことからあなたが達成しようとしていることを理解するのは少し難しいですが、私はあなたの質問に答えるために最善を尽くします.

1)認定に合格するために SemanticZoom の使用は必須ではありません。これは、ユーザーにきちんとした方法でデータを提示するのに役立つ優れた機能であり、適切に使用すると非常にクールです。しかし、それは単なるコントロールです。あなたのプロジェクトについてもう少し情報を提供してください。アプリケーションに何か特別なものを追加するかどうかを決定するのに役立つかもしれません. 簡単に始めて、後で詳細に取り組みます。

2) MSDN から SemanticZoom の例をダウンロードし、コードを確認します。基本的には次のようになります。

<Page.Resources>
    <CollectionViewSource x:Name="cvs2" IsSourceGrouped="true" />
</Page.Resources>

<Grid x:Name="ContentPanel" VerticalAlignment="Top" HorizontalAlignment="Left">
    <SemanticZoom x:Name="semanticZoom" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            <GridView ScrollViewer.IsHorizontalScrollChainingEnabled="False">
                <GridView.ItemTemplate>
                    <DataTemplate>
                        <TextBlock
                            Text="{Binding Group.Key}"
                            FontFamily="Segoe UI Light"
                            FontSize="24"/>
                    </DataTemplate>
                </GridView.ItemTemplate>
                <GridView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid ItemWidth="75" ItemHeight="75" MaximumRowsOrColumns="1" VerticalChildrenAlignment="Center" />
                    </ItemsPanelTemplate>
                </GridView.ItemsPanel>
                <GridView.ItemContainerStyle>
                    <Style TargetType="GridViewItem">
                        <Setter Property="Margin" Value="4" />
                        <Setter Property="Padding" Value="10" />
                        <Setter Property="BorderBrush" Value="Gray" />
                        <Setter Property="BorderThickness" Value="1" />
                        <Setter Property="HorizontalContentAlignment" Value="Center" />
                        <Setter Property="VerticalContentAlignment" Value="Center" />
                    </Style>
                </GridView.ItemContainerStyle>
            </GridView>
        </SemanticZoom.ZoomedOutView>
        <SemanticZoom.ZoomedInView>
            <GridView ItemsSource="{Binding Source={StaticResource cvs2}}" IsSwipeEnabled="True" ScrollViewer.IsHorizontalScrollChainingEnabled="False">
                <GridView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="10,10,0,0" HorizontalAlignment="Left" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
                            <Image Source="{Binding Image}" Height="60" Width="60" VerticalAlignment="Center" Margin="0,0,10,0"/>
                            <TextBlock TextWrapping="Wrap" Foreground="{StaticResource ApplicationForegroundThemeBrush}" Width="200" VerticalAlignment="Center" Text="{Binding Title}" HorizontalAlignment="Left" FontFamily="Segoe UI" />
                        </StackPanel>
                    </DataTemplate>
                </GridView.ItemTemplate>
                <GridView.GroupStyle>
                    <GroupStyle>
                        <GroupStyle.HeaderTemplate>
                            <DataTemplate>
                                <TextBlock Text='{Binding Key}' Foreground="{StaticResource ApplicationForegroundThemeBrush}" Margin="5" FontSize="18" FontFamily="Segoe UI Light" />
                            </DataTemplate>
                        </GroupStyle.HeaderTemplate>
                        <GroupStyle.ContainerStyle>
                            <Style TargetType="GroupItem">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="GroupItem">
                                            <StackPanel Orientation="Vertical">
                                                <ContentPresenter Content="{TemplateBinding Content}" />
                                                <ItemsControl x:Name="ItemsControl" ItemsSource="{Binding GroupItems}" />
                                            </StackPanel>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </GroupStyle.ContainerStyle>
                        <GroupStyle.Panel>
                            <ItemsPanelTemplate>
                                <VariableSizedWrapGrid Orientation="Vertical" MaximumRowsOrColumns="3" />
                            </ItemsPanelTemplate>
                        </GroupStyle.Panel>
                    </GroupStyle>
                </GridView.GroupStyle>
                <GridView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid Orientation="Vertical" MaximumRowsOrColumns="1" />
                    </ItemsPanelTemplate>
                </GridView.ItemsPanel>
                <Button Visibility="Collapsed"/>
            </GridView>
        </SemanticZoom.ZoomedInView>
    </SemanticZoom>
</Grid>

コードビハインド:

StoreData _storeData = null;

public ScenarioOutput1()
{
   InitializeComponent();
   _storeData = new StoreData();

   List<GroupInfoList<object>> dataCategory = _storeData.GetGroupsByCategory();
   cvs1.Source = dataCategory;
}
于 2012-09-23T17:01:48.437 に答える
0

The way to do it is like I posted in my question, i.e. the question was asking if it is the right way and the answer is yes.

EitanB

于 2012-10-24T21:15:52.533 に答える
0

ご回答有難うございます。

私は例を見ましたが、それは私には明らかです。私には明らかではありません: この 1 つのページには、例のように 1 つだけではなく、複数の GridView があります。私の頭の中にある質問は次のとおりです。ページ上の各 GridView のサンプル コードに従う必要がありますか、またはすべての GridView をカバーするページに対して 1 回実行する方法はありますか? 以下の疑似コードを参照してください。

ありがとう、エイタンB

VisualStateManager (FullLandscape、FullPortrait、Filled、Snap)

グリッド (戻るボタンとページ タイトル)

ScrollViewer (FullLandscape View)

 StackPanel                             (Horizontal)

    <SemanticZoom x:Name="semanticZoom1" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (non grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (non grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>


    <SemanticZoom x:Name="semanticZoom2" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>


    <SemanticZoom x:Name="semanticZoom3" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (non grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (non grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>

    <SemanticZoom x:Name="semanticZoom4" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>

    <SemanticZoom x:Name="semanticZoom5" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>

ScrollViewer (スナップ ビュー)

 Grid

     ListView                           (Vertical)
于 2012-09-24T02:55:02.050 に答える