Skip to content

Commit

Permalink
Update to include Net 9.0 and a Demo Wpf App
Browse files Browse the repository at this point in the history
Add ViewModel Navigation Control
Update Themes
  • Loading branch information
ChrisPulman committed Nov 17, 2024
1 parent 19069db commit f25da28
Show file tree
Hide file tree
Showing 189 changed files with 2,953 additions and 85 deletions.
10 changes: 5 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Nullable>enable</Nullable>
<PackageIcon>CrissCross.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>Compatability with Net 6/8 and netstandard2.0</PackageReleaseNotes>
<PackageReleaseNotes>Compatability with Net 8/9 and netstandard2.0</PackageReleaseNotes>
<PackageTags>ReactiveUI;Navigation;wpf;avalonia;winforms;maui;xamforms;webview2;rx;reactive;extensions;observable;LINQ;net;netstandard</PackageTags>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
Expand All @@ -29,12 +29,12 @@
<!-- Include PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
<AvaloniaVersion>11.2.0</AvaloniaVersion>
<AvaloniaVersion>11.2.1</AvaloniaVersion>
<ReactiveUIVersion>20.1.63</ReactiveUIVersion>
<XamarinReactiveUIVersion>19.6.12</XamarinReactiveUIVersion>
<CrissCrossCoreTargetFrameworks>netstandard2.0;net6.0;net8.0</CrissCrossCoreTargetFrameworks>
<CrissCrossWinTargetFrameworks>net462;net472;net48;net6.0-windows10.0.17763.0;net8.0-windows10.0.17763.0</CrissCrossWinTargetFrameworks>
<CrissCrossWebviewTargetFrameworks>net462;net472;net48;net6.0-windows;net8.0-windows</CrissCrossWebviewTargetFrameworks>
<CrissCrossCoreTargetFrameworks>netstandard2.0;net8.0;net9.0</CrissCrossCoreTargetFrameworks>
<CrissCrossWinTargetFrameworks>net462;net472;net48;net8.0-windows10.0.17763.0;net9.0-windows10.0.17763.0</CrissCrossWinTargetFrameworks>
<CrissCrossWebviewTargetFrameworks>net462;net472;net48;net8.0-windows;net9.0-windows</CrissCrossWebviewTargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
Expand Down
2 changes: 1 addition & 1 deletion build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ partial class Build : NukeBuild
}
PackagesDirectory.CreateOrCleanDirectory();
await this.InstallDotNetSdk("6.x.x", "7.x.x", "8.x.x");
await this.InstallDotNetSdk("8.x.x", "9.x.x");
});

Target Restore => _ => _
Expand Down
6 changes: 4 additions & 2 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006;IDE0051</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
Expand All @@ -13,8 +13,10 @@

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.146" />
<PackageReference Include="Nuke.Common" Version="8.1.3" />
<PackageReference Include="Nuke.Common" Version="8.1.4" />
<PackageReference Include="CP.Nuke.BuildTools" Version="1.0.79" />
<PackageReference Include="System.Formats.Asn1" Version="9.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<ItemGroup>
<PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.0.1.12" />
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.0.1.13" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/CrissCross.Avalonia/CrissCross.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageReference Include="ReactiveUI" Version="$(ReactiveUIVersion)" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/CrissCross.MAUI.Test/CrissCross.MAUI.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.91" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.91" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/CrissCross.MAUI/CrissCross.MAUI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
Expand All @@ -18,8 +18,8 @@
<ItemGroup>
<PackageReference Include="CompiledBindings.MAUI" Version="1.0.18" />
<PackageReference Include="ReactiveUI.Maui" Version="$(ReactiveUIVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.91" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.91" />
</ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions src/CrissCross.WPF.Plot/CrissCross.WPF.Plot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
<PackageReference Include="AppBarButton.WPF" Version="1.0.2" />
<PackageReference Include="ReactiveList" Version="2.1.0" />
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" PrivateAssets="all" />
<PackageReference Include="ReactiveUI.SourceGenerators" Version="1.0.3" PrivateAssets="all" />
<PackageReference Include="ScottPlot.WPF" Version="5.0.43" />
<PackageReference Include="ReactiveUI.SourceGenerators" Version="2.0.17" PrivateAssets="all" />
<PackageReference Include="ScottPlot.WPF" Version="5.0.45" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<PackageReference Include="Polyfill" Version="7.2.0">
<PackageReference Include="Polyfill" Version="7.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
<Resource Include="Assets\*.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CrissCross.WPF.UI\CrissCross.WPF.UI.csproj" />
</ItemGroup>
Expand Down
16 changes: 16 additions & 0 deletions src/CrissCross.WPF.UI.Gallery/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Application
x:Class="CrissCross.WPF.UI.Gallery.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CrissCross.WPF.UI.Gallery"
xmlns:ui="https://github.com/reactivemarbles/CrissCross.ui"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ControlsDictionary />
<ui:ThemesDictionary Theme="Light" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
10 changes: 10 additions & 0 deletions src/CrissCross.WPF.UI.Gallery/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

namespace CrissCross.WPF.UI.Gallery;

/// <summary>
/// Interaction logic for App.xaml.
/// </summary>
public partial class App;
9 changes: 9 additions & 0 deletions src/CrissCross.WPF.UI.Gallery/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly)]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/CrissCross.WPF.UI.Gallery/Assets/working.gif
35 changes: 35 additions & 0 deletions src/CrissCross.WPF.UI.Gallery/CrissCross.WPF.UI.Gallery.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
<IsPackable>false</IsPackable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CrissCross.WPF.UI\CrissCross.WPF.UI.csproj" />
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ReactiveUI.SourceGenerators" Version="2.0.17" PrivateAssets="all" />
<PackageReference Include="CompiledBindings.WPF" Version="1.0.18" />
</ItemGroup>

