protected override void OnKeyDown(KeyEventArgs e) { if (e.Key.Equals(Key.Enter)) { var tb = GetTemplateChild("EditText") as TextBox; if (tb != null) { SharedText = tb.Text; ItemEditCompleteEventArgs args = new ItemEditCompleteEventArgs(ItemEditCompleteEvent, SharedText); RaiseEvent(args); tb.Text = ""; } } else { base.OnKeyDown(e); } }
void button_Click(object sender, RoutedEventArgs e) { ItemEditCompleteEventArgs args = new ItemEditCompleteEventArgs(ItemDeleteEvent, SharedText); RaiseEvent(args); }