Exemple #1
0
        public SettingsDialogViewModel()
        {
            LanguageNames = LanguageChoices.Select(x => x.TextInfo.ToTitleCase(x.NativeName)).ToList();

            foreach (var extension in Extensions)
            {
                var association = new FileAssociationViewModel(extension);
                association.ValueChanged += (o, e) => SettingsChanged = true;
                FileAssociations.Add(association);
            }

            _language = LoadLanguage();

            Settings.Default.PropertyChanged += SettingsChangedEventHandler;
        }
        public SettingsDialogViewModel()
        {
            this.ResetCommand              = new RelayCommand(this.ResetToDefault);
            this.ApplyCommand              = new RelayCommand(this.ApplySettings);
            this.AcceptCommand             = new RelayCommand(this.AcceptSettings);
            this.SetAllAssociationsCommand = new RelayCommand <bool>(this.SetAllAssociations);

            foreach (var extension in extensions)
            {
                var association = new FileAssociationViewModel(extension);
                association.ValueChanged += (o, e) => this.SettingsChanged = true;
                this.FileAssociations.Add(association);
            }

            Settings.Default.PropertyChanged += (o, e) => this.SettingsChanged = true;
        }
Exemple #3
0
        public SettingsDialogViewModel()
        {
            this.LanguageNames = LanguageChoices.Select(x => x.TextInfo.ToTitleCase(x.NativeName)).ToList();

            this.ResetToDefaultCommand     = new RelayCommand(this.ResetToDefault);
            this.ResetToCurrentCommand     = new RelayCommand(this.ResetToCurrent);
            this.ApplyCommand              = new RelayCommand(this.ApplySettings);
            this.AcceptCommand             = new RelayCommand(this.AcceptSettings);
            this.SetAllAssociationsCommand = new RelayCommand <bool>(this.SetAllAssociations);

            foreach (var extension in extensions)
            {
                var association = new FileAssociationViewModel(extension);
                association.ValueChanged += (o, e) => this.SettingsChanged = true;
                this.FileAssociations.Add(association);
            }

            this.language = this.LoadLanguage();

            Settings.Default.PropertyChanged += this.SettingsChangedEventHandler;
        }