0
我有一個Windows 8.1通用應用程序,我正在爲客戶端工作。客戶希望飛出的一部分與同一彈出窗口的不同部分具有相同的高度。彈出窗口使用數據模板,該數據模板包含三行兩列的網格。第0行第1列(行跨度3)中的滾動查看器中的元素需要與網格中的第一行高度相同。有沒有辦法做到這一點?如何將網格中元素的高度綁定到grid.row的實際高度
我不能與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>
附加的XAML代碼。 –