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.
46 lines
1.2 KiB
46 lines
1.2 KiB
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using MultiTerm.Protocols.Model;
|
|
|
|
namespace MultiTerm.Core.ViewModel;
|
|
|
|
public partial class CharacterDataViewModel : ObservableObject, IDataViewModel
|
|
{
|
|
/// <summary>
|
|
/// Object of data model.
|
|
/// </summary>
|
|
private readonly ExtendedChar character;
|
|
|
|
#region IDataViewModel Implementation
|
|
|
|
[ObservableProperty]
|
|
private int lineIdentifier;
|
|
|
|
[ObservableProperty]
|
|
private TimeOnly time;
|
|
|
|
[ObservableProperty]
|
|
private string displayString = String.Empty;
|
|
|
|
[ObservableProperty]
|
|
private string displayStringHex = String.Empty;
|
|
|
|
[ObservableProperty]
|
|
private string displayStringBin = String.Empty;
|
|
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// Allows access to character of this instance.
|
|
/// </summary>
|
|
public char Character { get { return this.character.Character; } }
|
|
|
|
public CharacterDataViewModel(ExtendedChar character, int lineIdentifier)
|
|
{
|
|
this.character = character;
|
|
this.lineIdentifier = lineIdentifier;
|
|
this.DisplayString = character.ToUtf16String();
|
|
this.DisplayStringHex = character.ToHexString();
|
|
this.DisplayStringBin = character.ToBinaryString();
|
|
this.Time = character.Time;
|
|
}
|
|
}
|
|
|