From 5d6ef1082fd7c87adfe50a254c7de40f83e6c367 Mon Sep 17 00:00:00 2001 From: Ionite Date: Fri, 2 Jun 2023 02:08:55 -0400 Subject: [PATCH] Add checkpoint manager page and models --- StabilityMatrix/CheckpointManagerPage.xaml | 84 +++++++++++++++++++ StabilityMatrix/CheckpointManagerPage.xaml.cs | 13 +++ StabilityMatrix/Models/CheckpointCard.cs | 16 ++++ .../Models/CheckpointFolderCard.cs | 19 +++++ .../ViewModels/CheckpointManagerViewModel.cs | 20 +++++ 5 files changed, 152 insertions(+) create mode 100644 StabilityMatrix/CheckpointManagerPage.xaml create mode 100644 StabilityMatrix/CheckpointManagerPage.xaml.cs create mode 100644 StabilityMatrix/Models/CheckpointCard.cs create mode 100644 StabilityMatrix/Models/CheckpointFolderCard.cs create mode 100644 StabilityMatrix/ViewModels/CheckpointManagerViewModel.cs diff --git a/StabilityMatrix/CheckpointManagerPage.xaml b/StabilityMatrix/CheckpointManagerPage.xaml new file mode 100644 index 00000000..a23bc221 --- /dev/null +++ b/StabilityMatrix/CheckpointManagerPage.xaml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StabilityMatrix/CheckpointManagerPage.xaml.cs b/StabilityMatrix/CheckpointManagerPage.xaml.cs new file mode 100644 index 00000000..3b254c79 --- /dev/null +++ b/StabilityMatrix/CheckpointManagerPage.xaml.cs @@ -0,0 +1,13 @@ +using System.Windows.Controls; +using StabilityMatrix.ViewModels; + +namespace StabilityMatrix; + +public partial class CheckpointManagerPage : Page +{ + public CheckpointManagerPage(CheckpointManagerViewModel viewModel) + { + InitializeComponent(); + DataContext = viewModel; + } +} diff --git a/StabilityMatrix/Models/CheckpointCard.cs b/StabilityMatrix/Models/CheckpointCard.cs new file mode 100644 index 00000000..9859575e --- /dev/null +++ b/StabilityMatrix/Models/CheckpointCard.cs @@ -0,0 +1,16 @@ +using System.Windows.Media.Imaging; +using CommunityToolkit.Mvvm.ComponentModel; + +namespace StabilityMatrix.Models; + +public partial class CheckpointCard : ObservableObject +{ + [ObservableProperty] + private BitmapImage? image; + + [ObservableProperty] + private string name; + + [ObservableProperty] + private string fileName; +} diff --git a/StabilityMatrix/Models/CheckpointFolderCard.cs b/StabilityMatrix/Models/CheckpointFolderCard.cs new file mode 100644 index 00000000..00059885 --- /dev/null +++ b/StabilityMatrix/Models/CheckpointFolderCard.cs @@ -0,0 +1,19 @@ +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; + +namespace StabilityMatrix.Models; + +public partial class CheckpointFolderCard : ObservableObject +{ + [ObservableProperty] + private string name; + + public ObservableCollection CheckpointCards { get; set; } = new() + { + new CheckpointCard + { + Name = "", + FileName = "", + } + }; +} diff --git a/StabilityMatrix/ViewModels/CheckpointManagerViewModel.cs b/StabilityMatrix/ViewModels/CheckpointManagerViewModel.cs new file mode 100644 index 00000000..3ab8f3a2 --- /dev/null +++ b/StabilityMatrix/ViewModels/CheckpointManagerViewModel.cs @@ -0,0 +1,20 @@ +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using StabilityMatrix.Models; + +namespace StabilityMatrix.ViewModels; + +public partial class CheckpointManagerViewModel : ObservableObject +{ + public ObservableCollection CheckpointFolderCards { get; set; } = new() + { + new() + { + Name = "Stable Diffusion" + }, + new() + { + Name = "Lora" + } + }; +}