using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Controls; using System.Windows; using System.ComponentModel; namespace BSE.CoverFlow.WPFLib { public class StartButton : Button { #region Events public event EventHandler<RoutedEventArgs> DisplayStateChanged; #endregion #region FieldsPublic public static readonly DependencyProperty DisplayStateProperty; #endregion #region Properties /// <summary> /// Gets the display state in which the button runs /// </summary> public DisplayState DisplayState { get { return (DisplayState)this.GetValue(DisplayStateProperty); } set { this.SetValue(DisplayStateProperty, value); OnDisplayStateChanged(this, new RoutedEventArgs()); } } #endregion #region MethodsPublic public StartButton() { this.DisplayState = DisplayState.None; } #endregion #region MethodsProtected /// <summary> /// Occurs when the value of the DisplayState property on this element changes. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">A RoutedEventArgs that contains the event data.</param> protected virtual void OnDisplayStateChanged(object sender, RoutedEventArgs e) { if (this.DisplayStateChanged != null) { this.DisplayStateChanged(sender, e); } } #endregion #region MethodsPrivate static StartButton() { DisplayStateProperty = DependencyProperty.Register( "DisplayState", typeof(DisplayState), typeof(StartButton), null); } #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)