private static void OnArcGISPortalPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
BasemapPicker gallery = (BasemapPicker)d;
ArcGISPortal oldValue = (ArcGISPortal)e.OldValue;
if (oldValue != null)
{
gallery.ItemsSource = null;
}
ArcGISPortal newValue = (ArcGISPortal)e.NewValue;
if (newValue != null)
{
if (newValue.ArcGISPortalInfo != null)
{
gallery.RefreshBasemaps();
}
}
}