using Common;
using Common.AppSettings;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using MultiTerm.Core.Model;
using MultiTerm.Core.Types;
using System.Diagnostics;
namespace MultiTerm.Core.ViewModel;
public partial class SendReceiveViewModel : TerminalViewModel
{
public override TerminalViewType ViewType => TerminalViewType.SendReceive;
///
/// Send data model.
///
[ObservableProperty]
private MultiFormatString sendData = new();
///
/// Temporary sent data property, for testing purposes.
///
[ObservableProperty]
private string sentData = string.Empty;
///
/// Constructor.
///
///
public SendReceiveViewModel(IAppSettingsProvider appSettings, IMessenger messenger, IContext context) : base(appSettings, messenger, context) { }
///
/// Send command.
///
[RelayCommand]
private void Send()
{
// Temp
var items = this.CommunicationData.SelectedReceivedData;
Debugger.Break();
this.SentData = this.SendData.ToString();
// send data
this.SendToCommunicationProtocol(this.SendData.ToString());
// clear textbox
this.SendData = new MultiFormatString();
}
}