Пример #1
0
 void ReleaseDesignerOutlets()
 {
     if (AddrText != null)
     {
         AddrText.Dispose();
         AddrText = null;
     }
     if (button != null)
     {
         button.Dispose();
         button = null;
     }
     if (LatitudeText != null)
     {
         LatitudeText.Dispose();
         LatitudeText = null;
     }
     if (LongitudeText != null)
     {
         LongitudeText.Dispose();
         LongitudeText = null;
     }
     if (map != null)
     {
         map.Dispose();
         map = null;
     }
 }
Пример #2
0
        private void SetBindings()
        {
            map.LevelChanged += level => { MapLevelText.Text = level.ToString(); };

            TileCountText.DataContext = TileMemoryCache.Instance;
            TileCountText.SetBinding(TextBlock.TextProperty, new Binding("TileCount"));

            MapWidthText.DataContext = map;
            MapWidthText.SetBinding(TextBlock.TextProperty, new Binding("ActualWidth"));
            MapHeightText.DataContext = map;
            MapHeightText.SetBinding(TextBlock.TextProperty, new Binding("ActualHeight"));

            LatitudeText.DataContext = map;
            LatitudeText.SetBinding(TextBlock.TextProperty, new Binding("CurrentPosition.Lat"));
            LongitudeText.DataContext = map;
            LongitudeText.SetBinding(TextBlock.TextProperty, new Binding("CurrentPosition.Lng"));
        }