如何在使用Bing地图的Windows Store应用程序中实现弹出式气球?

3
我有一个应用程序,可以显示地图上某个固定点的信息。目前我已经将信息显示为消息对话框。这不仅不好看,也不适合作为信息框。我打算尝试实现一个弹出窗口,以便显示所有信息,这应该很容易,因为有很好的文档记录。我的问题是如何使它看起来像 Windows 地图应用程序中显示的弹出气球一样时尚?如下面的图片所示。似乎这种气球更难找到相关信息。

也许我在搜索错误的东西。是否有人知道这是否相对容易?以及如何自己实现这个功能的任何信息?

Windows 地图中的弹出气球图像

2个回答

2

我本来在寻找类似的东西,最终创建了一个UserControl。这是我的样子:

enter image description here

以下是Xaml代码:

<Popup 
    x:Name="bingMapsFlyout" 
    IsLightDismissEnabled="True"
    >
        <Popup.ChildTransitions>
            <TransitionCollection>
                <PaneThemeTransition/>
            </TransitionCollection>
        </Popup.ChildTransitions>
        <Canvas 
        x:Name="contentFlyoutPanel" 
        Height="126" 
        Width="259"
        >
            <Rectangle HorizontalAlignment="Left" Height="45.035" VerticalAlignment="Top" Width="20.552" RenderTransformOrigin="0,1" UseLayoutRounding="False" d:LayoutRounding="Auto" Fill="#FF252525" Opacity="0.6" Canvas.Left="26.902" Canvas.Top="26.128">
                <Rectangle.Clip>
                    <RectangleGeometry Rect="20.761,-7.16,21.378,58.646">
                        <RectangleGeometry.Transform>
                            <CompositeTransform CenterY="-7.6496992111206055" CenterX="20.250661849975586" Rotation="-3.03122615814209" SkewX="-21.284000396728516"/>
                        </RectangleGeometry.Transform>
                    </RectangleGeometry>
                </Rectangle.Clip>
                <Rectangle.RenderTransform>
                    <CompositeTransform SkewX="21" Rotation="163.744"/>
                </Rectangle.RenderTransform>
            </Rectangle>
            <Rectangle HorizontalAlignment="Left" Height="69" VerticalAlignment="Top" Width="245" Fill="#FF2B2B2B" Canvas.Left="7" Canvas.Top="8"/>
            <StackPanel HorizontalAlignment="Left" Height="69" VerticalAlignment="Top" Width="247" Canvas.Left="7" Canvas.Top="8">
                <TextBlock x:Name="txtLine1" HorizontalAlignment="Left" Height="18" TextWrapping="Wrap" VerticalAlignment="Top" Width="227" Margin="10,10,0,0" Foreground="White" FontFamily="Arial" FontSize="16" FontWeight="Bold"/>
                <TextBlock x:Name="txtLine2" HorizontalAlignment="Left" Height="26" TextWrapping="Wrap" VerticalAlignment="Top" Width="227" Margin="10,5,0,0" Foreground="White" FontFamily="Arial" FontSize="12" FontWeight="Bold"/>
            </StackPanel>
        </Canvas>
    </Popup>

我曾经放弃了这个问题,因为我无法理解它。你的答案似乎正是我想要的。谢谢! - Aimee Jones

0

我使用PopupMenu类实现了一个简单的弹出窗口,但仍然无法使其看起来像我上面发布的那个图片中的那样好看。 - Aimee Jones

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接