0

行に十分な空き容量がないサブ要素の新しい行に自動的に折り返すXAML要素はありますか?私は何を意味レスポンシブなWindowsアプリケーション要素

は、ワイド画面に私が買ってあげることです。

Box1 Box2 Box3 

と狭い1上:

Box1 Box2 

Box3 

なしイベントに耳を傾け、でそれを修正する必要がコード。

コメントはVariableSizedWrapGridを解決策として言及しています。しかし、私はそれを包み込む方法を理解できません。

+0

はhttps://msdn.microsoft.com/library/windows/apps/xaml([VariableSizedWrapGrid]のように聞こえます/windows.ui.xaml.controls.variablesizedwrapgrid.aspx)? –

+0

http://stackoverflow.com/questions/2599424/what-is-the-wpf-equivilant-for-the-flowlayoutpanel – Gusman

+0

@Gusman ya WrapPanelはUWPにありません –

答えて

0

単純なGridViewを使用すると、それを行うことができます。 高さをに設定しないと、チャームのように機能します。

<GridView Name="xConcerts" ItemsSource="{x:Bind Artist.UpcomingEvents, Mode=OneWay}"> 
    <GridView.ItemTemplate> 
     <DataTemplate x:DataType="songkick:EventExt"> 
      <Border CornerRadius="8" Background="{ThemeResource ThemeGrayHighColorBrush}" Opacity="0.8"> 
       <StackPanel Margin="18,2"> 
        <TextBlock Text="{x:Bind FullDisplayDate, Converter={StaticResource FormatStringToDateDayConverter}}" Style="{ThemeResource ThemeDateBoldStyle}"/> 
        <TextBlock Text="{x:Bind FullDisplayDate, Converter={StaticResource FormatStringToDateMonthConverter}}" Style="{ThemeResource ThemeDateBoldStyle}" Margin="0,-4,0,0"/> 
       </StackPanel> 
      </Border> 
     </DataTemplate> 
    </GridView.ItemTemplate> 
    <GridView.ItemContainerTransitions> 
     <TransitionCollection> 
      <RepositionThemeTransition/> 
     </TransitionCollection> 
    </GridView.ItemContainerTransitions> 
</GridView> 
0

あなたの条件によると、WinRTXamlToolkitWrapPanelコントロールを使用すると、あなたのニーズを満たします。ここで
サンプルコード:ここで

<Page x:Class="TestDemo.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Tool="using:WinRTXamlToolkit.Controls" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:local="using:TestDemo" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d"> 

<Tool:WrapPanel> 
    <Button Width="200" Margin="10">1</Button> 
    <Button Width="200" Margin="10">2</Button> 
    <Button Width="200" Margin="10">3</Button> 
</Tool:WrapPanel> 
</Page> 

と出力:output

関連する問題