CrissCross.WPF.WebView2
1.0.6
See the version list below for details.
dotnet add package CrissCross.WPF.WebView2 --version 1.0.6
NuGet\Install-Package CrissCross.WPF.WebView2 -Version 1.0.6
<PackageReference Include="CrissCross.WPF.WebView2" Version="1.0.6" />
paket add CrissCross.WPF.WebView2 --version 1.0.6
#r "nuget: CrissCross.WPF.WebView2, 1.0.6"
// Install CrissCross.WPF.WebView2 as a Cake Addin #addin nuget:?package=CrissCross.WPF.WebView2&version=1.0.6 // Install CrissCross.WPF.WebView2 as a Cake Tool #tool nuget:?package=CrissCross.WPF.WebView2&version=1.0.6
CrissCross
A Navigation Framework for ReactiveUI based projects
What is CrissCross?
CrissCross is a navigation framework for ReactiveUI based projects. It is designed to be used with ReactiveUI, but could be adapted to be used with any MVVM framework.
Why CrissCross?
CrissCross is designed to be a simple, lightweight, and easy to use navigation framework. It is designed to be used with ReactiveUI.
How do I use CrissCross?
Step 1: Install CrissCross
CrissCross is available on NuGet. You can install it using the NuGet Package Manager:
Install-Package CrissCross
or
Install-Package CrissCross.WPF
or
Install-Package CrissCross.XamForms
or
Install-Package CrissCross.MAUI
or
Install-Package CrissCross.Avalonia
or
Install-Package CrissCross.WinForms
Step 2: Create a ViewModel
Create a ViewModel that inherits from RxObject
. This is the ViewModel that will be used for the MainWindow.
public class MainWindowViewModel : RxObject
{
public MainWindowViewModel()
{
this.BuildComplete(() =>
{
// Do something when the IOC Container is built
});
// Setup the IOC Container
Locator.CurrentMutable.RegisterConstant<MainViewModel>(new());
Locator.CurrentMutable.Register<IViewFor<MainViewModel>>(() => new MainView());
Locator.CurrentMutable.RegisterConstant<FirstViewModel>(new());
Locator.CurrentMutable.Register<IViewFor<FirstViewModel>>(() => new FirstView());
// Notify the application that the IOC Container that it is complete and ready to use.
Locator.CurrentMutable.SetupComplete();
}
}
Step 3: Create a View
Create a View that inherits from NavigationWindow
. This is the View that will be used for the MainWindow.
add xmlns:rxNav="https://github.com/ChrisPulman/CrissCross" to the Window inherits in XAML.
Change Window to rxNav:NavigationWindow in XAML.
Add x:TypeArguments="local:MainWindowViewModel"
public partial class MainWindow : NavigationWindow<MainWindowViewModel>
{
public MainWindow()
{
// Remember to set x:Name in XAML to "mainWindow"
InitializeComponent();
this.WhenActivated(disposables =>
{
// Do something when the View is activated
// Configure the Navigation for the MainWindow
NavBack.Command = ReactiveCommand.Create(() => this.NavigateBack(), CanNavigateBack).DisposeWith(d);
// Navigate to the MainViewModel
this.NavigateToView<MainViewModel>();
});
}
}
Step 4: Create a ViewModel
Create a ViewModel that inherits from RxObject
. This is the ViewModel that will be used for the MainView.
public class MainViewModel : RxObject
{
public MainViewModel()
{
this.BuildComplete(() =>
{
// Do something when the IOC Container is built
// Configure the Navigation for the MainViewModel using, you will pass the name of the Navigation Host Window that you want to navigate with.
this.NavigateBack("mainWindow")
this.CanNavigateBack("mainWindow")
this.NavigateToView<FirstViewModel>("mainWindow")
});
}
}
Step 5: Create a View
Create a View that inherits from ReactiveUserControl
. This is the View that will be used for the MainView.
public partial class MainView : ReactiveUserControl<MainViewModel>
{
public MainView()
{
InitializeComponent();
this.WhenActivated(disposables =>
{
// Do something when the View is activated
});
}
}
Step 6: For WPF Applications Configure Single Instance Application if required
If you want to prevent multiple instances of the application from running at the same time, you can use the Make.SingleInstance
method.
protected override void OnStartup(StartupEventArgs e)
{
// This will prevent multiple instances of the application from running at the same time.
Make.SingleInstance("MyUniqueAppName ddd81fc8-9107-4e33-b848-cac4c3ec3d2a");
base.OnStartup(e);
}
Step 7: Run the application
Run the application and you should see the MainView.
Avalonia
Step 1: Install CrissCross
CrissCross is available on NuGet. You can install it using the NuGet Package Manager:
Install-Package CrissCross.Avalonia
Step 2: Create a ViewModel
Create a ViewModel that inherits from RxObject
. This is the ViewModel that will be used for the MainWindow.
public class MainWindowViewModel : RxObject
{
public MainWindowViewModel()
{
this.BuildComplete(() =>
{
// Do something when the IOC Container is built
});
// Setup the IOC Container
Locator.CurrentMutable.RegisterConstant<MainViewModel>(new());
Locator.CurrentMutable.Register<IViewFor<MainViewModel>>(() => new MainView());
Locator.CurrentMutable.RegisterConstant<FirstViewModel>(new());
Locator.CurrentMutable.Register<IViewFor<FirstViewModel>>(() => new FirstView());
// Notify the application that the IOC Container that it is complete and ready to use.
Locator.CurrentMutable.SetupComplete();
}
}
Step 3: Create a NavigationView
Create a View that inherits from NavigationWindow
OR NavigationUserControl
. This is the View that will be used for the MainWindow.
add xmlns:rxNav="https://github.com/ChrisPulman/CrissCross"
Change Window to rxNav:NavigationWindow in XAML.
OR Change UserControl to rxNav:NavigationUserControl in XAML.
As Avalonia has two modes of operation you will need to select the correct mode for your application.
public partial class MainWindow : NavigationWindow<MainWindowViewModel>
{
public MainWindow()
{
// Remember to set x:Name in XAML to "mainWindow"
InitializeComponent();
this.WhenActivated(disposables =>
{
// Do something when the View is activated
// Configure the Navigation for the MainWindow
NavBack.Command = ReactiveCommand.Create(() => this.NavigateBack(), CanNavigateBack).DisposeWith(d);
// Navigate to the MainViewModel
this.NavigateToView<MainViewModel>();
});
}
}
Step 4: Create a ViewModel
Create a ViewModel that inherits from RxObject
. This is the ViewModel that will be used for the MainView.
public class MainViewModel : RxObject
{
public MainViewModel()
{
this.BuildComplete(() =>
{
// Do something when the IOC Container is built
// Configure the Navigation for the MainViewModel using, you will pass the name of the Navigation Host Window that you want to navigate with.
this.NavigateBack("mainWindow")
this.CanNavigateBack("mainWindow")
this.NavigateToView<FirstViewModel>("mainWindow")
});
}
}
Step 5: Create a View
Create a View that inherits from ReactiveUserControl
. This is the View that will be used for the MainView.
public partial class MainView : ReactiveUserControl<MainViewModel>
{
public MainView()
{
InitializeComponent();
this.WhenActivated(disposables =>
{
// Do something when the View is activated
});
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net7.0-windows7.0 is compatible. net8.0-windows was computed. net8.0-windows7.0 is compatible. |
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 is compatible. net481 was computed. |
-
.NETFramework 4.6.2
- Microsoft.Web.WebView2 (>= 1.0.2277.86)
-
.NETFramework 4.7.2
- Microsoft.Web.WebView2 (>= 1.0.2277.86)
-
.NETFramework 4.8
- Microsoft.Web.WebView2 (>= 1.0.2277.86)
-
net6.0-windows7.0
- Microsoft.Web.WebView2 (>= 1.0.2277.86)
-
net7.0-windows7.0
- Microsoft.Web.WebView2 (>= 1.0.2277.86)
-
net8.0-windows7.0
- Microsoft.Web.WebView2 (>= 1.0.2277.86)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.2.1 | 65 | 11/25/2024 |
2.2.0 | 74 | 11/18/2024 |
2.1.3 | 88 | 11/7/2024 |
2.1.2 | 75 | 11/5/2024 |
2.1.1 | 78 | 11/5/2024 |
2.1.0 | 83 | 10/13/2024 |
2.0.6 | 116 | 8/2/2024 |
2.0.5 | 81 | 8/1/2024 |
2.0.4 | 78 | 7/31/2024 |
2.0.3 | 76 | 7/28/2024 |
2.0.2 | 79 | 7/25/2024 |
2.0.1 | 101 | 7/10/2024 |
2.0.0 | 147 | 5/18/2024 |
1.0.25 | 130 | 4/30/2024 |
1.0.24 | 112 | 4/19/2024 |
1.0.23 | 149 | 4/10/2024 |
1.0.22 | 116 | 3/29/2024 |
1.0.21 | 113 | 3/26/2024 |
1.0.20 | 110 | 3/22/2024 |
1.0.19 | 104 | 3/21/2024 |
1.0.18 | 122 | 3/19/2024 |
1.0.17 | 122 | 3/14/2024 |
1.0.16 | 113 | 3/13/2024 |
1.0.15 | 115 | 3/12/2024 |
1.0.14 | 112 | 3/11/2024 |
1.0.13 | 107 | 3/8/2024 |
1.0.12 | 105 | 3/7/2024 |
1.0.11 | 113 | 3/5/2024 |
1.0.10 | 122 | 2/22/2024 |
1.0.9 | 124 | 2/21/2024 |
1.0.8 | 115 | 2/21/2024 |
1.0.7 | 101 | 2/19/2024 |
1.0.6 | 105 | 2/16/2024 |
1.0.5 | 172 | 2/8/2024 |
1.0.4 | 220 | 1/4/2024 |
1.0.3 | 292 | 9/11/2023 |
1.0.2 | 162 | 9/9/2023 |
Compatability with Net 6/7/8 and netstandard2.0