Inheritance: ContentLibraryRootViewModel, IDropTarget, ITransient
Esempio n. 1
0
        MissionLibraryItemViewModel(MissionLibraryViewModel library, T model, bool doGrouping = false,
                                    MissionLibraryGroupViewModel group = null)
            : base(library, model, @group: group, doGrouping: doGrouping)
        {
            var groups = doGrouping
                ? new[] { PropertyGroupDescription }
                : null;

            Filter = new MissionFilter();

            SetupFilterChanged();
            UiHelper.TryOnUiThread(() => {
                Items.EnableCollectionSynchronization(ItemsLock);
                _itemsView =
                    Items.CreateCollectionView(
                        new[] {
                    new SortDescription("IsFavorite", ListSortDirection.Descending),
                    new SortDescription("FullName", ListSortDirection.Ascending)
                },
                        groups, null, Filter.Handler, true);

                _childrenView =
                    Children.CreateCollectionView(
                        new[] {
                    new SortDescription("Model.IsFavorite", ListSortDirection.Descending),
                    new SortDescription("Model.Name", ListSortDirection.Ascending)
                }, null,
                        null, null, true);
            });
            Sort = new SortViewModel(ItemsView, Columns, null, RequiredColumns);
            SetupGrouping();
        }
 public LocalMissionLibraryItemViewModel(MissionLibraryViewModel library, LocalMissionsContainer model,
                                         MissionLibraryGroupViewModel @group = null,
                                         bool isFeatured = false, bool doGrouping = false)
     : base(library, model, SixIconFont.withSIX_icon_Folder, @group, isFeatured, doGrouping)
 {
     Items.ChangeTrackingEnabled = true;
     Description = model.Path;
 }
Esempio n. 3
0
 public MissionLibraryItemViewModel(MissionLibraryViewModel library, T model, string icon = null,
                                    MissionLibraryGroupViewModel group = null, bool isFeatured = false,
                                    bool doGrouping = false)
     : this(library, model, doGrouping, group)
 {
     Icon       = icon;
     IsFeatured = isFeatured;
 }
        public MissionSearchContentLibraryItemViewModel(MissionLibraryViewModel library) : base(library) {
            MissionContextMenu = new MissionContextMenu(library);
            MissionFolderContextMenu = new MissionFolderContextMenu(library);

            MissionBarMenu = new MissionContextMenu(library);
            MissionFolderBarMenu = new MissionFolderContextMenu(library);

            SetupMenus(HandleSingleMenu, x => ContextMenu = null);
        }
        public MissionSearchContentLibraryItemViewModel(MissionLibraryViewModel library) : base(library)
        {
            MissionContextMenu       = new MissionContextMenu(library);
            MissionFolderContextMenu = new MissionFolderContextMenu(library);

            MissionBarMenu       = new MissionContextMenu(library);
            MissionFolderBarMenu = new MissionFolderContextMenu(library);

            SetupMenus(HandleSingleMenu, x => ContextMenu = null);
        }
        public MissionContentLibraryItemViewModel(MissionLibraryViewModel library, T model, string icon = null,
                                                  MissionLibraryGroupViewModel @group = null, bool isFeatured = false,
                                                  bool doGrouping = false)
            : base(library, model, icon, @group, isFeatured, doGrouping)
        {
            MissionContextMenu       = new MissionContextMenu(library);
            MissionFolderContextMenu = new MissionFolderContextMenu(library);
            MissionBarMenu           = new MissionContextMenu(library);
            MissionFolderBarMenu     = new MissionFolderContextMenu(library);

            SetupMenus(HandleSingleMenu, x => ContextMenu = null);
        }
        public MissionLibrarySetup(MissionLibraryViewModel library, Game game, IContentManager missionList,
                                   UserSettings settings,
                                   IEventAggregator eventBus)
        {
            if (game == null)
            {
                throw new ArgumentNullException(nameof(game));
            }
            if (!(game.SupportsMissions()))
            {
                throw new NotSupportedException("game.SupportsMissions()");
            }
            if (missionList == null)
            {
                throw new ArgumentNullException(nameof(missionList));
            }

            _library     = library;
            _game        = game;
            _missionList = missionList;
            _eventBus    = eventBus;
            _settings    = settings;
            OnlineGroup  = new MissionLibraryGroupViewModel(library, "Repositories", icon: SixIconFont.withSIX_icon_Cloud)
            {
                IsRoot    = true,
                SortOrder = 13
            };
            LocalGroup = new MissionLibraryGroupViewModel(library, "Local", "add folder",
                                                          SixIconFont.withSIX_icon_System)
            {
                IsRoot = true, SortOrder = 12
            };
            CollectionsGroup = new MissionLibraryGroupViewModel(library, "Collections", "new collection",
                                                                SixIconFont.withSIX_icon_Folder)
            {
                IsRoot = true, SortOrder = 11
            };
            BuiltInGroup = new MissionLibraryGroupViewModel(library, null)
            {
                IsRoot = true, SortOrder = 0
            };
            Groups = new LibraryGroupViewModel <MissionLibraryViewModel>[] { null, BuiltInGroup, LocalGroup };
            // , OnlineGroup

            _eventBus.Subscribe(this);

            Items.AddRange(Groups.Where(x => x != null && x != BuiltInGroup));
            if (_game.SupportsMissions())
            {
                Setup();
            }
            CreateItemsView();
        }
 protected MissionLibraryItemMenuBase(MissionLibraryViewModel library) : base(library)
 {
 }
 public NetworkLibraryItemViewModel(MissionLibraryViewModel library, BuiltInContentContainer model,
                                    MissionLibraryGroupViewModel @group = null, bool doGrouping = false)
     : base(library, model, SixIconFont.withSIX_icon_Nav_Server, @group, true, doGrouping)
 {
     Items.ChangeTrackingEnabled = true;
 }