|
using System.Windows;
using MefBasic.Data;
namespace MefBasic
{
public abstract class APresenter<T>:DependencyNotifyObject, IPresenter<T> where T:IView
{
protected APresenter(T view)
{
View = view;
View.DataContext = this;
}
public T View
{
get { return (T)GetValue(ViewProperty); }
set { SetValue(ViewProperty, value); }
}
public static readonly DependencyProperty ViewProperty =
DependencyProperty.Register("View", typeof(T), typeof(APresenter<T>), new UIPropertyMetadata(null));
protected static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var presenter = (APresenter<T>)d;
presenter.DoPropertyChanged(e);
}
protected virtual void DoPropertyChanged(DependencyPropertyChangedEventArgs e)
{
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.