I'm attempting to wire up some functionality that will hide all of the user interface tools such as navigation, labels, zoom, and lat/lng with a button click. Essentially, I'd call the method below to hide everything, then perform some functionality in my button click event, and then call this method again to show the user interface tools.
What happens is that the RadMap hasn't actually completed the update to the control prior to the code in "Do some stuff" executing. I've noticed a small delay in the map rendering when the labels are turned on and off. It "appears" that I need to figure out how to wait for the RadMap to complete its rerendering after SetMapLabels(false) prior to executing the "Do some stuff" code.
Am I correct in my assumption? If so, can you share some insight as to which event handler would get triggered in this scenario?
What happens is that the RadMap hasn't actually completed the update to the control prior to the code in "Do some stuff" executing. I've noticed a small delay in the map rendering when the labels are turned on and off. It "appears" that I need to figure out how to wait for the RadMap to complete its rerendering after SetMapLabels(false) prior to executing the "Do some stuff" code.
Am I correct in my assumption? If so, can you share some insight as to which event handler would get triggered in this scenario?
private
void
btnDoStuff_Click(
object
sender, RoutedEventArgs e)
{
SetMapLabels(
false
);
// Do some stuff
SetMapLabels(
true
);
}
private
void
SetMapLabels(
bool
on)
{
if
(on)
{
_provider.IsLabelVisible =
true
;
// this.RadMap1.UseDefaultLayout = true;
this
.RadMap1.CommandBarVisibility = System.Windows.Visibility.Visible;
this
.RadMap1.NavigationVisibility = System.Windows.Visibility.Visible;
this
.RadMap1.ScaleVisibility = System.Windows.Visibility.Visible;
this
.RadMap1.ZoomBarPresetsVisibility = System.Windows.Visibility.Visible;
this
.RadMap1.ZoomBarVisibility = System.Windows.Visibility.Visible;
this
.RadMap1.MouseLocationIndicatorVisibility = System.Windows.Visibility.Visible;
this
.RadMap1.MiniMapExpanderVisibility = System.Windows.Visibility.Hidden;
this
.RadMap1.InvalidateVisual();
this
.RadMap1.UpdateLayout();
return
;
}
_provider.IsLabelVisible =
false
;
// this.RadMap1.UseDefaultLayout = false;
this
.RadMap1.CommandBarVisibility = System.Windows.Visibility.Hidden;
this
.RadMap1.NavigationVisibility = System.Windows.Visibility.Hidden;
this
.RadMap1.ZoomBarPresetsVisibility = System.Windows.Visibility.Hidden;
this
.RadMap1.ZoomBarVisibility = System.Windows.Visibility.Hidden;
this
.RadMap1.ScaleVisibility = System.Windows.Visibility.Hidden;
this
.RadMap1.MouseLocationIndicatorVisibility = System.Windows.Visibility.Hidden;
this
.RadMap1.MiniMapExpanderVisibility = System.Windows.Visibility.Hidden;
this
.RadMap1.InvalidateVisual();
this
.RadMap1.UpdateLayout();
}