/// Creates a new instance of the <see cref="ThemeVariant"/>
/// </summary>
/// <param name="key">Key of the theme variant by which variants are compared.</param>
/// <param name="inheritVariant">Reference to a theme variant which should be used, if resource wasn't found for the requested variant.</param>
/// <exception cref="ArgumentException">Thrown if inheritVariant is a reference to the <see cref="ThemeVariant.Default"/> which is ambiguous value to inherit.</exception>
/// <exception cref="ArgumentNullException">Thrown if key is null.</exception>
thrownewArgumentException("Inheriting default theme variant is not supported.",nameof(inheritVariant));
}
}
privateThemeVariant(objectkey)
{
Key=key;
}
/// <summary>
/// Key of the theme variant by which variants are compared.
/// </summary>
publicobjectKey{get;}
/// <summary>
/// Reference to a theme variant which should be used, if resource wasn't found for the requested variant.
/// </summary>
publicThemeVariant?InheritVariant{get;}
/// <summary>
/// Inherit theme variant from the parent. If set on Application, system theme is inherited.
/// Using Default as the ResourceDictionary.Key marks this dictionary as a fallback in case the theme variant or resource key is not found in other theme dictionaries.
_=>thrownewNotSupportedException("ThemeVariant type converter supports only build in variants. For custom variants please use x:Static markup extension.")