Exemplo n.º 1
0
        /* ----------------------------------------------------------------- */
        ///
        /// MainViewModel
        ///
        /// <summary>
        /// オブジェクトを初期化します。
        /// </summary>
        ///
        /// <param name="settings">設定情報</param>
        /// <param name="context">同期用コンテキスト</param>
        ///
        /* ----------------------------------------------------------------- */
        public MainViewModel(SettingsFolder settings, SynchronizationContext context) :
            base(new Messenger(), context)
        {
            Model      = new MainFacade(settings);
            Settings   = new SettingsViewModel(settings.Value, Messenger, Context);
            Metadata   = new MetadataViewModel(settings.Value.Metadata, Messenger, Context);
            Encryption = new EncryptionViewModel(settings.Value.Encryption, Messenger, Context);

            settings.PropertyChanged += WhenPropertyChanged;
        }
Exemplo n.º 2
0
        /* ----------------------------------------------------------------- */
        ///
        /// MainViewModel
        ///
        /// <summary>
        /// Initializes a new instance of the MainViewModel class with the
        /// specified arguments.
        /// </summary>
        ///
        /// <param name="settings">User settings.</param>
        /// <param name="context">Synchronization context.</param>
        ///
        /* ----------------------------------------------------------------- */
        public MainViewModel(SettingFolder settings, SynchronizationContext context) :
            base(new Facade(settings), new Aggregator(), context)
        {
            Locale.Set(settings.Value.Language);

            General    = new SettingViewModel(settings, Aggregator, context);
            Metadata   = new MetadataViewModel(settings.Value.Metadata, Aggregator, context);
            Encryption = new EncryptionViewModel(settings.Value.Encryption, Aggregator, context);

            Facade.Settings.PropertyChanged += Observe;
        }