Files
PalladiumWallet/src/App/ViewModels/BoolToTabPlacementConverter.cs
T

22 lines
759 B
C#
Raw Normal View History

using System;
using System.Globalization;
using Avalonia.Controls;
using Avalonia.Data.Converters;
namespace PalladiumWallet.App.ViewModels;
/// <summary>
/// true (mobile) → Dock.Bottom — tab strip at the bottom, Android standard.
/// false (desktop) → Dock.Top — Avalonia default behavior.
/// </summary>
public sealed class BoolToTabPlacementConverter : IValueConverter
{
public static readonly BoolToTabPlacementConverter Instance = new();
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
value is true ? Dock.Bottom : Dock.Top;
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) =>
throw new NotSupportedException();
}