summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Componentes/CustomSeriesViewModel.cs
blob: 30af3ef55e2db03fd7786de6a04e40ef5cc12de3 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Media;
using LiveCharts.Definitions.Series;
using LiveCharts.Wpf;

namespace Gestor.Application.Componentes;

public class CustomSeriesViewModel : INotifyPropertyChanged
{
	public string Title => SeriesViewModel.Title;

	public Brush Fill => SeriesViewModel.Fill ?? SeriesViewModel.Stroke;

	public SeriesViewModel SeriesViewModel { get; }

	public ISeriesView View { get; }

	public bool IsVisible
	{
		get
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			return (int)((UIElement)View).Visibility == 0;
		}
		set
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			if (IsVisible != value)
			{
				((UIElement)View).Visibility = (Visibility)(!value);
				OnPropertyChanged("IsVisible");
			}
		}
	}

	public event PropertyChangedEventHandler PropertyChanged;

	public CustomSeriesViewModel(SeriesViewModel svm, ISeriesView view)
	{
		SeriesViewModel = svm;
		View = view;
	}

	protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = "")
	{
		if (this.PropertyChanged != null)
		{
			this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
}