chore: update view codes in vm

dev_ocr_translate
DESKTOP-3BO4HSG\ksat 2 years ago
parent 5c76a1df83
commit b08b5de6ff

@ -101,7 +101,6 @@
<!--input-->
<Grid x:Name="Input"
Grid.Row="1"
FocusManager.FocusedElement="{Binding ElementName=TextBoxInput}"
Margin="10,0,10,0">
<!--输入框-->
<Border x:Name="BorderInput"

@ -191,6 +191,8 @@ namespace STranslate.ViewModel
{
Mainwin.Show();
Mainwin.Activate();
//TODO: need to deal with this
//TextBoxInput.Focus();
(Mainwin.FindName("TextBoxInput") as System.Windows.Controls.TextBox).Focus();
}
/// <summary>
@ -209,8 +211,7 @@ namespace STranslate.ViewModel
ClearAll();
var sentence = GetWordsHelper.Get();
OpenMainWin();
(Mainwin.FindName("TextBoxInput") as System.Windows.Controls.TextBox)
.Text = sentence.Trim();
InputTxt = sentence.Trim();
_ = Translate();
}
/// <summary>
@ -228,7 +229,7 @@ namespace STranslate.ViewModel
public void ScreenShotTranslateEx(string text)
{
InputTranslate();
(Mainwin.FindName("TextBoxInput") as System.Windows.Controls.TextBox).Text = text;
InputTxt = text;
_ = Translate();
}

Loading…
Cancel
Save