Beispiel #1
0
        /// <summary>
        /// Determines whether FlexiMvvm classes which implement <see cref="INotifyPropertyChanged"/> should raise <see cref="INotifyPropertyChanged.PropertyChanged"/> event.
        /// </summary>
        /// <param name="config">>The FlexiMvvm configuration.</param>
        /// <returns><c>true</c> if FlexiMvvm classes raise <see cref="INotifyPropertyChanged.PropertyChanged"/> event; otherwise, <c>false</c>. Returns <c>true</c> by default.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="config"/> is <c>null</c>.</exception>
        public static bool ShouldRaisePropertyChanged(this FlexiMvvmConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            return(config.GetValue(ShouldRaisePropertyChangedKey, true));
        }
        /// <summary>
        /// Returns a logger factory instance. This method is intended for internal use by FlexiMvvm.
        /// </summary>
        /// <param name="config">The FlexiMvvm configuration.</param>
        /// <returns>The logger factory instance.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="config"/> is <see langword="null"/>.</exception>
        public static ILoggerFactory GetLoggerFactory(this FlexiMvvmConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            return(config.GetValue <ILoggerFactory>(LoggerFactoryKey, NullLoggerFactory.Instance));
        }