From 6a181d1a05540e954a0825524f15a945ac6d3153 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 25 Apr 2025 14:46:43 +0300 Subject: [PATCH] saveWithoutImage;botStackPanel --- Voroncov2103/EditAgentWindow.axaml.cs | 19 ++- Voroncov2103/MainWindow.axaml | 152 +++++++++--------- Voroncov2103/MainWindow.axaml.cs | 4 +- .../bin/Debug/net8.0/Voroncov2103.dll | Bin 101376 -> 101376 bytes .../bin/Debug/net8.0/Voroncov2103.pdb | Bin 34916 -> 35144 bytes .../129c32b3-9c75-4e92-80b3-b1c040c47da8.jpg | Bin 0 -> 35310 bytes .../fc28b04d-6ae5-4224-9702-c78605b53557.jpg | Bin 0 -> 35310 bytes .../Debug/net8.0/Avalonia/Voroncov2103.dll | Bin 101376 -> 101376 bytes .../Debug/net8.0/Avalonia/Voroncov2103.pdb | Bin 34916 -> 35144 bytes .../obj/Debug/net8.0/Avalonia/resources | Bin 13854 -> 11870 bytes .../Debug/net8.0/Voroncov2103.AssemblyInfo.cs | 2 +- .../Voroncov2103.AssemblyInfoInputs.cache | 2 +- .../obj/Debug/net8.0/Voroncov2103.dll | Bin 88064 -> 86528 bytes .../obj/Debug/net8.0/Voroncov2103.pdb | Bin 32356 -> 32616 bytes .../obj/Debug/net8.0/ref/Voroncov2103.dll | Bin 22528 -> 22528 bytes .../net8.0/refint/Avalonia/Voroncov2103.dll | Bin 22528 -> 22528 bytes .../obj/Debug/net8.0/refint/Voroncov2103.dll | Bin 23040 -> 23040 bytes 17 files changed, 95 insertions(+), 84 deletions(-) create mode 100644 Voroncov2103/bin/Debug/net8.0/agents/129c32b3-9c75-4e92-80b3-b1c040c47da8.jpg create mode 100644 Voroncov2103/bin/Debug/net8.0/agents/fc28b04d-6ae5-4224-9702-c78605b53557.jpg diff --git a/Voroncov2103/EditAgentWindow.axaml.cs b/Voroncov2103/EditAgentWindow.axaml.cs index 88748ed..9e38300 100644 --- a/Voroncov2103/EditAgentWindow.axaml.cs +++ b/Voroncov2103/EditAgentWindow.axaml.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Linq; using System.Threading.Tasks; using Avalonia; @@ -70,8 +71,10 @@ public partial class EditAgentWindow : Window if (string.IsNullOrEmpty(EmailTextBox.Text)) return; agentPresenter.Email = EmailTextBox.Text; - if (String.IsNullOrEmpty(PathToImage)) return; - agentPresenter.Logo = PathToImage; + if (!string.IsNullOrEmpty(PathToImage)) + { + agentPresenter.Logo = PathToImage; + } Close(agentPresenter); } @@ -107,6 +110,18 @@ public partial class EditAgentWindow : Window DirectorNameTextBox.Text = agentPresenter.DirectorName; PhoneTextBox.Text = agentPresenter.Phone; EmailTextBox.Text = agentPresenter.Email; + + if (!string.IsNullOrEmpty(agentPresenter.Logo)) + { + string imagePath = Path.Combine(Environment.CurrentDirectory, agentPresenter.Logo); + + if (File.Exists(imagePath)) + { + var bitmap = new Bitmap(imagePath); + LogoImage.Source = bitmap; + PathToImage = agentPresenter.Logo; + } + } switch (agentPresenter.AgentTypeId) { diff --git a/Voroncov2103/MainWindow.axaml b/Voroncov2103/MainWindow.axaml index 33ba3cb..8bd8f73 100644 --- a/Voroncov2103/MainWindow.axaml +++ b/Voroncov2103/MainWindow.axaml @@ -6,82 +6,78 @@ x:Class="Voroncov2103.MainWindow" x:CompileBindings="False" Title="Voroncov2103"> - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +