ConvMVVM2.Core 1.23.1

dotnet add package ConvMVVM2.Core --version 1.23.1
                    
NuGet\Install-Package ConvMVVM2.Core -Version 1.23.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ConvMVVM2.Core" Version="1.23.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ConvMVVM2.Core" Version="1.23.1" />
                    
Directory.Packages.props
<PackageReference Include="ConvMVVM2.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ConvMVVM2.Core --version 1.23.1
                    
#r "nuget: ConvMVVM2.Core, 1.23.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ConvMVVM2.Core@1.23.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ConvMVVM2.Core&version=1.23.1
                    
Install as a Cake Addin
#tool nuget:?package=ConvMVVM2.Core&version=1.23.1
                    
Install as a Cake Tool

ConvMVVM2.Core latest version downloads

ConvMVVM2.WPF latest version downloads

<center>

<img src="https://github.com/gellston/ConvMVVM2/blob/main/ConvMVVM2/Icon/convergence.png?raw=true"/>

</center>

ConvMVVM2

ConvMVVM2 (Convergence MVVM2) is free MVVM library inspired by Community Toolkit library and Prism frameworks.

Supported .NET Runtime

  • .NET Framework 4.8
  • .NET Framework 4.8.1
  • .NET 6
  • .NET 7
  • .NET 8
  • .NET 9

Overview

Host Template

[STAThread]
public static void Main(string[] args)
{
    var host = ConvMVVM2.WPF.Host.ConvMVVM2Host.CreateHost<BootStrapper, Application>(args, "HostTemplate");
    host.Build()
        .ShutdownMode(ShutdownMode.OnMainWindowClose)
        .Popup<MainWindow>(dialog: true)
        //.Popup("MainWindow")
        .RunApp();

}

It support host object creation with generic template and also popup window selectively

BootStrapper

public class BootStrapper : AppBootstrapper
{
    protected override void OnStartUp()
    {
      
    }

    protected override void RegionMapping(IRegionManager layerManager)
    {
        layerManager.Mapping<MainView>("MainView");
    }

    protected override void RegisterModules()
    {
    
    }

    protected override void RegisterServices(IServiceCollection serviceCollection)
    {
        serviceCollection.AddSingleton<MainWindow>();

        serviceCollection.AddSingleton<MainViewModel>();
        serviceCollection.AddSingleton<SubViewModel>();

        serviceCollection.AddSingleton<MainView>();
        serviceCollection.AddSingleton<SubView>();
    }

    protected override void ViewModelMapping(IViewModelMapper viewModelMapper)
    {
        
    }
}

Bootstrapper support ioc, module, viewmodel mapping and region mapping.

Property

#region Public Property
[Property]
private string _TestText = "test";
#endregion

#region Event Handler
partial void OnTestTextChanged(string oldValue, string newValue)
{
    
}
partial void OnTestTextChanged(string value)
{
   
}
partial void OnTestTextChanging(string oldValue, string newValue)
{

}
partial void OnTestTextChanging(string value)
{

}
#endregion

RelayCommand

[RelayCommand]
private void Test()
{
    try
    {

    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.WriteLine(ex.ToString());
    }
}

[AsyncRelayCommand]
private async Task Test2()
{
    try
    {

    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.WriteLine(ex.ToString());
    }
}

It support RelayCommand and AsyncRelayCommand also support source generator for them

ViewModelLocator

<UserControl x:Class="BootStrapperApp.Views.MainView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:BootStrapperApp.Views"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             xmlns:convMVVM2="https://github.com/gellston/ConvMVVM2"
             convMVVM2:ViewModelLocator.AutoWireViewModel="True"
             convMVVM2:ViewModelLocator.UseNamePatternMapper="True"
             convMVVM2:ViewModelLocator.UseViewModelMapper="False">
    
</UserControl>

ViewModelLocator support autowire viewmodel with using name pattern mapping and manual mapping

RegionManager

<Window x:Class="BootStrapperApp.Windows.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:BootStrapperApp.Windows"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800"
        xmlns:convMVVM2="https://github.com/gellston/ConvMVVM2"
        >

    <convMVVM2:WPFRegion RegionName="MainView"></convMVVM2:WPFRegion>
</Window>
[RelayCommand]
private void Test()
{
    try
    {
        this.regionManager.Navigate("MainView", "SubView");
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.WriteLine(ex.ToString());
    }
}

To use regionManager, it need to place RegionControl on somewhere

LocalizeService


