|
@@ -15,6 +15,7 @@ using Avalonia.Controls.ApplicationLifetimes;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Collections.ObjectModel;
|
|
|
using System.Security.Policy;
|
|
|
+using Avalonia.Interactivity;
|
|
|
|
|
|
namespace AvaloniaApplication2.ViewModels
|
|
|
{
|
|
@@ -35,7 +36,7 @@ namespace AvaloniaApplication2.ViewModels
|
|
|
public UserProfileViewModel(int id)
|
|
|
{
|
|
|
GendersList = db.Genders.ToList();
|
|
|
- editedLogin = db.Logineds.Include(x => x.User.GenderNavigation).Include(x=>x.User.Idtraits).FirstOrDefault(x => x.User.IdUser == id);
|
|
|
+ editedLogin = db.Logineds.Include(x => x.User.GenderNavigation).Include(x=>x.User.Idtraits).Include(x=>x.User.Userimages).FirstOrDefault(x => x.User.IdUser == id);
|
|
|
imageUser = EditedLogin.User.Image != null ? new Bitmap(new MemoryStream(editedLogin.User.Image)) : new Bitmap("C:/Users/ЧернощековаАР/source/repos/AvaloniaApplication2/AvaloniaApplication2/Assets/профиль.png");
|
|
|
Images = new ObservableCollection<Bitmap>();
|
|
|
}
|
|
@@ -95,6 +96,8 @@ namespace AvaloniaApplication2.ViewModels
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void OpenImages() => MainWindowViewModel.Self.Page = new UsersGallary();
|
|
|
+
|
|
|
public void DeleteImage(int id)
|
|
|
{
|
|
|
Userimage deletedImage = db.Userimages.FirstOrDefault(x => x.Id == id);
|
|
@@ -102,5 +105,7 @@ namespace AvaloniaApplication2.ViewModels
|
|
|
db.SaveChanges();
|
|
|
MainWindowViewModel.Self.Page = new UsersGallary();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|