Sheas-Cealer/Convs/MainFunctionButtonContentConv.cs
2024-05-18 19:21:53 +08:00

25 lines
934 B
C#

using System;
using System.Diagnostics;
using System.Globalization;
using System.Windows.Data;
using Sheas_Cealer.Consts;
namespace Sheas_Cealer.Convs;
internal class MainFunctionButtonContentConv : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
MainConst.SettingsMode? mode = value as MainConst.SettingsMode?;
return mode switch
{
MainConst.SettingsMode.BrowserPathMode => MainConst.FunctionButtonBrowserPathContent,
MainConst.SettingsMode.UpstreamUrlMode => MainConst.FunctionButtonUpstreamUrlContent,
MainConst.SettingsMode.ExtraArgsMode => MainConst.FunctionButtonExtraArgsContent,
_ => throw new UnreachableException()
};
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
}