From 161370e4ce21e98cb5522ede09708ae063828361 Mon Sep 17 00:00:00 2001 From: Ankitkumar Satapara Date: Sat, 18 Apr 2026 18:42:52 +0530 Subject: [PATCH] Added different startup screen and ability to open and save project into files --- Examples/Nodify.Calculator/App.xaml | 2 +- Examples/Nodify.Calculator/LiteDBHelper.cs | 3 +- Examples/Nodify.Calculator/MainWindow.xaml | 2 +- .../Nodify.Calculator/NewProjectDialog.xaml | 48 ++++++++++++++++ .../NewProjectDialog.xaml.cs | 56 +++++++++++++++++++ .../Nodify.Calculator.csproj | 1 + .../OperationsMenuViewModel.cs | 2 +- Examples/Nodify.Calculator/ProjectManager.cs | 36 ++++++++++++ Examples/Nodify.Calculator/StartupWindow.xaml | 39 +++++++++++++ .../Nodify.Calculator/StartupWindow.xaml.cs | 50 +++++++++++++++++ 10 files changed, 234 insertions(+), 5 deletions(-) create mode 100644 Examples/Nodify.Calculator/NewProjectDialog.xaml create mode 100644 Examples/Nodify.Calculator/NewProjectDialog.xaml.cs create mode 100644 Examples/Nodify.Calculator/ProjectManager.cs create mode 100644 Examples/Nodify.Calculator/StartupWindow.xaml create mode 100644 Examples/Nodify.Calculator/StartupWindow.xaml.cs diff --git a/Examples/Nodify.Calculator/App.xaml b/Examples/Nodify.Calculator/App.xaml index 083121d..df10e7a 100644 --- a/Examples/Nodify.Calculator/App.xaml +++ b/Examples/Nodify.Calculator/App.xaml @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:nodify="https://miroiu.github.io/nodify" - StartupUri="MainWindow.xaml"> + StartupUri="StartupWindow.xaml"> diff --git a/Examples/Nodify.Calculator/LiteDBHelper.cs b/Examples/Nodify.Calculator/LiteDBHelper.cs index 950bb74..7e7dee9 100644 --- a/Examples/Nodify.Calculator/LiteDBHelper.cs +++ b/Examples/Nodify.Calculator/LiteDBHelper.cs @@ -6,17 +6,16 @@ using System.Linq.Expressions; public class LiteDbHelper : IDisposable where T : class { - private string dbPath = @"MyData.db"; private readonly LiteDatabase _database; private readonly ILiteCollection _collection; /// /// Initializes a new instance of the LiteDbHelper class. /// - /// The path to the LiteDB database file. /// The name of the collection to work with. public LiteDbHelper(string collectionName) { + var dbPath = Nodify.Calculator.ProjectManager.DatabasePath; _database = new LiteDatabase(dbPath); _collection = _database.GetCollection(collectionName); } diff --git a/Examples/Nodify.Calculator/MainWindow.xaml b/Examples/Nodify.Calculator/MainWindow.xaml index 257e3e3..3990ccd 100644 --- a/Examples/Nodify.Calculator/MainWindow.xaml +++ b/Examples/Nodify.Calculator/MainWindow.xaml @@ -71,7 +71,7 @@ diff --git a/Examples/Nodify.Calculator/NewProjectDialog.xaml b/Examples/Nodify.Calculator/NewProjectDialog.xaml new file mode 100644 index 0000000..ff6a7d3 --- /dev/null +++ b/Examples/Nodify.Calculator/NewProjectDialog.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + +