/// <summary> /// Convert <see cref="ShareUITheme"/> to <see cref="ApplicationTheme"/>. /// </summary> /// <param name="value">The <see cref="ShareUITheme"/> to convert.</param> /// <returns>An <see cref="ApplicationTheme"/> has the same value with <paramref name="value"/>.</returns> public static ApplicationTheme ToApplicationTheme(this ShareUITheme value) { switch (value) { case ShareUITheme.Light: return(ApplicationTheme.Light); case ShareUITheme.Dark: return(ApplicationTheme.Dark); default: return(Application.Current.RequestedTheme); } }
/// <summary> /// Convert <see cref="ShareUITheme"/> to <see cref="ElementTheme"/>. /// </summary> /// <param name="value">The <see cref="ShareUITheme"/> to convert.</param> /// <returns>An <see cref="ElementTheme"/> has the same value with <paramref name="value"/>.</returns> public static ElementTheme ToElementTheme(this ShareUITheme value) { switch (value) { case ShareUITheme.Light: return(ElementTheme.Light); case ShareUITheme.Dark: return(ElementTheme.Dark); default: return(ElementTheme.Default); } }