|
// -------------------------------------------------------------------
// Member of the WPFSmartLibrary
// For more information see : (coming soon ...)
// (by DotNetMastermind)
//
// filename : TextBoxBaseManager.cs
// namespace : SoftArcs.WPFSmartLibrary.UIClassAttachedProperties
// class(es) : TextBoxBaseManager
//
// -------------------------------------------------------------------
using System.Windows;
using System.Windows.Controls.Primitives;
namespace SoftArcs.WPFSmartLibrary.UIClassAttachedProperties
{
public static class TextBoxBaseManager
{
#region DependencyProperty - AddAutoSelect ("bool")
public static bool GetAddAutoSelect(DependencyObject obj)
{
return (bool)obj.GetValue( AddAutoSelectProperty );
}
public static void SetAddAutoSelect(DependencyObject obj, bool value)
{
obj.SetValue( AddAutoSelectProperty, value );
}
public static readonly DependencyProperty AddAutoSelectProperty =
DependencyProperty.RegisterAttached( "AddAutoSelect", typeof( bool ),
typeof( TextBoxBaseManager ),
new UIPropertyMetadata( false,
new PropertyChangedCallback( OnAddAutoSelectChanged ) ) );
private static void OnAddAutoSelectChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
EventManager.RegisterClassHandler( typeof( TextBoxBase ), TextBoxBase.GotFocusEvent,
new RoutedEventHandler( TextBoxBase_GotFocus ) );
}
private static void TextBoxBase_GotFocus(object sender, RoutedEventArgs e)
{
(sender as TextBoxBase).SelectAll();
}
#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.
Experience:
More than 20 years with software design, architecture and development. More than 9 years with the .NET Framework.
Preferences:
C#, .NET 2.0, .NET 3.5, .NET 4.0, .NET 4.5, WPF (3, 4 and 4.5), MVVM, XAML, Silverlight, Windows Phone, Windows 8 Apps, ASP.NET, WCF, T-SQL and especially GUI-Development and GUI-Design.
I would say I am a dotNet Developer with a keen affinity for developing and enriching user interfaces.