mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 19:08:33 +08:00
27 lines
945 B
C#
27 lines
945 B
C#
using BetterLyrics.WinUI3.Enums;
|
|
using Microsoft.UI.Xaml.Controls;
|
|
using System;
|
|
|
|
namespace BetterLyrics.WinUI3.Extensions
|
|
{
|
|
public static class LyricsLayoutOrientationExtensions
|
|
{
|
|
extension(LyricsLayoutOrientation orientation)
|
|
{
|
|
public Orientation ToOrientation() => orientation switch
|
|
{
|
|
LyricsLayoutOrientation.Horizontal => Orientation.Horizontal,
|
|
LyricsLayoutOrientation.Vertical => Orientation.Vertical,
|
|
_ => throw new ArgumentOutOfRangeException(nameof(orientation)),
|
|
};
|
|
|
|
public Orientation ToOrientationInverse() => orientation switch
|
|
{
|
|
LyricsLayoutOrientation.Horizontal => Orientation.Vertical,
|
|
LyricsLayoutOrientation.Vertical => Orientation.Horizontal,
|
|
_ => throw new ArgumentOutOfRangeException(nameof(orientation)),
|
|
};
|
|
}
|
|
}
|
|
}
|