mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-08-14 15:23:08 +00:00
28 lines
811 B
C#
28 lines
811 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Windows.Data;
|
|
using System.Windows.Media.Imaging;
|
|
using NebulaAuth.Model;
|
|
|
|
namespace NebulaAuth.Converters.Background;
|
|
|
|
public class BackgroundSourceConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is BackgroundMode.Custom)
|
|
{
|
|
if(File.Exists("Background.png"))
|
|
return new BitmapImage(new Uri(Path.GetFullPath("Background.png")));
|
|
}
|
|
|
|
|
|
return new BitmapImage(new Uri("pack://application:,,,/Theme/Background.jpg"));
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
} |