mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
|
|
namespace GameRes.Formats.GUI
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for CreateXP3Widget.xaml
|
|
/// </summary>
|
|
public partial class CreateXP3Widget : Grid
|
|
{
|
|
public CreateXP3Widget ()
|
|
{
|
|
InitializeComponent ();
|
|
}
|
|
}
|
|
|
|
public class Xp3VersionConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
var val = (int)value;
|
|
switch (val)
|
|
{
|
|
case 1: return "1";
|
|
case 2: return "2";
|
|
case 3: return "Z";
|
|
default: throw new NotImplementedException();
|
|
}
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
var str = value.ToString();
|
|
switch (str)
|
|
{
|
|
case "1": return 1;
|
|
case "2": return 2;
|
|
case "Z": return 3;
|
|
default: throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|
|
}
|