本文整理汇总了C#中Microsoft.Phone.Controls.Maps.Pushpin.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# Pushpin.SetBinding方法的具体用法?C# Pushpin.SetBinding怎么用?C# Pushpin.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Phone.Controls.Maps.Pushpin
的用法示例。
在下文中一共展示了Pushpin.SetBinding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateBingMapControl
private void CreateBingMapControl()
{
//// HACK need to create this control in code after onload because of a bug with the bing map control
if (mapMain == null)
{
mapMain = System.Windows.Markup.XamlReader.Load(BING_MAP_XAML) as Map;
if (mapLayer == null)
{
mapLayer = mapMain.FindVisualChild("mapLayer") as MapLayer;
deviceLocation = mapMain.FindVisualChild("deviceLocation") as Pushpin;
deviceLocation.SetBinding(UIElement.VisibilityProperty, new Binding("CurrentDevicePositionVisible"));
deviceLocation.SetBinding(Pushpin.LocationDependencyProperty, new Binding("CurrentDevicePosition"));
}
else
{
MapLayer temp = mapMain.FindVisualChild("mapLayer") as MapLayer;
mapMain.Children.Remove(temp);
mapMain.Children.Add(mapLayer);
Pushpin p = mapMain.FindVisualChild("deviceLocation") as Pushpin;
mapMain.Children.Remove(p);
mapMain.Children.Add(deviceLocation);
}
//start the is downloading timer
//HACK need to shwo a progress bar when tiles are downloading as requested from MSFT
mapMain.ViewChangeStart += ViewChangeStart_IsDownloadingProgressHandler;
if (m_isDownloadingTimer == null)
{
m_isDownloadingTimer = new DispatcherTimer();
m_isDownloadingTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
m_isDownloadingTimer.Tick += (s1, e1) =>
{
m_isDownloadingTimer.Stop();
if (mapMain == null)
{
//pb_mapDownloading.IsIndeterminate = false;
//pb_mapDownloading.Visibility = System.Windows.Visibility.Collapsed;
m_isDownloadingTimer.Stop();
}
else
{
if (mapMain.Mode.IsDownloading)
{
//pb_mapDownloading.IsIndeterminate = true;
//pb_mapDownloading.Visibility = System.Windows.Visibility.Visible;
}
else
{
//pb_mapDownloading.IsIndeterminate = false;
//pb_mapDownloading.Visibility = System.Windows.Visibility.Collapsed;
m_isDownloadingTimer.Stop();
return;
}
}
//restart the timer but change the interval to every 2 secs
m_isDownloadingTimer.Interval = new TimeSpan(0, 0, 2);
m_isDownloadingTimer.Start();
};
}
//add to the content grid
ContentGrid.Children.Insert(0, mapMain);
SetupMap();
}
}