Skip to content

Instantly share code, notes, and snippets.

@davidalpert
Created June 23, 2011 15:12
Show Gist options
  • Save davidalpert/1042720 to your computer and use it in GitHub Desktop.
Save davidalpert/1042720 to your computer and use it in GitHub Desktop.
Abstracting WPF's TextCompositionEventArgs
public interface ITextCompositionEventArgs
{
string Text { get; }
bool Handled { get; set; }
}
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