You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using MultiTerm.Protocols.Model;
|
|
|
|
namespace MultiTerm.Core.ViewModel;
|
|
|
|
public partial class DataViewModel : ObservableObject
|
|
{
|
|
/// <summary>
|
|
/// Identifier for the frontend to group lines.
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private int lineIdentifier;
|
|
|
|
/// <summary>
|
|
/// Object of data model.
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private ExtendedChar character;
|
|
|
|
/// <summary>
|
|
/// Property that hosts a displayable string of the character (UTF-16 encoded).
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private string displayStringUtf16 = String.Empty;
|
|
|
|
/// <summary>
|
|
/// Property that hosts a string of the character (hexadecimal format).
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private string displayStringHex = String.Empty;
|
|
|
|
/// <summary>
|
|
/// Property that hosts a string of the character (binary format).
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private string displayStringBin = String.Empty;
|
|
|
|
|
|
public DataViewModel(ExtendedChar character, int lineIdentifier)
|
|
{
|
|
this.character = character;
|
|
this.lineIdentifier = lineIdentifier;
|
|
this.DisplayStringUtf16 = character.ToUtf16String();
|
|
this.DisplayStringHex = character.ToHexString();
|
|
this.DisplayStringBin = character.ToBinaryString();
|
|
}
|
|
}
|
|
|