<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>

<ItemGroup>
<Resource Include="Assets\**\*.png" />
</ItemGroup>

<ItemGroup>
<Resource Include="Assets\working.gif" />
</ItemGroup>

</Project>
27 changes: 27 additions & 0 deletions src/CrissCross.WPF.UI.Gallery/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<ui:FluentNavigationWindow
x:Class="CrissCross.WPF.UI.Gallery.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:local="clr-namespace:CrissCross.WPF.UI.Gallery.ViewModels"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="https://github.com/reactivemarbles/CrissCross.ui"
x:Name="mainWindow"
Title="MainWindow"
Width="800"
Height="450"
d:DataContext="{d:DesignInstance Type=local:MainWindowViewModel}"
x:TypeArguments="local:MainWindowViewModel"
mc:Ignorable="d">
<ui:FluentNavigationWindow.LeftContent>
<StackPanel>
<ui:TextBox Margin="3,0,0,0" Text="{Binding Filter, ElementName=NavigationLeft, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<ui:TextBox.Icon>
<ui:SymbolIcon Symbol="Search20" />
</ui:TextBox.Icon>
</ui:TextBox>
<ui:NavigationVMLeft x:Name="NavigationLeft" />
</StackPanel>
</ui:FluentNavigationWindow.LeftContent>
<Grid />
</ui:FluentNavigationWindow>
57 changes: 57 additions & 0 deletions src/CrissCross.WPF.UI.Gallery/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using System.Reactive.Disposables;
using System.Windows;
using CrissCross.WPF.UI.Appearance;
using CrissCross.WPF.UI.Gallery.ViewModels;
using ReactiveUI;
using Splat;

namespace CrissCross.WPF.UI.Gallery;

/// <summary>
/// Interaction logic for MainWindow.xaml.
/// </summary>
public partial class MainWindow : IAmBuilt
{
/// <summary>
/// The tracker property.
/// </summary>
public static readonly DependencyProperty TrackerProperty = DependencyProperty.Register(
nameof(Tracker),
typeof(Tracker),
typeof(MainWindow),
new PropertyMetadata(null));

/// <summary>
/// Initializes a new instance of the <see cref="MainWindow"/> class.
/// </summary>
public MainWindow()
{
// Watch for system theme changes
SystemThemeWatcher.Watch(this);
InitializeComponent();

// Set the data context
DataContext = ViewModel = new();
this.WhenActivated(d =>
{
// Set the tracker
var tracker = Locator.Current.GetService<Tracker>();
tracker?.Track(this);
SetCurrentValue(TrackerProperty, tracker);
// Bind the view model
this.OneWayBind(ViewModel, vm => vm.ApplicationTitle, v => v.Title).DisposeWith(d);
this.OneWayBind(ViewModel, vm => vm.NavigationModels, v => v.NavigationLeft.ItemsSource).DisposeWith(d);
// Navigate to the main view
this.NavigateToView<MainViewModel>();
});

// Dispose the view model on close
Closing += (s, e) => ViewModel.Dispose();
}
}
86 changes: 86 additions & 0 deletions src/CrissCross.WPF.UI.Gallery/ViewModels/AllControlsViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using ReactiveUI.SourceGenerators;

namespace CrissCross.WPF.UI.Gallery.ViewModels;

/// <summary>
/// AllControlsViewModel.
/// </summary>
/// <seealso cref="CrissCross.RxObject" />
public partial class AllControlsViewModel : RxObject
{
[ReactiveCommand]
private void Buttons()
{
this.NavigateToView<ButtonsViewModel>("mainWindow");
}

[ReactiveCommand]
private void CheckBox()
{
this.NavigateToView<CheckBoxViewModel>("mainWindow");
}

[ReactiveCommand]
private void ComboBox()
{
this.NavigateToView<ComboBoxViewModel>("mainWindow");
}

[ReactiveCommand]
private void DatePicker()
{
this.NavigateToView<DatePickerViewModel>("mainWindow");
}

[ReactiveCommand]
private void Image()
{
this.NavigateToView<ImageViewModel>("mainWindow");
}

[ReactiveCommand]
private void NumericPushButton()
{
this.NavigateToView<NumericPushButtonViewModel>("mainWindow");
}

[ReactiveCommand]
private void PasswordBox()
{
this.NavigateToView<PasswordBoxViewModel>("mainWindow");
}

[ReactiveCommand]
private void RadioButton()
{
this.NavigateToView<RadioButtonViewModel>("mainWindow");
}

[ReactiveCommand]
private void Slider()
{
this.NavigateToView<SliderViewModel>("mainWindow");
}

[ReactiveCommand]
private void TextBlock()
{
this.NavigateToView<TextBlockViewModel>("mainWindow");
}

[ReactiveCommand]
private void TextBox()
{
this.NavigateToView<TextBoxViewModel>("mainWindow");
}

[ReactiveCommand]
private void ToggleButton()
{
this.NavigateToView<ToggleButtonViewModel>("mainWindow");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

namespace CrissCross.WPF.UI.Gallery.ViewModels;

/// <summary>
/// ButtonsViewModel.
/// </summary>
/// <seealso cref="CrissCross.RxObject" />
public partial class ButtonsViewModel : RxObject
{
}
Loading

0 comments on commit f25da28

Please sign in to comment.