2016-12-29 13 views
0

私はクライアント用に作業しているWindows 8.1の汎用アプリケーションを持っています。クライアントは、フライアウトの一部が同じフライアウトの異なる部分と同じ高さになることを望んでいます。フライアウトはデータテンプレートを使用し、そのデータテンプレートには3行2列のグリッドが含まれています。行0、列1(行3)のスクロールビューワ内の要素は、グリッドの最初の行と同じ高さである必要があります。これを達成する方法はありますか?グリッドの要素の高さをgrid.rowの実際の高さにバインドする方法

enter image description here

私は、xとグリッドを得ることができません:それはDataTemplateを内にあるので、名前を付けます。 クライアントは、赤い矢印で示された領域が、フライアウトの上部にあるオレンジ色の領域と同じ高さであり、スクロール可能領域になければならないと主張します。

アイデア?

おかげで、
ザック

編集:ここでは、XAMLです。

<DataTemplate x:Name="MultiselectFlyout"> 
     <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="White"> 
      <Grid.RowDefinitions> 
       <RowDefinition Height=".25*" /> 
       <RowDefinition Height=".18*" /> 
       <RowDefinition Height="*" /> 
      </Grid.RowDefinitions> 
      <Grid.ColumnDefinitions> 
       <ColumnDefinition Width="*" /> 
       <ColumnDefinition Width=".22*" /> 
      </Grid.ColumnDefinitions> 
      <Border Background="Gray" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
       <TextBlock Text="{Binding SelectedName, Mode=OneWay}" FontSize="34" FontFamily="{StaticResource GothamMedium}" TextAlignment="Center" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> 
      </Border> 
      <Border Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent"> 
       <Image Source="../Assets/dropshadow_B.png" Height="150" Margin="0,-110,0,0" Opacity=".3" Stretch="Fill" VerticalAlignment="Top" HorizontalAlignment="Stretch"/> 
      </Border> 
      <Border Background="{StaticResource PrimaryColor}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
       <TextBlock Foreground="White" Padding="0" TextAlignment="Center" VerticalAlignment="Center"> 
        <Run Text="{Binding Title}" FontSize="44" FontFamily="{StaticResource GothamMedium}"/> 
        <LineBreak/> 
        <Run Text="{Binding Subtitle[0]}" FontSize="28" FontFamily="{StaticResource GothamLight}"/> 
       </TextBlock> 
      </Border> 
      <Grid x:Name="ImageSwap" Grid.Row="2" Background="White"> 
       <Border Background="Transparent" BorderBrush="Gray" BorderThickness="0,0,1,0"> 
        <Image Source="{Binding BottomImage, Mode=OneWay}" Stretch="Uniform" ImageOpened="Image_Opened"/> 
       </Border> 
       <Border Background="Transparent" BorderBrush="Gray" BorderThickness="0,0,1,0"> 
        <Image Source="{Binding TopImage, Mode=OneWay}" Opacity="{Binding TopImgVisibility, Mode=OneWay}" Stretch="Uniform" ImageOpened="Image_Opened"/> 
       </Border> 
      </Grid> 
      <ScrollViewer Grid.Row="1" Grid.RowSpan="2" Grid.Column="1" Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalScrollBarVisibility="Hidden" VerticalScrollMode="Enabled" Loaded="ScrollViewer_Loaded" Tapped="ScrollViewer_Tapped"> 
       <ItemsControl ItemsSource="{Binding Colors, Mode=OneWay}" ItemTemplateSelector="{StaticResource DividerOrImageSelector}" Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
        <ItemsControl.ItemsPanel> 
         <ItemsPanelTemplate> 
          <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Top"/> 
         </ItemsPanelTemplate> 
        </ItemsControl.ItemsPanel> 
       </ItemsControl> 
      </ScrollViewer> 
      <Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="LightGray"> 
       <Viewbox StretchDirection="DownOnly" Margin="0"> 
        <TextBlock FontFamily="{StaticResource GothamMedium}" Foreground="Black" FontSize="22" TextAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
         <Run Text="SCROLL"/><LineBreak /><Run Text="TO SEE ALL"/><LineBreak /><Run Text="THE COLORS"/> 
        </TextBlock> 
       </Viewbox> 
      </Border> 
     </Grid> 
    </DataTemplate> 
+0

XAMLコードを接続します。 –

答えて

0

これを試してみてください:

<RowDefinition x:Name="row"> 
<Button Height="{Binding Height,ElementName="row"}"> 
関連する問題