/// <summary>
        /// Setup the menu
        /// </summary>
        private void SetupMenu()
        {
            var menu = new ObservableCollection <LiteMenuCategoryViewModel>();

            var cat = new LiteMenuCategoryViewModel {
                Title = ApplicationResources.FeatureEditInsertCategoryHeader
            };

            foreach (var item in Items)
            {
                var menuItem = new LiteMenuItemViewModel(item.Name)
                {
                    Command = new RelayCommand(() => InsertItem(item), () => item.IsEnabled)
                };
                cat.Items.Add(menuItem);
                item.PropertyChanged += (s, e) => SetupMenuItem(s, e, menuItem);
            }

            // Only add the category if there are any items
            if (cat.Items.Any())
            {
                menu.Add(cat);
            }

            // Set the menu
            MenuItems = menu;

            // Notify
            RaisePropertyChanged(ViewVisibilityPropertyName);
        }
        /// <summary>
        /// Setup the menu icon
        /// </summary>
        /// <param name="menuItem">the menu item to setup </param>
        /// <param name="fieldType">geometry field type</param>
        private void SetupMenuIcon(LiteMenuItemViewModel menuItem, FeaturePhysicalFieldType fieldType)
        {
            var newIcon = LiteMenuItemViewModel.DefaultIconResource;

            switch (fieldType)
            {
            case FeaturePhysicalFieldType.Point:
            case FeaturePhysicalFieldType.MultiPoint:
                newIcon = "MetroIcon.Content.TrailPoint"; break;

            case FeaturePhysicalFieldType.Curve:
            case FeaturePhysicalFieldType.MultiCurve:
                newIcon = "MetroIcon.Content.TrailCurve"; break;

            case FeaturePhysicalFieldType.Polygon:
            case FeaturePhysicalFieldType.MultiPolygon:
                newIcon = "MetroIcon.Content.TrailPolygon"; break;
            }

            menuItem.IconResource = newIcon;
        }
        /// <summary>
        /// Setup a menuitem when the parent has changed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <param name="menuItem"></param>
        private void SetupMenuItem(object sender, System.ComponentModel.PropertyChangedEventArgs e, LiteMenuItemViewModel menuItem)
        {
            var item = sender as FeatureInsertItemViewModel;

            if (item != null)
            {
                if (e.PropertyName == FeatureInsertItemViewModel.PrimaryGeometryDescriptorPropertyName)
                {
                    // Prime geom has changed, setup the menu item
                    SetupMenuIcon(menuItem, item.PrimaryGeometryDescriptor.FieldType.PhysicalType);
                }
            }
        }