CrissCross.XamForms
1.0.3
See the version list below for details.
dotnet add package CrissCross.XamForms --version 1.0.3
NuGet\Install-Package CrissCross.XamForms -Version 1.0.3
<PackageReference Include="CrissCross.XamForms" Version="1.0.3" />
paket add CrissCross.XamForms --version 1.0.3
#r "nuget: CrissCross.XamForms, 1.0.3"
// Install CrissCross.XamForms as a Cake Addin #addin nuget:?package=CrissCross.XamForms&version=1.0.3 // Install CrissCross.XamForms as a Cake Tool #tool nuget:?package=CrissCross.XamForms&version=1.0.3
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.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 | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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. |
.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. |
-
.NETStandard 2.0
- CrissCross (>= 1.0.3)
- ReactiveUI.XamForms (>= 19.4.1)
-
net6.0
- CrissCross (>= 1.0.3)
- ReactiveUI.XamForms (>= 19.4.1)
-
net7.0
- CrissCross (>= 1.0.3)
- ReactiveUI.XamForms (>= 19.4.1)
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 | 0 | 11/25/2024 |
2.2.0 | 69 | 11/18/2024 |
2.1.3 | 83 | 11/7/2024 |
2.1.2 | 85 | 11/5/2024 |
2.1.1 | 77 | 11/5/2024 |
2.1.0 | 89 | 10/13/2024 |
2.0.6 | 62 | 8/2/2024 |
2.0.5 | 67 | 8/1/2024 |
2.0.4 | 63 | 7/31/2024 |
2.0.3 | 91 | 7/28/2024 |
2.0.2 | 90 | 7/25/2024 |
2.0.1 | 85 | 7/10/2024 |
2.0.0 | 99 | 5/18/2024 |
1.0.25 | 114 | 4/30/2024 |
1.0.24 | 121 | 4/19/2024 |
1.0.23 | 108 | 4/10/2024 |
1.0.22 | 120 | 3/29/2024 |
1.0.21 | 108 | 3/26/2024 |
1.0.20 | 119 | 3/22/2024 |
1.0.19 | 102 | 3/21/2024 |
1.0.18 | 118 | 3/19/2024 |
1.0.17 | 124 | 3/14/2024 |
1.0.16 | 121 | 3/13/2024 |
1.0.15 | 116 | 3/12/2024 |
1.0.14 | 126 | 3/11/2024 |
1.0.13 | 129 | 3/8/2024 |
1.0.12 | 110 | 3/7/2024 |
1.0.11 | 127 | 3/5/2024 |
1.0.10 | 129 | 2/22/2024 |
1.0.9 | 124 | 2/21/2024 |
1.0.8 | 124 | 2/21/2024 |
1.0.7 | 114 | 2/19/2024 |
1.0.6 | 109 | 2/16/2024 |
1.0.5 | 124 | 2/8/2024 |
1.0.4 | 163 | 1/4/2024 |
1.0.3 | 162 | 9/11/2023 |
1.0.2 | 148 | 9/9/2023 |
1.0.1 | 149 | 9/8/2023 |
1.0.0 | 143 | 9/7/2023 |
0.9.2 | 161 | 9/6/2023 |
0.9.1 | 154 | 8/6/2023 |
0.9.0 | 160 | 7/12/2023 |
0.8.0 | 153 | 6/23/2023 |
0.7.1 | 181 | 4/28/2023 |
0.7.0 | 227 | 3/14/2023 |
0.6.0 | 229 | 3/13/2023 |
0.5.0 | 242 | 3/11/2023 |
0.2.0 | 264 | 2/7/2023 |
0.1.0 | 301 | 1/7/2023 |
Compatability with Net 6, Net 7 and netstandard2.0