我在让滚动条显示在我的 InfoWindow 中时遇到问题。代码如下。任何帮助,将不胜感激。
XAML:
<DataTemplate x:Key="MyFeatureLayerInfoWindowTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ItemsControl ItemsSource="{Binding Keys}" Grid.Column="0" />
<ItemsControl ItemsSource="{Binding Values}" Grid.Column="1" />
</Grid>
</DataTemplate>
<esri:InfoWindow x:Name="MyInfoWindow"
CornerRadius="20"
ContentTemplate="{StaticResource MyFeatureLayerInfoWindowTemplate}"
Map="{Binding ElementName=MyMap}"
MouseLeftButtonUp="MyInfoWindow_MouseLeftButtonUp"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
MaxHeight="200"
MaxWidth="200"/>
C#:
if (clickpoint != lastPoint)
{
MyInfoWindow.Anchor = clickpoint;
MyInfoWindow.Content = e.Graphic.Attributes;
MyInfoWindow.IsOpen = true;
lastPoint = clickpoint;
}
我所看到的图片:
内容出现在信息窗口中,但找不到滚动条。希望这很简单,我觉得我已经尝试了一切。提前致谢。