diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml
index 851e1f3..e1316cb 100644
--- a/.gitea/workflows/build.yml
+++ b/.gitea/workflows/build.yml
@@ -5,13 +5,13 @@ on:
branches:
- "dev"
paths:
- - "SimpleToolkit.MVVM**"
+ - "MSEssentials.UI.Common.MVVM**"
pull_request:
branches:
- "dev"
- "main"
paths:
- - "SimpleToolkit.MVVM**"
+ - "MSEssentials.UI.Common.MVVM**"
jobs:
build:
diff --git a/.gitea/workflows/build_publish.yml b/.gitea/workflows/build_publish.yml
index a5b88ea..4c52617 100644
--- a/.gitea/workflows/build_publish.yml
+++ b/.gitea/workflows/build_publish.yml
@@ -8,7 +8,7 @@ on:
branches:
- "main"
paths:
- - "SimpleToolkit.MVVM**"
+ - "MSEssentials.UI.Common.MVVM**"
jobs:
build:
@@ -66,7 +66,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: nuget
- path: ./SimpleToolkit.MVVM.${{needs.version.outputs.version}}.nupkg
+ path: ./MSEssentials.UI.Common.MVVM.${{needs.version.outputs.version}}.nupkg
outputs:
version: ${{needs.version.outputs.version}}
publish:
@@ -84,11 +84,11 @@ jobs:
with:
dotnet-version: 8.0.x
- name: Publish
- run: dotnet nuget push ./SimpleToolkit.MVVM.${{needs.pack.outputs.version}}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }}
+ run: dotnet nuget push ./MSEssentials.UI.Common.MVVM.${{needs.pack.outputs.version}}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }}
- name: Create Release
uses: akkuman/gitea-release-action@v1
with:
tag_name: ${{needs.pack.outputs.version}}
name: ${{needs.pack.outputs.version}}
files: |-
- SimpleToolkit.MVVM.${{needs.pack.outputs.version}}.nupkg
\ No newline at end of file
+ MSEssentials.UI.Common.MVVM.${{needs.pack.outputs.version}}.nupkg
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index d28fc4c..215bccb 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2026 SimpleToolkit
+Copyright (c) 2026 Mateusz Skoczek
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
diff --git a/SimpleToolkit.MVVM.sln b/MSEssentials.UI.Common.MVVM.sln
similarity index 77%
rename from SimpleToolkit.MVVM.sln
rename to MSEssentials.UI.Common.MVVM.sln
index beec001..b233145 100644
--- a/SimpleToolkit.MVVM.sln
+++ b/MSEssentials.UI.Common.MVVM.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleToolkit.MVVM", "SimpleToolkit.MVVM\SimpleToolkit.MVVM.csproj", "{7B017D3C-E116-20B5-21F7-692316023149}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSEssentials.UI.Common.MVVM", "MSEssentials.UI.Common.MVVM\MSEssentials.UI.Common.MVVM.csproj", "{7B017D3C-E116-20B5-21F7-692316023149}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/SimpleToolkit.MVVM/SimpleToolkit.MVVM.csproj b/MSEssentials.UI.Common.MVVM/MSEssentials.UI.Common.MVVM.csproj
similarity index 67%
rename from SimpleToolkit.MVVM/SimpleToolkit.MVVM.csproj
rename to MSEssentials.UI.Common.MVVM/MSEssentials.UI.Common.MVVM.csproj
index fb23d1b..f61e9cd 100644
--- a/SimpleToolkit.MVVM/SimpleToolkit.MVVM.csproj
+++ b/MSEssentials.UI.Common.MVVM/MSEssentials.UI.Common.MVVM.csproj
@@ -3,13 +3,13 @@
net8.0
enable
enable
-
SimpleToolkit.MVVM
+ MSEssentials.UI.Common.MVVM
Mateusz Skoczek
Mateusz Skoczek
- https://repos.mateuszskoczek.com/SimpleToolkit/
- https://repos.mateuszskoczek.com/SimpleToolkit/SimpleToolkit.MVVM/src/branch/main/LICENSE
+ https://repos.mateuszskoczek.com/MSEssentials/
+ https://repos.mateuszskoczek.com/MSEssentials/MSEssentials.UI.Common.MVVM/src/branch/main/LICENSE
icon.png
- https://repos.mateuszskoczek.com/SimpleToolkit/SimpleToolkit.MVVM
+ https://repos.mateuszskoczek.com/MSEssentials/MSEssentials.UI.Common.MVVM
Set of helpers, class extensions, UI controls used in my other C# projects - MVVM architecture models and helper classes
README.md
diff --git a/MSEssentials.UI.Common.MVVM/NavigationViewItem.cs b/MSEssentials.UI.Common.MVVM/NavigationViewItem.cs
new file mode 100644
index 0000000..ed64392
--- /dev/null
+++ b/MSEssentials.UI.Common.MVVM/NavigationViewItem.cs
@@ -0,0 +1,8 @@
+namespace MSEssentials.UI.Common.MVVM;
+
+public class NavigationViewItem
+{
+ public string Name { get; set; }
+ public string IconSource { get; set; }
+ public Type ViewModel { get; set; }
+}
\ No newline at end of file
diff --git a/SimpleToolkit.MVVM/ObservableDictionary.cs b/MSEssentials.UI.Common.MVVM/ObservableDictionary.cs
similarity index 76%
rename from SimpleToolkit.MVVM/ObservableDictionary.cs
rename to MSEssentials.UI.Common.MVVM/ObservableDictionary.cs
index 9c5f43b..9061410 100644
--- a/SimpleToolkit.MVVM/ObservableDictionary.cs
+++ b/MSEssentials.UI.Common.MVVM/ObservableDictionary.cs
@@ -1,37 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
+using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-namespace SimpleToolkit.MVVM
+namespace MSEssentials.UI.Common.MVVM
{
public class ObservableDictionary : ObservableCollection>, IDictionary, IEnumerable>
{
- #region PROPERTIES
-
public ICollection Keys => Items.Select(p => p.Key).ToList();
public ICollection Values => Items.Select(p => p.Value).ToList();
public bool IsReadOnly => false;
- #endregion
-
-
-
- #region INDEXERS
-
+
public TValue this[TKey key]
{
- get
- {
- if (!TryGetValue(key, out TValue result))
- {
- throw new ArgumentException("Key not found");
- }
- return result;
- }
+ get => !TryGetValue(key, out TValue result) ? throw new ArgumentException("Key not found") : result;
set
{
if (ContainsKey(key))
@@ -45,16 +26,11 @@ namespace SimpleToolkit.MVVM
}
}
- #endregion
-
-
-
- #region CONSTRUCTORS
-
- public ObservableDictionary() : base()
+
+ public ObservableDictionary()
{ }
- public ObservableDictionary(IDictionary dictionary) : base()
+ public ObservableDictionary(IDictionary dictionary)
{
foreach (KeyValuePair pair in dictionary)
{
@@ -62,12 +38,8 @@ namespace SimpleToolkit.MVVM
}
}
- #endregion
-
-
-
- #region PUBLIC METHODS
-
+
+ public void Add(KeyValuePair item) => Add(item.Key, item.Value);
public void Add(TKey key, TValue value)
{
if (ContainsKey(key))
@@ -77,8 +49,6 @@ namespace SimpleToolkit.MVVM
Add(new ObservableKeyValuePair(key, value));
}
- public void Add(KeyValuePair item) => Add(item.Key, item.Value);
-
public bool Contains(KeyValuePair item)
{
ObservableKeyValuePair pair = GetKeyValuePairByTheKey(item.Key);
@@ -96,20 +66,8 @@ namespace SimpleToolkit.MVVM
return !Equals(default(ObservableKeyValuePair), pair);
}
- public void CopyTo(KeyValuePair[] array, int arrayIndex)
- {
+ public void CopyTo(KeyValuePair[] array, int arrayIndex) =>
throw new NotImplementedException();
- }
-
- public bool Remove(TKey key)
- {
- List> remove = ((ObservableCollection>)this).Where(pair => Equals(key, pair.Key)).ToList();
- foreach (ObservableKeyValuePair pair in remove)
- {
- Remove(pair);
- }
- return remove.Count > 0;
- }
public bool Remove(KeyValuePair item)
{
@@ -124,6 +82,16 @@ namespace SimpleToolkit.MVVM
}
return Remove(pair);
}
+
+ public bool Remove(TKey key)
+ {
+ List> remove = ((ObservableCollection>)this).Where(pair => Equals(key, pair.Key)).ToList();
+ foreach (ObservableKeyValuePair pair in remove)
+ {
+ Remove(pair);
+ }
+ return remove.Count > 0;
+ }
public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
{
@@ -137,16 +105,11 @@ namespace SimpleToolkit.MVVM
return true;
}
- IEnumerator> IEnumerable>.GetEnumerator() => ((ObservableCollection>)this).Select(i => new KeyValuePair(i.Key, i.Value)).GetEnumerator();
+ IEnumerator> IEnumerable>.GetEnumerator() =>
+ ((ObservableCollection>)this).Select(i => new KeyValuePair(i.Key, i.Value)).GetEnumerator();
- #endregion
-
-
-
- #region PRIVATE METHODS
-
- private ObservableKeyValuePair GetKeyValuePairByTheKey(TKey key) => ((ObservableCollection>)this).FirstOrDefault(i => i.Key.Equals(key));
-
- #endregion
+
+ private ObservableKeyValuePair GetKeyValuePairByTheKey(TKey key) =>
+ ((ObservableCollection>)this).FirstOrDefault(i => i.Key.Equals(key));
}
}
diff --git a/SimpleToolkit.MVVM/ObservableKeyValuePair.cs b/MSEssentials.UI.Common.MVVM/ObservableKeyValuePair.cs
similarity index 80%
rename from SimpleToolkit.MVVM/ObservableKeyValuePair.cs
rename to MSEssentials.UI.Common.MVVM/ObservableKeyValuePair.cs
index 702b64c..8ab991c 100644
--- a/SimpleToolkit.MVVM/ObservableKeyValuePair.cs
+++ b/MSEssentials.UI.Common.MVVM/ObservableKeyValuePair.cs
@@ -5,21 +5,14 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace SimpleToolkit.MVVM
+namespace MSEssentials.UI.Common.MVVM
{
public class ObservableKeyValuePair : INotifyPropertyChanged
{
- #region FIELDS
-
private TKey _key;
private TValue _value;
- #endregion
-
-
-
- #region PROPERTIES
-
+
public TKey Key
{
get => _key;
@@ -38,12 +31,7 @@ namespace SimpleToolkit.MVVM
NotifyPropertyChanged(nameof(Value));
}
}
-
- #endregion
-
-
-
- #region CONSTRUCTORS
+
public ObservableKeyValuePair() : this(default, default)
{ }
@@ -54,22 +42,10 @@ namespace SimpleToolkit.MVVM
_value = value;
}
- #endregion
-
-
-
- #region PRIVATE METHODS
-
+
private void NotifyPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- #endregion
-
-
-
- #region EVENTS
-
+
public event PropertyChangedEventHandler? PropertyChanged;
-
- #endregion
}
}
diff --git a/MSEssentials.UI.Common.MVVM/README.md b/MSEssentials.UI.Common.MVVM/README.md
new file mode 100644
index 0000000..35cac0e
--- /dev/null
+++ b/MSEssentials.UI.Common.MVVM/README.md
@@ -0,0 +1,51 @@
+# MSEssentials.UI.Common.MVVM
+
+### Set of helpers, class extensions, UI controls used in my other C# projects
+
+MSEssentials is package of useful classes, helpers, extensions and UI controls, I use in my C# projects. MVVM subpackage contains class, method and property MVVM.
+
+---
+
+## NuGet registry status
+
+| Subpackage | Status |
+|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **MSEssentials.UI.Common.MVVM** | [](https://www.nuget.org/packages/MSEssentials.UI.Common.MVVM/) |
+| MSEssentials.Extensions | [](https://www.nuget.org/packages/MSEssentials.Extensions/) |
+| MSEssentials.AspNetCore.Attributes | [](https://www.nuget.org/packages/MSEssentials.AspNetCore.Attributes/) |
+| MSEssentials.UI.Common.Converters | [](https://www.nuget.org/packages/MSEssentials.UI.Common.Converters/) |
+| MSEssentials.UI.WinUI.Behaviors | [](https://www.nuget.org/packages/MSEssentials.UI.WinUI.Behaviors/) |
+| MSEssentials.UI.WinUI.Converters | [](https://www.nuget.org/packages/MSEssentials.UI.WinUI.Converters/) |
+| MSEssentials.UI.WinUI.Controls | [](https://www.nuget.org/packages/MSEssentials.UI.WinUI.Controls/) |
+
+## Features
+
+- **ObservableKeyValuePair** - observable version of KeyValuePair
+- **ObservableDictionary** - observable version of Dictionary
+- **NavigationViewItem** - list item model (for example for navigation controls), allows to bind item to view model
+
+## Installation and usage
+
+You can download package from official NuGet registry or .nupkg file itself from Releases tab.
+
+**CLI:**
+
+```
+dotnet add package MSEssentials.UI.Common.MVVM
+```
+
+**Package reference in .csproj file:**
+
+```
+
+```
+
+## Attribution and contribution
+
+This project is open source on MIT License, so you can just copy and upload again to your repository. But according to the license, you must include information about the original author. You can find license [here](https://repos.mateuszskoczek.com/MSEssentials/MSEssentials.UI.Common.MVVM/src/branch/main/LICENSE).
+
+However, the preferred way to contribute would be to propose improvements in a pull request, through issues, or through other means of communication.
+
+**Other sources:**
+
+- Icon by [Icons8](icons8.com)
\ No newline at end of file
diff --git a/SimpleToolkit.MVVM/icon.png b/MSEssentials.UI.Common.MVVM/icon.png
similarity index 100%
rename from SimpleToolkit.MVVM/icon.png
rename to MSEssentials.UI.Common.MVVM/icon.png
diff --git a/README.md b/README.md
index 4f28818..2a2ae43 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@

-SimpleToolkit.MVVM
+MSEssentials.UI.Common.MVVM
Set of helpers, class extensions, UI controls used in my other C# projects
-SimpleToolkit is package of useful classes, helpers, extensions and UI controls, I use in my C# projects. MVVM subpackage contains models and helper classes for implementing MVVM architecture.
+MSEssentials is package of useful classes, helpers, extensions and UI controls, I use in my C# projects. MVVM subpackage contains models and helper classes for implementing MVVM architecture.
---
@@ -13,7 +13,7 @@
> [!Important]
> **For Github users:**
>
-> This is only mirror repository. All changes are first uploaded to the repository here. Releases are also published on original repository. However, Github repository handles issues and pull requests for better accessibility.
+> This is only mirror repository. All changes are first uploaded to the repository here. Releases are also published on original repository. However, Github repository handles issues and pull requests for better accessibility.
## NuGet registry status
@@ -28,10 +28,10 @@
|
- SimpleToolkit.MVVM
+ MSEssentials.UI.Common.MVVM
|
-
+
|
@@ -41,58 +41,50 @@
|
- SimpleToolkit.Extensions
+ MSEssentials.Extensions
|
-
+
|
|
- SimpleToolkit.Attributes
+ MSEssentials.AspNetCore.Attributes
|
-
+
|
|
- SimpleToolkit.UI.Models
+ MSEssentials.UI.Common.Converters
|
-
+
|
|
- SimpleToolkit.UI.WinUI.Behaviors
+ MSEssentials.UI.WinUI.Behaviors
|
-
+
|
|
- SimpleToolkit.UI.WinUI.Converters
+ MSEssentials.UI.WinUI.Converters
|
-
+
|
|
- SimpleToolkit.UI.WinUI.Controls
+ MSEssentials.UI.WinUI.Controls
|
-
- |
-
-
- |
- SimpleToolkit.UI.WinUI.Helpers
- |
-
-
+
|
@@ -101,6 +93,7 @@
- **ObservableKeyValuePair** - observable version of KeyValuePair
- **ObservableDictionary** - observable version of Dictionary
+- **NavigationViewItem** - list item model (for example for navigation controls), allows to bind item to view model
## Installation and usage
@@ -109,18 +102,18 @@ You can download package from official NuGet registry or .nupkg file itself from
**CLI:**
```
-dotnet add package SimpleToolkit.MVVM
+dotnet add package MSEssentials.UI.Common.MVVM
```
**Package reference in .csproj file:**
```
-
+
```
## Attribution and contribution
-This project is open source on MIT License, so you can just copy and upload again to your repository. But according to the license, you must include information about the original author. You can find license here.
+This project is open source on MIT License, so you can just copy and upload again to your repository. But according to the license, you must include information about the original author. You can find license here.
However, the preferred way to contribute would be to propose improvements in a pull request, through issues, or through other means of communication.
diff --git a/SimpleToolkit.MVVM/README.md b/SimpleToolkit.MVVM/README.md
deleted file mode 100644
index af8f4da..0000000
--- a/SimpleToolkit.MVVM/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# SimpleToolkit.MVVM
-
-### Set of helpers, class extensions, UI controls used in my other C# projects
-
-SimpleToolkit is package of useful classes, helpers, extensions and UI controls, I use in my C# projects. MVVM subpackage contains class, method and property MVVM.
-
----
-
-## NuGet registry status
-
-| Subpackage | Status |
-|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| **SimpleToolkit.MVVM** | [](https://www.nuget.org/packages/SimpleToolkit.MVVM/) |
-| SimpleToolkit.Extensions | [](https://www.nuget.org/packages/SimpleToolkit.Extensions/) |
-| SimpleToolkit.Attributes | [](https://www.nuget.org/packages/SimpleToolkit.Attributes/) |
-| SimpleToolkit.UI.Models | [](https://www.nuget.org/packages/SimpleToolkit.UI.Models/) |
-| SimpleToolkit.UI.WinUI.Behaviors | [](https://www.nuget.org/packages/SimpleToolkit.UI.WinUI.Behaviors/) |
-| SimpleToolkit.UI.WinUI.Converters | [](https://www.nuget.org/packages/SimpleToolkit.UI.WinUI.Converters/) |
-| SimpleToolkit.UI.WinUI.Controls | [](https://www.nuget.org/packages/SimpleToolkit.UI.WinUI.Controls/) |
-| SimpleToolkit.UI.WinUI.Helpers | [](https://www.nuget.org/packages/SimpleToolkit.UI.WinUI.Helpers/) |
-
-## Features
-
-- **ObservableKeyValuePair** - observable version of KeyValuePair
-- **ObservableDictionary** - observable version of Dictionary
--
-## Installation and usage
-
-You can download package from official NuGet registry or .nupkg file itself from Releases tab.
-
-**CLI:**
-
-```
-dotnet add package SimpleToolkit.MVVM
-```
-
-**Package reference in .csproj file:**
-
-```
-
-```
-
-## Attribution and contribution
-
-This project is open source on MIT License, so you can just copy and upload again to your repository. But according to the license, you must include information about the original author. You can find license [here](https://repos.mateuszskoczek.com/SimpleToolkit/SimpleToolkit.MVVM/src/branch/main/LICENSE).
-
-However, the preferred way to contribute would be to propose improvements in a pull request, through issues, or through other means of communication.
-
-**Other sources:**
-
-- Icon by [Icons8](icons8.com)
\ No newline at end of file