Click here to Skip to main content
15,886,199 members
Articles / Web Development / ASP.NET

MVC, MVP, ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.39/5 (18 votes)
31 Oct 2008CPOL12 min read 129.6K   338   98  
MVC Design pattern in comparison with MVP in the ASP.NET world
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Collections;
using System.ComponentModel;
using WpfMvc.Controllers;
using WpfMvc.Models;

namespace WpfMvc.Views
{
    /// <summary>
    /// The list of methods and properties of the Window 
    /// shame (and strange) is that this is not provided by default in .NET 3.0
    /// </summary>
    public interface IWindowBase
    {
        IControllerBase Controller { get; }
        IModelBase      Model      { get; }

        #region Window WPF object
        /// <summary>
        /// Gets or sets a value that indicates whether a window's client area supports
        /// transparency. This is a dependency property.
        /// </summary>
        bool AllowsTransparency { get; set; }

        /// <summary>
        /// Gets or sets the dialog result value, which is the value that is returned
        /// from the System.Windows.Window.ShowDialog() method.
        /// </summary>
        bool? DialogResult { get; set; }

        /// <summary>
        /// Gets a value that indicates whether the window is active. This is a dependency
        /// property.
        /// </summary>
        bool IsActive { get; }

        /// <summary>
        /// Gets or sets the position of the window's left edge, in relation to the desktop.
        /// This is a dependency property.
        /// </summary>
        double Left { get; set; }

        /// <summary>
        /// Gets a collection of windows for which this window is the owner.
        /// </summary>
        WindowCollection OwnedWindows { get; }

        /// <summary>
        /// Gets or sets the resize mode. This is a dependency property.
        /// </summary>
        ResizeMode ResizeMode { get; set; }

        /// <summary>
        /// Gets or sets a value that indicates whether a window is activated when first
        /// shown. This is a dependency property.
        /// </summary>        
        bool ShowActivated { get; set; }

        /// <summary>
        /// Gets or sets a value that indicates whether the window has a task bar button.
        /// This is a dependency property.
        /// </summary>
        bool ShowInTaskbar { get; set; }

        /// <summary>
        /// Gets or sets a value that indicates whether a window will automatically size
        /// itself to fit the size of its content. This is a dependency property.
        /// </summary>
        SizeToContent SizeToContent { get; set; }

        /// <summary>
        /// Gets or sets a window's title. This is a dependency property.
        /// </summary>
        string Title { get; set; }

        /// <summary>
        /// Gets or sets the position of the window's top edge, in relation to the desktop.
        /// This is a dependency property.
        /// </summary>
        double Top { get; set; }

        /// <summary>
        /// Gets or sets a value that indicates whether a window appears in the topmost
        /// z-order. This is a dependency property.
        /// </summary>
        bool Topmost { get; set; }

        /// <summary>
        /// Gets or sets the position of the window when first shown.
        /// </summary>
        WindowStartupLocation WindowStartupLocation { get; set; }

        /// <summary>
        /// Gets or sets a value that indicates whether a window is restored, minimized,
        /// or maximized. This is a dependency property.
        /// </summary>
        WindowState WindowState { get; set; }

        /// <summary>
        /// Gets or sets a window's border style. This is a dependency property.
        /// </summary>
        WindowStyle WindowStyle { get; set; }

        /// <summary>
        ///  Occurs when a window becomes the foreground window.
        /// </summary>
        event EventHandler Activated;

        /// <summary>
        /// Occurs when the window as about to close.
        /// </summary>
        event EventHandler Closed;

        /// <summary>
        /// Occurs directly after System.Windows.Window.Close() is called, and can be
        /// handled to cancel window closure.
        /// </summary>
        event CancelEventHandler Closing;

        /// <summary>
        /// Occurs after a window's content has been rendered.
        /// </summary>
        event EventHandler ContentRendered;

        /// <summary>
        /// Occurs when a window becomes a background window.
        /// </summary>
        event EventHandler Deactivated;

        /// <summary>
        ///Occurs when the window's location changes.
        /// </summary>
        event EventHandler LocationChanged;

        /// <summary>
        /// This event is raised to support interoperation with Win32. See System.Windows.Interop.HwndSource.
        /// </summary>
        event EventHandler SourceInitialized;

        /// <summary>
        /// Occurs when the window's System.Windows.Window.WindowState property changes.
        /// </summary>
        event EventHandler StateChanged;

        /// <summary>
        ///     Attempts to bring the window to the foreground and activates it.
        /// </summary>
        /// <returns></returns>
        bool Activate();

        /// <summary>
        ///     Manually closes a System.Windows.Window.
        /// </summary>
        void Close();

        /// <summary>
        /// Allows a window to be dragged by a mouse with its left button down over an
        /// exposed area of the window's client area.
        /// </summary>
        void DragMove();

        /// <summary>
        /// Opens a window and returns without waiting for the newly opened window to
        /// close.
        /// </summary>
        void Show();

        /// <summary>
        /// Opens a window and returns only when the newly opened window is closed.
        /// </summary>
        /// <returns></returns>
        bool? ShowDialog();

        #endregion Window WPF object
    }
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Czech Republic Czech Republic
Web developer since 2002, .NET since 2005

Competition is as important as Cooperation.

___

Comments and Discussions