我有下一个 MapsItemControl 模板来显示地图上的许多图钉/项目。它绑定到 ObservableCollection,因为我希望它们被过滤以通过不同的选项显示或隐藏。这是 Map 控件内 MapsItemControl 的 XAML 代码。
<Maps:MapItemsControl x:Name="mapSpotsItems">
<Maps:MapItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel x:Name="spotPin" Visibility="{Binding isVisible}"
Maps:MapControl.Location="{Binding geopoint}" Tag="{Binding ID}" ToolTipService.ToolTip="{Binding Description}"
RenderTransformOrigin="0.5,1" Tapped="spotPin_Tapped">
<StackPanel Orientation="Horizontal" Tag="{Binding ID}">
<Grid>
<!-- Karratua -->
<Rectangle Width="25" Height="25" Fill="{StaticResource DarkGreyThemeColor}" Opacity="0.5"/>
<Rectangle Width="25" Height="25" Fill="{x:Null}" Stroke="Black" StrokeThickness="0.5" />
<!-- Borobila -->
<Image Source="{Binding MainTag}" Height="20" Width="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<StackPanel Background="{StaticResource DarkGrey75ThemeColor}">
<TextBlock Text="{Binding Title}" Margin="5,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="50" MaxLines="2" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Style="{StaticResource BaseTextBlockStyle}" FontSize="11" Foreground="{StaticResource LightGreyThemeColor}" LineHeight="11"/>
</StackPanel>
</StackPanel>
<Rectangle Width="2" Height="10" Fill="Black" StrokeThickness="0" StrokeEndLineCap="Triangle" />
</StackPanel>
</DataTemplate>
</Maps:MapItemsControl.ItemTemplate>
</Maps:MapItemsControl>
我有一些与之相关的问题。
慕慕森
相关分类