void Refresh()
        {
            MapDetailsBindingWrapper <ContentItem> wrapper = (MapDetailsBindingWrapper <ContentItem>)DataContext;

            //get the content item from the server to make sure it is up to date
            ArcGISOnlineEnvironment.ArcGISOnline.Content.GetItem(wrapper.Content.Id, (object sender, ContentItemEventArgs e) =>
            {
                if (e.Error != null)
                {
                    return;
                }

                //preserve the folder information if it was already determined
                //
                e.Item.Folder = wrapper.Content.Folder;

                wrapper.Content = e.Item;
                InitializeBindingProperties(wrapper);

                //initialize the tabs
                MapDetailsTabControl_SelectionChanged(null, null);
            });

            //raise event
            RaiseMapDetailsChanged();
        }
 /// <summary>
 /// Initializes additional binding properties for average rating, number of ratings etc..
 /// </summary>
 void InitializeBindingProperties(MapDetailsBindingWrapper <ContentItem> wrapper)
 {
     wrapper.RatingValue          = wrapper.Content.AverageRating / (double)MapRating.ItemCount;
     wrapper.NumberOfRatings      = string.Format(ESRI.ArcGIS.Mapping.Controls.ArcGISOnline.Resources.Strings.MapDetailsRating, wrapper.Content.NumberOfRatings);
     wrapper.EditButtonVisibility = CanEditMapDetails ? Visibility.Visible : Visibility.Collapsed;
     wrapper.RateButtonVisibility = CanRate ? Visibility.Visible : Visibility.Collapsed;
 }
        /// <summary>
        /// Initializes the control.
        /// </summary>
        public void Activate(ContentItem contentItem)
        {
            if (MapDetailsTabControl == null)
            {
                pendingActivate = true;
                pendingItem     = contentItem;
                return;
            }

            pendingActivate = false;
            if (!_initialized)
            {
                _initialized = true;
            }

            HideEditingControls();

            //use a BindingWrapper to bind additional properties such as average rating, number of ratings..
            MapDetailsBindingWrapper <ContentItem> wrapper = new MapDetailsBindingWrapper <ContentItem>();

            //bind the control to the wrapper
            DataContext     = wrapper;
            wrapper.Content = contentItem;
            InitializeBindingProperties(wrapper);

            //initialize the tabs
            MapDetailsTabControl_SelectionChanged(null, null);
        }