本文整理汇总了C#中MapOverlay.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# MapOverlay.SetValue方法的具体用法?C# MapOverlay.SetValue怎么用?C# MapOverlay.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapOverlay
的用法示例。
在下文中一共展示了MapOverlay.SetValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowMyLocationPin
private void ShowMyLocationPin()
{
myCircle = new Ellipse();
myCircle.Fill = new SolidColorBrush(Colors.Blue);
myCircle.Height = 20;
myCircle.Width = 20;
myCircle.Opacity = 50;
myCircle.Visibility = Visibility.Collapsed;
flashOverlay = new MapOverlay();
flashOverlay.PositionOrigin = new Point(0.5, 0.5);
flashOverlay.SetValue(flashColor, true);
// Create a MapOverlay to contain the circle.
flashOverlay.Content = myCircle;
//flashOverlay.GeoCoordinate = coor;
flashOverlay.SetValue(flashColor, true);
// Create a MapLayer to contain the MapOverlay.
MapLayer myLocationLayer = new MapLayer();
myLocationLayer.Add(flashOverlay);
// Add the MapLayer to the Map.
map.Layers.Add(myLocationLayer);
}
示例2: CreateMapOverlay
/// <summary>
/// Creates a MapOverlay with the specified content and content template.
/// It will have special setup so that later the dependency properties from MapOverlay
/// and the attached properties from the target UI can be in a binding.
/// </summary>
/// <param name="content">Content of the MapOverlay</param>
/// <param name="contentTemplate">Template to be used in the MapOverlay</param>
/// <returns>The MapOverlay that was created</returns>
internal static MapOverlay CreateMapOverlay(object content, DataTemplate contentTemplate)
{
MapOverlay mapOverlay;
MapOverlayItem presenterHelper;
mapOverlay = new MapOverlay();
presenterHelper = new MapOverlayItem(content, contentTemplate, mapOverlay);
// For insertion and removal purposes, we will have a diferentiation between
// map overlays that are created by this toolkit and when they are not.
// This will help to determine, when they are removed, to which
// we will need to to speacial cleaning
mapOverlay.SetValue(MapChild.ToolkitCreatedProperty, true);
mapOverlay.Content = presenterHelper;
// The dependency properties from MapOverlay, will be binded
// until the content finally has a UI.
// At that point, we will try to get the actual ui
// and bind the attached properties from the ui to the
// dependency properties of the map overlay.
return mapOverlay;
}