From f8ea7f147fa80c7e2c1aa823b42376ac6747b1fe Mon Sep 17 00:00:00 2001 From: ByoungGyu Lee Date: Sat, 17 Jun 2023 00:31:34 +0900 Subject: [PATCH] update input text error --- DeleteNewline/View/Page_InputText.xaml.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/DeleteNewline/View/Page_InputText.xaml.cs b/DeleteNewline/View/Page_InputText.xaml.cs index a11d9cd..52c2eab 100644 --- a/DeleteNewline/View/Page_InputText.xaml.cs +++ b/DeleteNewline/View/Page_InputText.xaml.cs @@ -9,7 +9,6 @@ public partial class Page_InputText { public static Page_InputText? instance; ViewModel_Page_InputText vm_Input; - ViewModel_Page_Setting settings = ViewModel_Page_Setting.page_settings; public Page_InputText() { @@ -30,8 +29,11 @@ private void MenuItem_Paste_Click(object sender, RoutedEventArgs e) { originalText = (string)idataObj.GetData(DataFormats.Text); TextBox_Main.AppendText(originalText); - Clipboard.SetDataObject(clipboardManager.applyRegex(ref idataObj, - settings.text_textBox_regexExpression, settings.text_textBox_regexReplace).ToString()); + + (var success, var replaceText) = clipboardManager.applyRegex(ref idataObj, + ViewModel_Page_Setting.page_settings.text_textBox_regexExpression, + ViewModel_Page_Setting.page_settings.text_textBox_regexReplace); + Clipboard.SetDataObject(replaceText); } else { @@ -46,8 +48,11 @@ private void TextBox_Main_KeyUp(object sender, KeyEventArgs e) { if (clipboardManager.GetClipboardText(ref idataObj) == true) { - Clipboard.SetDataObject(clipboardManager.applyRegex(ref idataObj, - settings.text_textBox_regexExpression, settings.text_textBox_regexReplace).ToString()); + (var success, var replaceText) = clipboardManager.applyRegex(ref idataObj, + ViewModel_Page_Setting.page_settings.text_textBox_regexExpression, + ViewModel_Page_Setting.page_settings.text_textBox_regexReplace); + + Clipboard.SetDataObject(replaceText); } else {