-
Notifications
You must be signed in to change notification settings - Fork 809
Expand file tree
/
Copy pathChildWindowIconToRectangleStyleConverter.cs
More file actions
35 lines (31 loc) · 1.13 KB
/
ChildWindowIconToRectangleStyleConverter.cs
File metadata and controls
35 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using NETworkManager.Utilities;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace NETworkManager.Converters;
public sealed class ChildWindowIconToRectangleStyleConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is not ChildWindowIcon icon)
return null;
switch (icon)
{
case ChildWindowIcon.Info:
return Application.Current.FindResource("InfoImageRectangle");
case ChildWindowIcon.Question:
return Application.Current.FindResource("QuestionImageRectangle");
case ChildWindowIcon.Warn:
return Application.Current.FindResource("WarnImageRectangle");
case ChildWindowIcon.Error:
return Application.Current.FindResource("ErrorImageRectangle");
default:
return null;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}