perf: update translate with lang switched

dev_split_view_vm
DESKTOP-3BO4HSG\ksat 2 years ago
parent 3ff1ee8816
commit ec7f7185b1

@ -102,6 +102,7 @@
<ComboBox x:Name="InCombo"
Style="{DynamicResource cmbstyle}"
ItemsSource="{Binding InputCombo}"
SelectionChanged="SelectionChanged"
SelectedItem="{Binding InputComboSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<Separator Margin="20,0"/>
<TextBlock Text="目标语言: "
@ -109,6 +110,7 @@
<ComboBox x:Name="OutCombo"
Style="{DynamicResource cmbstyle}"
ItemsSource="{Binding OutputCombo}"
SelectionChanged="SelectionChanged"
SelectedItem="{Binding OutputComboSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>

@ -301,5 +301,14 @@ namespace STranslate
private bool _IsTopmost { get; set; }
private readonly string _TopmostTemplateName = "ButtonTemplateTopmost";
private readonly string _UnTopmostTemplateName = "ButtonTemplateUnTopmost";
private void SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
if (!string.IsNullOrEmpty(vm?.InputTxt))
{
vm.IdentifyLanguage = string.Empty;
_ = vm?.Translate();
}
}
}
}
Loading…
Cancel
Save