<UserControl x:Class="LocalizeApp.Views.MainView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:LocalizeApp.Views"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             xmlns:convMVVM2="https://github.com/gellston/ConvMVVM2">
    <DockPanel Background="Orange">
        <Button DockPanel.Dock="Bottom"
                Height="50"
                Content="Change Local"
                FontSize="35"
                Command="{Binding TestCommand}"></Button>
        <TextBlock Text="{convMVVM2:Localize TestString}"></TextBlock>
    </DockPanel>
</UserControl>
//MainViewModel
[RelayCommand]
private void Test()
{
    try
    {
        this.switchLocal = !this.switchLocal;

        if (this.switchLocal)
            this.localizeService.ChangeLocal("en");
        else
            this.localizeService.ChangeLocal("kr");
    }
    catch
    {

    }
}
// BootStrapper
protected override void OnStartUp(IServiceContainer container)
{
    var localizeService = container.GetService<ILocalizeService>();
    localizeService.SetResourceManager(Properties.Resource.ResourceManager);
    
}

it can change local setting easily from resource manager

Module

//BootStrapper
public class BootStrapper : AppBootstrapper
{
    protected override void OnStartUp(IServiceContainer container)
    {

    }

    protected override void RegionMapping(IRegionManager layerManager)
    {

    }

    protected override void RegisterModules()
    {
        this.EnableAutoModuleSearch(true);
        this.AddModuleRelativePath("Modules");
    }

    protected override void RegisterServices(IServiceCollection serviceCollection)
    {
        serviceCollection.AddSingleton<MainWindow>();
    }

    protected override void ViewModelMapping(IViewModelMapper viewModelMapper)
    {
    }
}
//AModule
public class Module : IModule
{
    public string ModuleName => "AModule";
    public string ModuleVersion => "1.0";
    public void OnStartUp(IServiceContainer container)
    {
    }
    public void RegionMapping(IRegionManager layerManager)
    {
        layerManager.Mapping<AView>("ContentView");
    }
    public void RegisterServices(IServiceCollection container)
    {
        container.AddSingleton<AView>();

        container.AddSingleton<AViewModel>();
    }
    public void ViewModelMapping(IViewModelMapper viewModelMapper)
    {
    }
}
# Post Build Script to move module dll in Modules folder
if not exist "$(SolutionDir)\\ModuleApp\\bin\\$(ConfigurationName)\\net9.0-windows\\Modules" mkdir "$(SolutionDir)\\ModuleApp\\bin\\$(ConfigurationName)\\net9.0-windows\\Modules"
xcopy "$(SolutionDir)\\AModule\\bin\\$(ConfigurationName)\\net9.0-windows\\" "$(SolutionDir)\\ModuleApp\\bin\\$(ConfigurationName)\\net9.0-windows\\Modules\\" /c /i /e /h /y
xcopy "$(SolutionDir)\\BModule\\bin\\$(ConfigurationName)\\net9.0-windows\\" "$(SolutionDir)\\ModuleApp\\bin\\$(ConfigurationName)\\net9.0-windows\\Modules\\" /c /i /e /h /y
xcopy "$(SolutionDir)\\CModule\\bin\\$(ConfigurationName)\\net9.0-windows\\" "$(SolutionDir)\\ModuleApp\\bin\\$(ConfigurationName)\\net9.0-windows\\Modules\\" /c /i /e /h /y
xcopy "$(SolutionDir)\\MainModule\\bin\\$(ConfigurationName)\\net9.0-windows\\" "$(SolutionDir)\\ModuleApp\\bin\\$(ConfigurationName)\\net9.0-windows\\Modules\\" /c /i /e /h /y

ConvMVVM2 also support modulus development

License

The MIT License (MIT)

Copyright (c) 2022-present ConvMVVM Development Team

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 without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

<div style="text-align: right; margin-right:30px;">

TOP

</div>

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ConvMVVM2.Core:

Package Downloads
ConvMVVM2.WPF

Package Description

ConvMVVM2.Winform

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.23.1 467 12/9/2025
1.23.0 447 12/9/2025
1.22.10 333 12/8/2025
1.21.10 227 7/16/2025
1.21.9 206 6/30/2025
1.21.8 186 6/30/2025
1.21.7 193 6/30/2025
1.21.6 188 6/30/2025
1.21.5 193 6/30/2025
1.21.4 194 6/30/2025
1.21.3 194 6/30/2025
1.21.2 194 6/30/2025
1.21.1 191 6/30/2025
1.21.0 150 6/29/2025
1.20.8 154 6/22/2025
1.20.7 157 6/22/2025
1.20.6 186 6/18/2025
1.20.5 191 6/18/2025
1.20.4 182 6/18/2025
1.20.3 202 6/14/2025
Loading failed