// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.ComponentModel;
using System.Diagnostics.Contracts;
///
/// A container for all shared configuration switches for the MVVM Toolkit.
///
internal static class Configuration
{
///
/// The configuration property name for .
///
private const string DisableINotifyPropertyChangingSupport = "MVVMTOOLKIT_DISABLE_INOTIFYPROPERTYCHANGING";
///
/// Indicates whether or not support for is disabled.
///
public static readonly bool IsINotifyPropertyChangingDisabled = GetConfigurationValue(DisableINotifyPropertyChangingSupport);
///
/// Gets a configuration value for a specified property.
///
/// The property name to retrieve the value for.
/// The value of the specified configuration setting.
[Pure]
private static bool GetConfigurationValue(string propertyName)
{
if (AppContext.TryGetSwitch(propertyName, out bool isEnabled))
{
return isEnabled;
}
return false;
}
}