disable voice
This commit is contained in:
@@ -22,6 +22,25 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
private bool isListening;
|
||||
[ObservableProperty]
|
||||
private string recognizedtext;
|
||||
[ObservableProperty]
|
||||
private string commandText;
|
||||
|
||||
[RelayCommand]
|
||||
private void Send()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(CommandText))
|
||||
{
|
||||
// Эмулируем распознанный текст для отображения в логе
|
||||
Recognizedtext = CommandText;
|
||||
|
||||
// Отправляем в селектор
|
||||
Selector.selector(CommandText);
|
||||
|
||||
// Очищаем поле ввода
|
||||
CommandText = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private Action<string>? _coreHandler;
|
||||
|
||||
partial void OnIsListeningChanged(bool value)
|
||||
|
||||
@@ -20,10 +20,26 @@
|
||||
<ToggleButton IsChecked="{Binding IsListening, Mode=TwoWay}"
|
||||
Content="Запуск асистента"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="10,0"
|
||||
/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid ColumnDefinitions="*, Auto" Margin="10,0,10,10">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{Binding CommandText}"
|
||||
Watermark="Введите команду (например: вижен погода)..."
|
||||
VerticalAlignment="Center">
|
||||
<TextBox.KeyBindings>
|
||||
<KeyBinding Gesture="Enter" Command="{Binding SendCommand}"/>
|
||||
</TextBox.KeyBindings>
|
||||
</TextBox>
|
||||
<Button Grid.Column="1"
|
||||
Content="Отправить"
|
||||
Command="{Binding SendCommand}"
|
||||
Margin="5,0,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<ScrollViewer Height="350" CornerRadius="5" Background="Black">
|
||||
<ScrollViewer Height="300" CornerRadius="5" Background="Black">
|
||||
<TextBlock Text="{Binding Recognizedtext}"
|
||||
TextWrapping="Wrap"
|
||||
Padding="10"
|
||||
|
||||
Reference in New Issue
Block a user