41 lines
1014 B
C#
41 lines
1014 B
C#
using System;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using VisionAsist.Models;
|
|
using VisionAsist.Views;
|
|
|
|
namespace VisionAsist.ViewModels;
|
|
|
|
public partial class MainWindowViewModel : ViewModelBase
|
|
{
|
|
[RelayCommand]
|
|
private void Settingse()
|
|
{
|
|
new Settings
|
|
{
|
|
DataContext = new SettingsViewModel()
|
|
}.Show();
|
|
}
|
|
|
|
[ObservableProperty]
|
|
private string commandLog = string.Empty;
|
|
|
|
[ObservableProperty]
|
|
private string commandText = string.Empty;
|
|
|
|
[RelayCommand]
|
|
private void Send()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(CommandText))
|
|
{
|
|
// Отображаем введенную команду в логе
|
|
CommandLog = CommandText;
|
|
|
|
// Отправляем в селектор
|
|
Selector.selector(CommandText);
|
|
|
|
// Очищаем поле ввода
|
|
CommandText = string.Empty;
|
|
}
|
|
}
|
|
} |