/// <inheritdoc />
        public override void Initialize(IConfig config)
        {
            // Prepare disposables
            _disposables?.Dispose();
            _disposables = new CompositeDisposable();

            // Place this under the Ui parent
            ParentId = nameof(ConfigIds.Ui);

            // Make sure Commit/Rollback is called on the IDemoConfiguration
            config.Register(DemoConfiguration);

            // automatically update the DisplayName
            _disposables.Add(CoreTranslations.CreateDisplayNameBinding(this, nameof(ICoreTranslations.Language)));

            // automatically update the CanChangeLanguage state when a different language is selected
            _disposables.Add(DemoConfiguration.OnPropertyChanged(nameof(IDemoConfiguration.Language)).Subscribe(pcEvent => NotifyOfPropertyChange(nameof(CanChangeLanguage))));

            base.Initialize(config);
        }
Esempio n. 2
0
 public void OnImportsSatisfied()
 {
     CoreTranslations.BindChanges(nameof(CoreTranslations.Settings), OnPropertyChanged, nameof(DisplayName));
 }