예제 #1
0
        //public ICollectionViewLiveShaping ShapingItems => LibraryView.View as ICollectionViewLiveShaping;

        public GamesLibraryViewModel()
        {
            // this.DataCollection = new ObservableCollectionEx<GamesLibraryModel>();
            this._DataCollection = new ObservableCollectionEx <GamesLibraryModel>();
            this.LibraryView     = new CollectionViewSource();

            DGStatesPath = AppDomain.CurrentDomain.BaseDirectory + @"Data\Settings\GamesLibraryColumnStates.json";
            LoadDataGridStatesFromDisk();
            if (DataGridStates == null)
            {
                // load defaults from disk
                DataGridStates = new List <ColumnInfoObject>();
                for (int i = 1; i < 26; i++)
                {
                    ColumnInfoObject coo = new ColumnInfoObject();
                    coo.FilterNumber        = i;
                    coo.ColumnInfoList      = new List <ColumnInfo>();
                    coo.SortDescriptionList = new Dictionary <int, SortDescription>();
                    DataGridStates.Add(coo);
                }
                LoadColumnDefaults();
            }



            IsDirty = true;
            Update();

            // bind the CollectionViewSource to our GamesLibraryModel DataCollection
            _LibraryView.Source = DataCollection;

            //ShapingItems.LiveSortingProperties.Add("Game");
            // ShapingItems.LiveSortingProperties.Add("System");
            // ShapingItems.IsLiveSorting = true;

            // multiplefilterhandlers
            MultipleFilter = new MultipleFilterHandler(LibraryView, MultipleFilterLogic.And);

            CurrentCountryFilter = GamesLibrary.CountryFilter.ALL;

            DataGridFocused = true;
        }