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; } }
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")); }