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"> - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +