/// <summary> /// Will set the background grid of the map view /// NOTE: Since we can't add this code inside XAML, thanks to ESRI sdk, we need to force it here. /// </summary> public void SetBackgroundGrid() { if (myMapView.BackgroundGrid.GridLineWidth != 0) { Services.SettingsServices.SettingsService _settings = Services.SettingsServices.SettingsService.Instance; CustomResource customColors = new CustomResource(); customColors.InitializeComponent(); if (customColors.ContainsKey("MapViewBackgroundGridLightColor")) { var appT = _settings.AppTheme; if (_settings.AppTheme == ApplicationTheme.Light) { Windows.UI.Color lightDefault = (Windows.UI.Color)customColors["MapViewBackgroundGridLightColor"]; myMapView.BackgroundGrid.Color = System.Drawing.Color.FromArgb(lightDefault.A, lightDefault.R, lightDefault.G, lightDefault.B); //myMapView.BackgroundGrid.GridLineColor = (Windows.UI.Color)customColors["MapViewBackgroundGridDarkColor"]; //myMapView.BackgroundGrid.GridLineWidth = 5; } else { Windows.UI.Color darkDefault = (Windows.UI.Color)customColors["MapViewBackgroundGridDarkColor"]; myMapView.BackgroundGrid.Color = System.Drawing.Color.FromArgb(darkDefault.A, darkDefault.R, darkDefault.G, darkDefault.B); //myMapView.BackgroundGrid.GridLineColor = (Windows.UI.Color)customColors["MapViewBackgroundGridLightColor"]; //myMapView.BackgroundGrid.GridLineWidth = 5; } } myMapView.BackgroundGrid.GridLineWidth = 0; myMapView.UpdateLayout(); } }