예제 #1
0
        public CacheList()
        {
            if (_cacheListColumnInfoCollection == null)
            {
                _cacheListColumnInfoCollection = new CacheListColumnInfoCollection();
            }

            InitializeComponent();
            DataContext = this;

            if (Core.Settings.Default.CacheListEnableAutomaticSorting && Core.Settings.Default.CacheListSortOnColumnIndex >= 0 && Core.Settings.Default.CacheListSortOnColumnIndex < cacheList.Columns.Count)
            {
                this.cacheList.Columns[Core.Settings.Default.CacheListSortOnColumnIndex].SortDirection = Core.Settings.Default.CacheListSortDirection == 0 ? ListSortDirection.Ascending : ListSortDirection.Descending;
            }


            ColorPickerArchived.SelectedColor = (Color)ColorConverter.ConvertFromString(Core.Settings.Default.ArchivedRowColor);
            ColorPickerDisabled.SelectedColor = (Color)ColorConverter.ConvertFromString(Core.Settings.Default.DisabledRowColor);
            ColorPickerOwn.SelectedColor = (Color)ColorConverter.ConvertFromString(Core.Settings.Default.IsOwnRowColor);
            ColorPickerFound.SelectedColor = (Color)ColorConverter.ConvertFromString(Core.Settings.Default.FoundRowColor);

            setGeocacheCollectionView();
            _cacheListColumnInfoCollection.AssignDataGrid(cacheList);
            _cacheListColumnInfoCollection.UpdateDataGrid(cacheList);

            Core.Settings.Default.PropertyChanged += Default_PropertyChanged;
            Core.ApplicationData.Instance.PropertyChanged += Instance_PropertyChanged;
            Localization.TranslationManager.Instance.LanguageChanged += Instance_LanguageChanged;

            if (Core.ApplicationData.Instance.ActiveGeocache != null)
            {
                cacheList.ScrollIntoView(Core.ApplicationData.Instance.ActiveGeocache);
            }
        }
예제 #2
0
        public CacheList()
        {
            if (_cacheListColumnInfoCollection == null)
            {
                _cacheListColumnInfoCollection = new CacheListColumnInfoCollection();
            }

            InitializeComponent();

            _cacheListColumnInfoCollection.AssignDataGrid(cacheList);
            _selectedOnly = Core.Settings.Default.CacheListShowSelectedOnly;

            Core.Settings.Default.PropertyChanged += Default_PropertyChanged;
        }