private void Accelerator_Invoked(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs args) { TextBox editCaptionBox = sender.GetValue(TextBoxProperty) as TextBox; string _number = editCaptionBox.Name.Replace("subtitleText", ""); TextBox editSubtitleBox = (TextBox)appendSubtitles.FindName("subtitleEdit" + _number); editSubtitleBox.Text = editCaptionBox.Text; foreach (var _ in lyrics) { if (_.id == int.Parse(_number)) { _.subtitle = editCaptionBox.Text; break; } } }
public static object GetCommandParameter(KeyboardAccelerator ka) => ka.GetValue(CommandParameterProperty);
public static ICommand GetCommand(KeyboardAccelerator ka) => ka.GetValue(CommandProperty) as ICommand;