Created
June 23, 2011 15:12
-
-
Save davidalpert/1042720 to your computer and use it in GitHub Desktop.
Abstracting WPF's TextCompositionEventArgs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ITextCompositionEventArgs | |
{ | |
string Text { get; } | |
bool Handled { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TextCompositionEventArgsWrapper : ITextCompositionEventArgs | |
{ | |
TextCompositionEventArgs innerArgs; | |
/// <summary> | |
/// Initializes a new instance of the TextCompositionEventArgsWrapper class. | |
/// </summary> | |
/// <param name="innerArgs"></param> | |
public TextCompositionEventArgsWrapper(TextCompositionEventArgs innerArgs) | |
{ | |
this.innerArgs = innerArgs; | |
} | |
public string Text { get { return innerArgs.Text; } } | |
public bool Handled | |
{ | |
get { return innerArgs.Handled; } | |
set { innerArgs.Handled = value; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment