|
|
|
|
@ -0,0 +1,40 @@ |
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel; |
|
|
|
|
using CommunityToolkit.Mvvm.Input; |
|
|
|
|
|
|
|
|
|
namespace MultiTerm.Protocols; |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Class that represents all connection settings for a specific <see cref="CommunicationProtocol"/>. |
|
|
|
|
/// Can be bound to UI using MVVM pattern. |
|
|
|
|
/// </summary> |
|
|
|
|
public abstract partial class ProtocolConnectionSettingsViewModel : ObservableObject |
|
|
|
|
{ |
|
|
|
|
/// <summary> |
|
|
|
|
/// Event that is thrown when the user requested to connect to the device with the entered settings. |
|
|
|
|
/// </summary> |
|
|
|
|
public event EventHandler? ConnectRequested; |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Event that is thrown when the user requested to disconnect from the device. |
|
|
|
|
/// </summary> |
|
|
|
|
public event EventHandler? DisconnectRequested; |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Indicates wether the settings can currently be edited. |
|
|
|
|
/// </summary> |
|
|
|
|
public bool AreEditable; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ObservableProperty] |
|
|
|
|
private string connectDisconnectButtonText = "Connect"; |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Binding to Connect/Disconnect button. |
|
|
|
|
/// Button text is provided in <see cref="ConnectDisconnectButtonText"/> |
|
|
|
|
/// </summary> |
|
|
|
|
[RelayCommand] |
|
|
|
|
private void ConnectDisconnect() |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |