Migrated WinUI 3 sample backend elements

このコミットが含まれているのは:
Sergio Pedri committed 2021-11-20 00:29:36 +01:00
1 親 ab43fecf6d
コミット 75d2fbb2e8
6ファイル変更
+3

検索条件に一致するファイルはありません

+20
ファイルの表示
@@ -0,0 +1,20 @@
using Microsoft.UI.Xaml.Controls;
namespace ComputeSharp.SwapChain.WinUI.Converters
{
/// <summary>
/// A class with some static converters for rendering state.
/// </summary>
public static class RenderingPauseConverter
{
/// <summary>
/// Gets a symbol for an input rendering state.
/// </summary>
/// <param name="value">Whether or not the rendering is currently paaused.</param>
/// <returns>A symbol representing the next action for the rendering.</returns>
public static Symbol ConvertPausedToSymbol(bool value)
{
return value ? Symbol.Play : Symbol.Pause;
}
}
}
+28
ファイルの表示
@@ -0,0 +1,28 @@
namespace ComputeSharp.SwapChain.WinUI.Converters
{
/// <summary>
/// A class with some static converters for resolution scale settings.
/// </summary>
public static class ResolutionScaleConverter
{
/// <summary>
/// Converts a resolution scale to a formatted string.
/// </summary>
/// <param name="value">The input resolution scale (in percentage).</param>
/// <returns>A formatted percentage string for <paramref name="value"/>.</returns>
public static string ConvertPercentageToFormattedString(int value)
{
return $"{value}%";
}
/// <summary>
/// Converts a percentage value to a scaled value in the [0, 1] range.
/// </summary>
/// <param name="value">The input percentage value to scale.</param>
/// <returns>The input percentage scaled to the [0, 1] range.</returns>
public static double ConvertPercentageToScale(int value)
{
return value / 100.0;
}
}
}