Skip to content

Commit

Permalink
update input text error
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyp9715 committed Jun 16, 2023
1 parent 6df2a6d commit f8ea7f1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions DeleteNewline/View/Page_InputText.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down

0 comments on commit f8ea7f1

Please sign in to comment.