diff --git a/ChatAAC/Converters/StringToBitmapConverter.cs b/ChatAAC/Converters/StringToBitmapConverter.cs index 2e08ac7..17cfeb2 100644 --- a/ChatAAC/Converters/StringToBitmapConverter.cs +++ b/ChatAAC/Converters/StringToBitmapConverter.cs @@ -1,4 +1,3 @@ -using Avalonia; using Avalonia.Data.Converters; using Avalonia.Media.Imaging; using System; diff --git a/ChatAAC/Models/AiResponse.cs b/ChatAAC/Models/AiResponse.cs index 10a4497..36be443 100644 --- a/ChatAAC/Models/AiResponse.cs +++ b/ChatAAC/Models/AiResponse.cs @@ -2,14 +2,8 @@ namespace ChatAAC.Models; -public class AiResponse +public class AiResponse(string responseText) { - public string ResponseText { get; set; } - public DateTime Timestamp { get; set; } - - public AiResponse(string responseText) - { - ResponseText = responseText; - Timestamp = DateTime.Now; - } + public string ResponseText { get; set; } = responseText; + public DateTime Timestamp { get; set; } = DateTime.Now; } \ No newline at end of file diff --git a/ChatAAC/Models/Obf/Button.cs b/ChatAAC/Models/Obf/Button.cs index 72482f5..1f1a401 100644 --- a/ChatAAC/Models/Obf/Button.cs +++ b/ChatAAC/Models/Obf/Button.cs @@ -8,7 +8,7 @@ public class Button { [JsonPropertyName("id")] [JsonConverter(typeof(IntFromStringConverter))] - public int Id { get; set; } + public int? Id { get; set; } [JsonPropertyName("label")] public string Label { get; set; } = string.Empty; @@ -20,36 +20,9 @@ public class Button [JsonPropertyName("vocalization")] public string Vocalization { get; set; } = string.Empty; - [JsonPropertyName("load_board")] public LoadBoard? LoadBoard { get; set; } + [JsonPropertyName("load_board")] public LoadBoard? LoadBoard { get; set; } [JsonPropertyName("action")] public string Action { get; set; } = string.Empty; [JsonIgnore] public Image? Image { get; set; } - - private const int ImageWidth = 260; - private const int ImageHeight = 290; - - [JsonIgnore] - public int Width - { - get - { - var width = Image?.Width + 10; - if (width <= 10) width = ImageWidth; - if (width > ImageWidth) width = ImageWidth; - return width ?? ImageWidth; - } - } - - [JsonIgnore] - public int Height - { - get - { - var height = Image?.Height + 30; - if (height <= 30) height = ImageHeight; - if (height > ImageHeight) height = ImageHeight; - return height ?? ImageHeight; - } - } } \ No newline at end of file diff --git a/ChatAAC/Models/Obf/ObfFile.cs b/ChatAAC/Models/Obf/ObfFile.cs index 4bdf400..08a0b47 100644 --- a/ChatAAC/Models/Obf/ObfFile.cs +++ b/ChatAAC/Models/Obf/ObfFile.cs @@ -18,7 +18,7 @@ public class ObfFile [JsonPropertyName("description_html")] public string DescriptionHtml { get; set; } = string.Empty; - [JsonPropertyName("grid")] public Grid Grid { get; set; } = new(); + [JsonPropertyName("grid")] public Grid? Grid { get; set; } [JsonPropertyName("buttons")] public List