//=============================================================================== // Goal Book. // Copyright © 2009 Mark Brownsword. //=============================================================================== #region Using Statements using GoalBook.Infrastructure; using System.ComponentModel; #endregion namespace GoalBook.Shell.Views { /// <summary> /// Presenter class for InternetDialogView. /// </summary> public class InternetDialogViewPresenter { #region Constants and Enums #endregion #region Inner Classes and Structures #endregion #region Delegates and Events #endregion #region Instance and Shared Fields #endregion #region Constructors /// <summary> /// Constructor. /// </summary> public InternetDialogViewPresenter(Proxy hostInfo) { //Initialise Model. Model = new InternetDialogViewPresentationModel(); Model.HostInfo = hostInfo; Model.HostInfo.PropertyChanged += new PropertyChangedEventHandler(HostInfo_PropertyChanged); } #endregion #region Properties /// <summary> /// Reference to Model. /// </summary> public InternetDialogViewPresentationModel Model { get; set; } /// <summary> /// Reference to View. /// </summary> public InternetDialogView View { get; set; } #endregion #region Private and Protected Methods #endregion #region Public and internal Methods /// <summary> /// Initialise the View. /// </summary> public void InitView() { View.DataContext = Model; } #endregion #region Event Handlers /// <summary> /// Handle HostInfo_PropertyChanged event. Raise event to the Dialog Window /// so the OK button is enabled when data is valid. /// </summary> private void HostInfo_PropertyChanged(object sender, PropertyChangedEventArgs e) { View.RaiseErrorInfoChanged(Model.HostInfo as IDataErrorInfo); } #endregion #region Base Class Overrides #endregion } }
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 article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)