You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.6 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Threading;
using System.Windows.Controls;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
using System.Reflection;
namespace Upgrade
{
public class ViewModelBase : INotifyPropertyChanged, IDisposable
{
public bool IsKeepInProcessVisibility { get; set; }
public bool DisabledShowDialogView { get; set; }
public UIElement SourceElement { get; set; }
public ViewModelBase()
{
IsKeepInProcessVisibility = false;
DisabledShowDialogView = false;
}
public virtual void InitializeParameters(object content = null)
{
}
protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
protected void OnPropertyChanged(PropertyInfo[] propertyNames)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
foreach (var s in propertyNames)
handler(this, new PropertyChangedEventArgs(s.Name));
}
}
public event PropertyChangedEventHandler PropertyChanged;
public void Dispose()
{
OnDispose();
}
protected virtual void OnDispose()
{
}
}
}