diff --git a/.gitignore b/.gitignore
index 3c4efe2..5718aef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,172 @@
+
+# Created by https://www.toptal.com/developers/gitignore/api/jetbrains,visualstudio,rider,visualstudiocode
+# Edit at https://www.toptal.com/developers/gitignore?templates=jetbrains,visualstudio,rider,visualstudiocode
+
+### JetBrains ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### JetBrains Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+# .idea/misc.xml
+# *.ipr
+
+# Sonarlint plugin
+# https://plugins.jetbrains.com/plugin/7973-sonarlint
+.idea/**/sonarlint/
+
+# SonarQube Plugin
+# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
+.idea/**/sonarIssues.xml
+
+# Markdown Navigator plugin
+# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
+.idea/**/markdown-navigator.xml
+.idea/**/markdown-navigator-enh.xml
+.idea/**/markdown-navigator/
+
+# Cache file creation bug
+# See https://youtrack.jetbrains.com/issue/JBR-2257
+.idea/$CACHE_FILE$
+
+# CodeStream plugin
+# https://plugins.jetbrains.com/plugin/12206-codestream
+.idea/codestream.xml
+
+### Rider ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+
+# Sensitive or high-churn files
+
+# Gradle
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+
+# Mongo Explorer plugin
+
+# File-based project format
+
+# IntelliJ
+
+# mpeltonen/sbt-idea plugin
+
+# JIRA plugin
+
+# Cursive Clojure plugin
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+
+# Editor-based Rest Client
+
+# Android studio 3.1+ serialized cache file
+
+### VisualStudioCode ###
+.vscode/*
+!.vscode/tasks.json
+!.vscode/launch.json
+*.code-workspace
+
+### VisualStudioCode Patch ###
+# Ignore all local history of files
+.history
+.ionide
+
+### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
+*.rsuser
*.suo
*.user
*.userosscache
@@ -10,6 +175,9 @@
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
+# Mono auto generated files
+mono_crash.*
+
# Build results
[Dd]ebug/
[Dd]ebugPublic/
@@ -17,42 +185,60 @@
[Rr]eleases/
x64/
x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
+[Ll]ogs/
-# Visual Studio 2015 cache/options directory
+# Generated files
+
+# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
-# NUNIT
+# NUnit
*.VisualState.xml
TestResult.xml
+nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
-# DNX
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
*_i.c
*_p.c
-*_i.h
+*_h.h
*.ilk
*.meta
*.obj
+*.iobj
*.pch
*.pdb
+*.ipdb
*.pgc
*.pgd
*.rsp
@@ -62,6 +248,7 @@ artifacts/
*.tlh
*.tmp
*.tmp_proj
+*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
@@ -90,6 +277,9 @@ ipch/
*.vspx
*.sap
+# Visual Studio Trace Files
+*.e2e
+
# TFS 2012 Local Workspace
$tf/
@@ -101,15 +291,23 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
-# JustCode is a .NET coding add-in
-.JustCode
-
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*[.json, .xml, .info]
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
# NCrunch
_NCrunch_*
.*crunch*.local.xml
@@ -141,9 +339,9 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
-# TODO: Comment the next line if you want to checkin your web deploy settings
+# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
-#*.pubxml
+*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
@@ -153,13 +351,15 @@ PublishScripts/
# NuGet Packages
*.nupkg
+# NuGet Symbol Packages
+*.snupkg
# The packages folder can be ignored because of Package Restore
-**/packages/*
+**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
-!**/packages/build/
+!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
-#!**/packages/repositories.config
-# NuGet v3's project.json files produces more ignoreable files
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
@@ -176,12 +376,15 @@ AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
-!*.[Cc]ache/
+!?*.[Cc]ache/
# Others
ClientBin/
@@ -192,9 +395,12 @@ ClientBin/
*.jfm
*.pfx
*.publishsettings
-node_modules/
orleans.codegen.cs
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
@@ -209,15 +415,22 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
+*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
@@ -227,6 +440,7 @@ FakesAssemblies/
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
+node_modules/
# Visual Studio 6 build log
*.plg
@@ -234,6 +448,9 @@ FakesAssemblies/
# Visual Studio 6 workspace options file
*.opt
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
@@ -249,13 +466,61 @@ paket-files/
# FAKE - F# Make
.fake/
-# JetBrains Rider
-.idea/
-*.sln.iml
-
-# CodeRush
-.cr/
+# CodeRush personal settings
+.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
-*.pyc
\ No newline at end of file
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# End of https://www.toptal.com/developers/gitignore/api/jetbrains,visualstudio,rider,visualstudiocode
+Librainian/obj/x64/Debug/net5.0-windows/Librainian.AssemblyInfo.cs
+Librainian/obj/x64/Debug/net5.0-windows/Librainian.AssemblyInfoInputs.cache
+Librainian/obj/x64/Debug/net5.0-windows/Librainian.csproj.CoreCompileInputs.cache
+Librainian/obj/x64/Debug/net5.0-windows/Librainian.csprojAssemblyReference.cache
+Librainian/obj/x64/Release/net5.0-windows/Librainian.AssemblyInfo.cs
+Librainian/obj/x64/Release/net5.0-windows/Librainian.AssemblyInfoInputs.cache
+Librainian/obj/x64/Release/net5.0-windows/Librainian.csprojAssemblyReference.cache
diff --git a/ReactiveUI.Winforms.Samples.Bindings/App.config b/ReactiveUI.Winforms.Samples.Bindings/App.config
index 7fa5b2d..60bd416 100644
--- a/ReactiveUI.Winforms.Samples.Bindings/App.config
+++ b/ReactiveUI.Winforms.Samples.Bindings/App.config
@@ -1,14 +1,15 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Bindings/Program.cs b/ReactiveUI.Winforms.Samples.Bindings/Program.cs
index 02c957b..28b6db7 100644
--- a/ReactiveUI.Winforms.Samples.Bindings/Program.cs
+++ b/ReactiveUI.Winforms.Samples.Bindings/Program.cs
@@ -1,17 +1,18 @@
-using ReactiveUI.Winforms.Samples.Bindings.Views;
-using System;
-using System.Windows.Forms;
+namespace ReactiveUI.Winforms.Samples.Bindings {
-namespace ReactiveUI.Winforms.Samples.Bindings
-{
- static class Program
- {
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new MainView());
- }
- }
-}
+ using System;
+ using System.Windows.Forms;
+ using Views;
+
+ public static class Program {
+
+ [STAThread]
+ public static void Main() {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault( false );
+ Application.Run( new MainView() );
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Bindings/Properties/AssemblyInfo.cs b/ReactiveUI.Winforms.Samples.Bindings/Properties/AssemblyInfo.cs
index e97a69f..ab21c9a 100644
--- a/ReactiveUI.Winforms.Samples.Bindings/Properties/AssemblyInfo.cs
+++ b/ReactiveUI.Winforms.Samples.Bindings/Properties/AssemblyInfo.cs
@@ -1,17 +1,14 @@
using System.Reflection;
using System.Runtime.InteropServices;
-[assembly: AssemblyTitle("ReactiveUI.Winforms.Samples.Bindings")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ReactiveUI.Winforms.Samples")]
-[assembly: AssemblyCopyright("Copyright © Asesjix 2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("e72f085f-4227-4563-a3ad-07a630239df5")]
-
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyTitle( "ReactiveUI.Winforms.Samples.Bindings" )]
+[assembly: AssemblyDescription( "" )]
+[assembly: AssemblyConfiguration( "" )]
+[assembly: AssemblyCompany( "" )]
+[assembly: AssemblyProduct( "ReactiveUI.Winforms.Samples" )]
+[assembly: AssemblyCopyright( "Copyright © Asesjix 2018" )]
+[assembly: AssemblyTrademark( "" )]
+[assembly: AssemblyCulture( "" )]
+[assembly: ComVisible( false )]
+[assembly: Guid( "e72f085f-4227-4563-a3ad-07a630239df5" )]
+[assembly: AssemblyVersion( "1.0.0.0" )]
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Bindings/Properties/Resources.Designer.cs b/ReactiveUI.Winforms.Samples.Bindings/Properties/Resources.Designer.cs
index 9942908..6c83573 100644
--- a/ReactiveUI.Winforms.Samples.Bindings/Properties/Resources.Designer.cs
+++ b/ReactiveUI.Winforms.Samples.Bindings/Properties/Resources.Designer.cs
@@ -1,69 +1,61 @@
//------------------------------------------------------------------------------
//
-// Dieser Code wurde von einem Tool generiert.
-// Laufzeitversion: 4.0.30319.42000
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
//
-// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
-// der Code neu generiert wird.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
//
//------------------------------------------------------------------------------
-namespace ReactiveUI.Winforms.Samples.Bindings.Properties
-{
-
-
+namespace ReactiveUI.Winforms.Samples.Bindings.Properties {
+ using System;
+
+
///
- /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
+ /// A strongly-typed resource class, for looking up localized strings, etc.
///
- // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
- // über ein Tool wie ResGen oder Visual Studio automatisch generiert.
- // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
- // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
+ internal class Resources {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
+ internal Resources() {
}
-
+
///
- /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
+ /// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ReactiveUI.Winforms.Samples.Bindings.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
-
+
///
- /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
- /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
return resourceCulture;
}
- set
- {
+ set {
resourceCulture = value;
}
}
diff --git a/ReactiveUI.Winforms.Samples.Bindings/Properties/Settings.Designer.cs b/ReactiveUI.Winforms.Samples.Bindings/Properties/Settings.Designer.cs
index c617512..3984058 100644
--- a/ReactiveUI.Winforms.Samples.Bindings/Properties/Settings.Designer.cs
+++ b/ReactiveUI.Winforms.Samples.Bindings/Properties/Settings.Designer.cs
@@ -8,21 +8,17 @@
//
//------------------------------------------------------------------------------
-namespace ReactiveUI.Winforms.Samples.Bindings.Properties
-{
-
-
+namespace ReactiveUI.Winforms.Samples.Bindings.Properties {
+
+
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
+
+ public static Settings Default {
+ get {
return defaultInstance;
}
}
diff --git a/ReactiveUI.Winforms.Samples.Bindings/ReactiveUI.Winforms.Samples.Bindings.csproj b/ReactiveUI.Winforms.Samples.Bindings/ReactiveUI.Winforms.Samples.Bindings.csproj
index 366f4e4..9ffb256 100644
--- a/ReactiveUI.Winforms.Samples.Bindings/ReactiveUI.Winforms.Samples.Bindings.csproj
+++ b/ReactiveUI.Winforms.Samples.Bindings/ReactiveUI.Winforms.Samples.Bindings.csproj
@@ -8,9 +8,25 @@
WinExe
ReactiveUI.Winforms.Samples.Bindings
ReactiveUI.Winforms.Samples.Bindings
- v4.6.1
+ v4.8
512
true
+
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
AnyCPU
@@ -21,6 +37,9 @@
DEBUG;TRACE
prompt
4
+ MinimumRecommendedRules.ruleset
+ false
+ false
AnyCPU
@@ -37,35 +56,8 @@
-
- ..\packages\ReactiveUI.8.0.1\lib\net461\ReactiveUI.dll
-
-
- ..\packages\ReactiveUI.WinForms.8.0.1\lib\net461\ReactiveUI.Winforms.dll
-
-
- ..\packages\Splat.4.0.0\lib\net461\Splat.dll
-
-
- ..\packages\System.Drawing.Primitives.4.3.0\lib\net45\System.Drawing.Primitives.dll
-
-
- ..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll
-
-
- ..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll
-
-
- ..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll
-
-
- ..\packages\System.Reactive.PlatformServices.3.1.1\lib\net46\System.Reactive.PlatformServices.dll
-
-
- ..\packages\System.Reactive.Windows.Threading.3.1.1\lib\net45\System.Reactive.Windows.Threading.dll
-
@@ -92,11 +84,11 @@
True
Resources.resx
+ True
MainView.cs
-
SettingsSingleFileGenerator
Settings.Designer.cs
@@ -110,5 +102,22 @@
+
+
+ 13.2.2
+
+
+
+
+ False
+ Microsoft .NET Framework 4.8 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Bindings/ViewModels/MainViewModel.cs b/ReactiveUI.Winforms.Samples.Bindings/ViewModels/MainViewModel.cs
index 1e34624..03d0f0d 100644
--- a/ReactiveUI.Winforms.Samples.Bindings/ViewModels/MainViewModel.cs
+++ b/ReactiveUI.Winforms.Samples.Bindings/ViewModels/MainViewModel.cs
@@ -1,37 +1,40 @@
-using System;
-
-namespace ReactiveUI.Winforms.Samples.Bindings.ViewModels
-{
- public class MainViewModel : ReactiveObject
- {
- private string _applicationTitle;
- private string _valueOne;
- private long _valueTwo;
-
- public MainViewModel()
- {
- // Set properties
- ApplicationTitle = "ReactiveUI Winforms Samples by Asesjix - Bindings";
- ValueOne = "Type somthing";
- ValueTwo = DateTime.Now.Date.ToFileTime();
- }
-
- public string ApplicationTitle
- {
- get => _applicationTitle;
- set => this.RaiseAndSetIfChanged(ref _applicationTitle, value);
- }
-
- public string ValueOne
- {
- get => _valueOne;
- set => this.RaiseAndSetIfChanged(ref _valueOne, value);
- }
-
- public long ValueTwo
- {
- get => _valueTwo;
- set => this.RaiseAndSetIfChanged(ref _valueTwo, value);
- }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Bindings.ViewModels {
+
+ using System;
+
+ public class MainViewModel : ReactiveObject {
+
+ private String _applicationTitle;
+
+ private String _valueOne;
+
+ private Int64 _valueTwo;
+
+ public MainViewModel() {
+ // Set properties
+ this.ApplicationTitle = "ReactiveUI Winforms Samples by Asesjix - Bindings";
+ this.ValueOne = "Type somthing";
+ this.ValueTwo = DateTime.Now.Date.ToFileTime();
+ }
+
+ public String ApplicationTitle {
+ get => this._applicationTitle;
+
+ set => this.RaiseAndSetIfChanged( ref this._applicationTitle, value );
+ }
+
+ public String ValueOne {
+ get => this._valueOne;
+
+ set => this.RaiseAndSetIfChanged( ref this._valueOne, value );
+ }
+
+ public Int64 ValueTwo {
+ get => this._valueTwo;
+
+ set => this.RaiseAndSetIfChanged( ref this._valueTwo, value );
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Bindings/Views/MainView.cs b/ReactiveUI.Winforms.Samples.Bindings/Views/MainView.cs
index ccf8a12..988b8ba 100644
--- a/ReactiveUI.Winforms.Samples.Bindings/Views/MainView.cs
+++ b/ReactiveUI.Winforms.Samples.Bindings/Views/MainView.cs
@@ -1,38 +1,46 @@
-using ReactiveUI.Winforms.Samples.Bindings.ViewModels;
-using System;
-using System.Windows.Forms;
-
-namespace ReactiveUI.Winforms.Samples.Bindings.Views
-{
- public partial class MainView : Form, IViewFor
- {
- public MainView()
- {
- InitializeComponent();
-
- this.WhenActivated(d =>
- {
- // One way bind from viewmodel to view
- d(this.OneWayBind(ViewModel, vm => vm.ApplicationTitle, v => v.Text));
-
- // Two way bind for input (textbox) and one way bind for output (label)
- d(this.Bind(ViewModel, vm => vm.ValueOne, v => v.tbInputOne.Text));
- d(this.OneWayBind(ViewModel, vm => vm.ValueOne, v => v.lOutputOne.Text));
-
- // Two way bind for input (textbox) with convert and one way bind for output (label)
- d(this.Bind(ViewModel, vm => vm.ValueTwo, v => v.dtpInputTwo.Value, t => DateTime.FromFileTime(t), dt => dt.ToFileTime()));
- d(this.OneWayBind(ViewModel, vm => vm.ValueTwo, v => v.lOutputTwo.Text));
- });
-
- ViewModel = new MainViewModel();
- }
-
- public MainViewModel ViewModel { get; set; }
-
- object IViewFor.ViewModel
- {
- get => ViewModel;
- set => ViewModel = (MainViewModel)value;
- }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Bindings.Views {
+
+ using System;
+ using System.Windows.Forms;
+ using ViewModels;
+
+ public partial class MainView : Form, IViewFor {
+
+ public MainView() {
+ this.InitializeComponent();
+
+ var _ = this.WhenActivated( d => {
+ if ( d is null ) {
+ return;
+ }
+
+ if ( this.ViewModel is null ) {
+ return;
+ }
+
+ // One way bind from viewmodel to view
+ d( this.OneWayBind( this.ViewModel, vm => vm.ApplicationTitle, v => v.Text ) );
+
+ // Two way bind for input (textbox) and one way bind for output (label)
+ d( this.Bind( this.ViewModel, vm => vm.ValueOne, v => v.tbInputOne.Text ) );
+ d( this.OneWayBind( this.ViewModel, vm => vm.ValueOne, v => v.lOutputOne.Text ) );
+
+ // Two way bind for input (textbox) with convert and one way bind for output (label)
+ d( this.Bind( this.ViewModel, vm => vm.ValueTwo, v => v.dtpInputTwo.Value, DateTime.FromFileTime, dt => dt.ToFileTime() ) );
+ d( this.OneWayBind( this.ViewModel, vm => vm.ValueTwo, v => v.lOutputTwo.Text ) );
+ } );
+
+ this.ViewModel = new MainViewModel();
+ }
+
+ public MainViewModel ViewModel { get; set; }
+
+ Object IViewFor.ViewModel {
+ get => this.ViewModel;
+
+ set => this.ViewModel = ( MainViewModel ) value;
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Bindings/packages.config b/ReactiveUI.Winforms.Samples.Bindings/packages.config
deleted file mode 100644
index 60139cd..0000000
--- a/ReactiveUI.Winforms.Samples.Bindings/packages.config
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Commands/App.config b/ReactiveUI.Winforms.Samples.Commands/App.config
index 7fa5b2d..60bd416 100644
--- a/ReactiveUI.Winforms.Samples.Commands/App.config
+++ b/ReactiveUI.Winforms.Samples.Commands/App.config
@@ -1,14 +1,15 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Commands/Program.cs b/ReactiveUI.Winforms.Samples.Commands/Program.cs
index 7a08802..1a7009d 100644
--- a/ReactiveUI.Winforms.Samples.Commands/Program.cs
+++ b/ReactiveUI.Winforms.Samples.Commands/Program.cs
@@ -1,17 +1,18 @@
-using ReactiveUI.Winforms.Samples.Commands.Views;
-using System;
-using System.Windows.Forms;
+namespace ReactiveUI.Winforms.Samples.Commands {
-namespace ReactiveUI.Winforms.Samples.Commands
-{
- static class Program
- {
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new MainView());
- }
- }
-}
+ using System;
+ using System.Windows.Forms;
+ using Views;
+
+ public static class Program {
+
+ [STAThread]
+ public static void Main() {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault( false );
+ Application.Run( new MainView() );
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Commands/Properties/AssemblyInfo.cs b/ReactiveUI.Winforms.Samples.Commands/Properties/AssemblyInfo.cs
index fd31ad5..6f7d32d 100644
--- a/ReactiveUI.Winforms.Samples.Commands/Properties/AssemblyInfo.cs
+++ b/ReactiveUI.Winforms.Samples.Commands/Properties/AssemblyInfo.cs
@@ -1,17 +1,14 @@
using System.Reflection;
using System.Runtime.InteropServices;
-[assembly: AssemblyTitle("ReactiveUI.Winforms.Samples.Commands")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ReactiveUI.Winforms.Samples")]
-[assembly: AssemblyCopyright("Copyright © Asesjix 2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("e72f085f-4227-4563-a3ad-07a630239df5")]
-
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyTitle( "ReactiveUI.Winforms.Samples.Commands" )]
+[assembly: AssemblyDescription( "" )]
+[assembly: AssemblyConfiguration( "" )]
+[assembly: AssemblyCompany( "" )]
+[assembly: AssemblyProduct( "ReactiveUI.Winforms.Samples" )]
+[assembly: AssemblyCopyright( "Copyright © Asesjix 2018" )]
+[assembly: AssemblyTrademark( "" )]
+[assembly: AssemblyCulture( "" )]
+[assembly: ComVisible( false )]
+[assembly: Guid( "e72f085f-4227-4563-a3ad-07a630239df5" )]
+[assembly: AssemblyVersion( "1.0.0.0" )]
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Commands/Properties/Resources.Designer.cs b/ReactiveUI.Winforms.Samples.Commands/Properties/Resources.Designer.cs
index 6d991f7..105a962 100644
--- a/ReactiveUI.Winforms.Samples.Commands/Properties/Resources.Designer.cs
+++ b/ReactiveUI.Winforms.Samples.Commands/Properties/Resources.Designer.cs
@@ -1,69 +1,61 @@
//------------------------------------------------------------------------------
//
-// Dieser Code wurde von einem Tool generiert.
-// Laufzeitversion: 4.0.30319.42000
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
//
-// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
-// der Code neu generiert wird.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
//
//------------------------------------------------------------------------------
-namespace ReactiveUI.Winforms.Samples.Commands.Properties
-{
-
-
+namespace ReactiveUI.Winforms.Samples.Commands.Properties {
+ using System;
+
+
///
- /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
+ /// A strongly-typed resource class, for looking up localized strings, etc.
///
- // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
- // über ein Tool wie ResGen oder Visual Studio automatisch generiert.
- // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
- // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
+ internal class Resources {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
+ internal Resources() {
}
-
+
///
- /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
+ /// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ReactiveUI.Winforms.Samples.Commands.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
-
+
///
- /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
- /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
return resourceCulture;
}
- set
- {
+ set {
resourceCulture = value;
}
}
diff --git a/ReactiveUI.Winforms.Samples.Commands/Properties/Settings.Designer.cs b/ReactiveUI.Winforms.Samples.Commands/Properties/Settings.Designer.cs
index 2b5feb5..534fc27 100644
--- a/ReactiveUI.Winforms.Samples.Commands/Properties/Settings.Designer.cs
+++ b/ReactiveUI.Winforms.Samples.Commands/Properties/Settings.Designer.cs
@@ -8,21 +8,17 @@
//
//------------------------------------------------------------------------------
-namespace ReactiveUI.Winforms.Samples.Commands.Properties
-{
-
-
+namespace ReactiveUI.Winforms.Samples.Commands.Properties {
+
+
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
+
+ public static Settings Default {
+ get {
return defaultInstance;
}
}
diff --git a/ReactiveUI.Winforms.Samples.Commands/ReactiveUI.Winforms.Samples.Commands.csproj b/ReactiveUI.Winforms.Samples.Commands/ReactiveUI.Winforms.Samples.Commands.csproj
index 50d65f5..96b8ac6 100644
--- a/ReactiveUI.Winforms.Samples.Commands/ReactiveUI.Winforms.Samples.Commands.csproj
+++ b/ReactiveUI.Winforms.Samples.Commands/ReactiveUI.Winforms.Samples.Commands.csproj
@@ -8,9 +8,10 @@
WinExe
ReactiveUI.Winforms.Samples.Commands
ReactiveUI.Winforms.Samples.Commands
- v4.6.1
+ v4.8
512
true
+
AnyCPU
@@ -21,6 +22,7 @@
DEBUG;TRACE
prompt
4
+ false
AnyCPU
@@ -37,34 +39,7 @@
-
- ..\packages\ReactiveUI.8.0.1\lib\net461\ReactiveUI.dll
-
-
- ..\packages\ReactiveUI.WinForms.8.0.1\lib\net461\ReactiveUI.Winforms.dll
-
-
- ..\packages\Splat.4.0.0\lib\net461\Splat.dll
-
-
- ..\packages\System.Drawing.Primitives.4.3.0\lib\net45\System.Drawing.Primitives.dll
-
-
- ..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll
-
-
- ..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll
-
-
- ..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll
-
-
- ..\packages\System.Reactive.PlatformServices.3.1.1\lib\net46\System.Reactive.PlatformServices.dll
-
-
- ..\packages\System.Reactive.Windows.Threading.3.1.1\lib\net45\System.Reactive.Windows.Threading.dll
-
@@ -90,11 +65,12 @@
True
Resources.resx
+ True
MainView.cs
-
+
SettingsSingleFileGenerator
Settings.Designer.cs
@@ -106,8 +82,9 @@
-
+
+ 13.2.2
+
-
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Commands/ViewModels/MainViewModel.cs b/ReactiveUI.Winforms.Samples.Commands/ViewModels/MainViewModel.cs
index 4eacca1..f94d6e2 100644
--- a/ReactiveUI.Winforms.Samples.Commands/ViewModels/MainViewModel.cs
+++ b/ReactiveUI.Winforms.Samples.Commands/ViewModels/MainViewModel.cs
@@ -1,55 +1,55 @@
-using System.Reactive.Linq;
-using System.Windows;
-
-namespace ReactiveUI.Winforms.Samples.Commands.ViewModels
-{
- public class MainViewModel : ReactiveObject
- {
- private string _applicationTitle;
- private string _withCanExecuteParameter;
-
- public MainViewModel()
- {
- // Set properties
- ApplicationTitle = "ReactiveUI Winforms Samples by Asesjix - Commands";
- // Create parameterless command
- ParameterlessCommand = ReactiveCommand.Create(Parameterless);
- // Create command with parameter
- WithParameterCommand = ReactiveCommand.Create(WithParameter);
- // Create command with can execute
- WithCanExecuteCommand = ReactiveCommand.Create(WithCanExecute,
- this.WhenAnyValue(vm => vm.WithCanExecuteParameter).Select(s => string.IsNullOrEmpty(s) == false));
- }
-
- public string ApplicationTitle
- {
- get => _applicationTitle;
- set => this.RaiseAndSetIfChanged(ref _applicationTitle, value);
- }
-
- public string WithCanExecuteParameter
- {
- get => _withCanExecuteParameter;
- set => this.RaiseAndSetIfChanged(ref _withCanExecuteParameter, value);
- }
-
- public ReactiveCommand ParameterlessCommand { get; }
- public ReactiveCommand WithParameterCommand { get; }
- public ReactiveCommand WithCanExecuteCommand { get; }
-
- private void Parameterless()
- {
- MessageBox.Show("You pressed the button!", ApplicationTitle, MessageBoxButton.OK);
- }
-
- private void WithParameter(string message)
- {
- MessageBox.Show(message, ApplicationTitle, MessageBoxButton.OK);
- }
-
- private void WithCanExecute()
- {
- MessageBox.Show(WithCanExecuteParameter, ApplicationTitle, MessageBoxButton.OK);
- }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Commands.ViewModels {
+
+ using System;
+ using System.Reactive;
+ using System.Reactive.Linq;
+ using System.Windows;
+
+ public class MainViewModel : ReactiveObject {
+
+ private String _applicationTitle;
+
+ private String _withCanExecuteParameter;
+
+ public MainViewModel() {
+ // Set properties
+ this.ApplicationTitle = "ReactiveUI Winforms Samples by Asesjix - Commands";
+
+ // Create parameterless command
+ this.ParameterlessCommand = ReactiveCommand.Create( this.Parameterless );
+
+ // Create command with parameter
+ this.WithParameterCommand = ReactiveCommand.Create( this.WithParameter );
+
+ // Create command with can execute
+ this.WithCanExecuteCommand = ReactiveCommand.Create( this.WithCanExecute,
+ this.WhenAnyValue( vm => vm.WithCanExecuteParameter )?.Select( s => String.IsNullOrEmpty( s ) == false ) );
+ }
+
+ public String ApplicationTitle {
+ get => this._applicationTitle;
+
+ set => this.RaiseAndSetIfChanged( ref this._applicationTitle, value );
+ }
+
+ public String WithCanExecuteParameter {
+ get => this._withCanExecuteParameter;
+
+ set => this.RaiseAndSetIfChanged( ref this._withCanExecuteParameter, value );
+ }
+
+ public ReactiveCommand ParameterlessCommand { get; }
+
+ public ReactiveCommand WithParameterCommand { get; }
+
+ public ReactiveCommand WithCanExecuteCommand { get; }
+
+ private void Parameterless() => MessageBox.Show( "You pressed the button!", this.ApplicationTitle, MessageBoxButton.OK );
+
+ private void WithParameter( String message ) => MessageBox.Show( message, this.ApplicationTitle, MessageBoxButton.OK );
+
+ private void WithCanExecute() => MessageBox.Show( this.WithCanExecuteParameter, this.ApplicationTitle, MessageBoxButton.OK );
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Commands/Views/MainView.cs b/ReactiveUI.Winforms.Samples.Commands/Views/MainView.cs
index ec0c127..5b7e766 100644
--- a/ReactiveUI.Winforms.Samples.Commands/Views/MainView.cs
+++ b/ReactiveUI.Winforms.Samples.Commands/Views/MainView.cs
@@ -1,38 +1,53 @@
-using ReactiveUI.Winforms.Samples.Commands.ViewModels;
-using System.Windows.Forms;
-
-namespace ReactiveUI.Winforms.Samples.Commands.Views
-{
- public partial class MainView : Form, IViewFor
- {
- public MainView()
- {
- InitializeComponent();
-
- this.WhenActivated(d =>
- {
- // Bind properties
- d(this.OneWayBind(ViewModel, vm => vm.ApplicationTitle, v => v.Text));
- // Bind property for command with can execute
- d(this.Bind(ViewModel, vm => vm.WithCanExecuteParameter, v => v.tbWithCanExecuteParameter.Text));
-
- // Bind parameterless command
- d(this.BindCommand(ViewModel, vm => vm.ParameterlessCommand, v => v.btParameterless));
- // Bind command with parameter
- d(this.BindCommand(ViewModel, vm => vm.WithParameterCommand, v => v.btWithParameter, this.WhenAnyValue(v => v.tbParameter.Text)));
- // Bind command with can execute
- d(this.BindCommand(ViewModel, vm => vm.WithCanExecuteCommand, v => v.btWithCanExecute));
- });
-
- ViewModel = new MainViewModel();
- }
-
- public MainViewModel ViewModel { get; set; }
-
- object IViewFor.ViewModel
- {
- get => ViewModel;
- set => ViewModel = (MainViewModel)value;
- }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Commands.Views {
+
+ using System;
+ using System.Windows.Forms;
+ using ViewModels;
+
+ public partial class MainView : Form, IViewFor {
+
+ public MainView() {
+ this.InitializeComponent();
+
+ var _ = this.WhenActivated( d => {
+ if ( d is null ) {
+ return;
+ }
+
+ if ( this.ViewModel is null ) {
+ return;
+ }
+
+ // Bind properties
+ d( this.OneWayBind( this.ViewModel, vm => vm.ApplicationTitle, v => v.Text ) );
+
+ // Bind property for command with can execute
+ d( this.Bind( this.ViewModel, vm => vm.WithCanExecuteParameter, v => v.tbWithCanExecuteParameter.Text ) );
+
+ // Bind parameterless command
+ d( this.BindCommand( this.ViewModel, vm => vm.ParameterlessCommand, v => v.btParameterless ) );
+
+ // Bind command with parameter
+ var anyValue = this.WhenAnyValue( v => v.tbParameter.Text );
+ if ( anyValue != null ) {
+ d( this.BindCommand( this.ViewModel, vm => vm.WithParameterCommand, v => v.btWithParameter, anyValue ) );
+ }
+
+ // Bind command with can execute
+ d( this.BindCommand( this.ViewModel, vm => vm.WithCanExecuteCommand, v => v.btWithCanExecute ) );
+ } );
+
+ this.ViewModel = new MainViewModel();
+ }
+
+ public MainViewModel ViewModel { get; set; }
+
+ Object IViewFor.ViewModel {
+ get => this.ViewModel;
+
+ set => this.ViewModel = ( MainViewModel ) value;
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Commands/packages.config b/ReactiveUI.Winforms.Samples.Commands/packages.config
deleted file mode 100644
index 60139cd..0000000
--- a/ReactiveUI.Winforms.Samples.Commands/packages.config
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/App.config b/ReactiveUI.Winforms.Samples.Routing/App.config
index 7fa5b2d..60bd416 100644
--- a/ReactiveUI.Winforms.Samples.Routing/App.config
+++ b/ReactiveUI.Winforms.Samples.Routing/App.config
@@ -1,14 +1,15 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/Bootstrapper.cs b/ReactiveUI.Winforms.Samples.Routing/Bootstrapper.cs
index 1789f30..57b5003 100644
--- a/ReactiveUI.Winforms.Samples.Routing/Bootstrapper.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/Bootstrapper.cs
@@ -1,36 +1,41 @@
-using ReactiveUI.Winforms.Samples.Routing.ViewModels;
-using ReactiveUI.Winforms.Samples.Routing.Views;
-using Splat;
-using System.Windows.Forms;
-
-namespace ReactiveUI.Winforms.Samples.Routing
-{
- public class Bootstrapper
- {
- public Bootstrapper()
- {
- ConfigureServices();
- }
-
- private void ConfigureServices()
- {
- // Register views
- Locator.CurrentMutable.Register(() => new ShellView(), typeof(IViewFor));
- Locator.CurrentMutable.Register(() => new HomeView(), typeof(IViewFor));
- Locator.CurrentMutable.Register(() => new AboutView(), typeof(IViewFor));
- Locator.CurrentMutable.Register(() => new ContactView(), typeof(IViewFor));
- }
-
- public void Run()
- {
- // Create ShellViewModel and register as IScreen
- var viewModel = new ShellViewModel();
- Locator.CurrentMutable.RegisterConstant(viewModel, typeof(IScreen));
- // Resolve view for ShellViewModel
- var view = ViewLocator.Current.ResolveView(viewModel);
- view.ViewModel = viewModel;
- // Run application
- Application.Run((Form)view);
- }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Routing {
+
+ using System.Windows.Forms;
+ using Splat;
+ using ViewModels;
+ using Views;
+
+ public class Bootstrapper {
+
+ public Bootstrapper() => this.ConfigureServices();
+
+ private void ConfigureServices() {
+ // Register views
+ if ( Locator.CurrentMutable is null ) {
+ return;
+ }
+
+ Locator.CurrentMutable.Register( () => new ShellView(), typeof( IViewFor ) );
+ Locator.CurrentMutable.Register( () => new HomeView(), typeof( IViewFor ) );
+ Locator.CurrentMutable.Register( () => new AboutView(), typeof( IViewFor ) );
+ Locator.CurrentMutable.Register( () => new ContactView(), typeof( IViewFor ) );
+ }
+
+ public void Run() {
+ // Create ShellViewModel and register as IScreen
+ var viewModel = new ShellViewModel();
+ Locator.CurrentMutable.RegisterConstant( viewModel, typeof( IScreen ) );
+
+ // Resolve view for ShellViewModel
+ var view = ViewLocator.Current.ResolveView( viewModel );
+ if ( view != null ) {
+ view.ViewModel = viewModel;
+
+ // Run application
+ Application.Run( ( Form ) view );
+ }
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/Program.cs b/ReactiveUI.Winforms.Samples.Routing/Program.cs
index 1a3a6d6..bd113e8 100644
--- a/ReactiveUI.Winforms.Samples.Routing/Program.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/Program.cs
@@ -1,19 +1,20 @@
-using System;
-using System.Windows.Forms;
+namespace ReactiveUI.Winforms.Samples.Routing {
-namespace ReactiveUI.Winforms.Samples.Routing
-{
- static class Program
- {
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
+ using System;
+ using System.Windows.Forms;
- // Create and run Bootstrapper
- var bootstrapper = new Bootstrapper();
- bootstrapper.Run();
- }
- }
-}
+ public static class Program {
+
+ [STAThread]
+ public static void Main() {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault( false );
+
+ // Create and run Bootstrapper
+ var bootstrapper = new Bootstrapper();
+ bootstrapper.Run();
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/Properties/AssemblyInfo.cs b/ReactiveUI.Winforms.Samples.Routing/Properties/AssemblyInfo.cs
index 05803e4..7d00772 100644
--- a/ReactiveUI.Winforms.Samples.Routing/Properties/AssemblyInfo.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/Properties/AssemblyInfo.cs
@@ -1,17 +1,14 @@
using System.Reflection;
using System.Runtime.InteropServices;
-[assembly: AssemblyTitle("ReactiveUI.Winforms.Samples.Routing")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ReactiveUI.Winforms.Samples")]
-[assembly: AssemblyCopyright("Copyright © Asesjix 2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("e72f085f-4227-4563-a3ad-07a630239df5")]
-
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyTitle( "ReactiveUI.Winforms.Samples.Routing" )]
+[assembly: AssemblyDescription( "" )]
+[assembly: AssemblyConfiguration( "" )]
+[assembly: AssemblyCompany( "" )]
+[assembly: AssemblyProduct( "ReactiveUI.Winforms.Samples" )]
+[assembly: AssemblyCopyright( "Copyright © Asesjix 2018" )]
+[assembly: AssemblyTrademark( "" )]
+[assembly: AssemblyCulture( "" )]
+[assembly: ComVisible( false )]
+[assembly: Guid( "e72f085f-4227-4563-a3ad-07a630239df5" )]
+[assembly: AssemblyVersion( "1.0.0.0" )]
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/Properties/Resources.Designer.cs b/ReactiveUI.Winforms.Samples.Routing/Properties/Resources.Designer.cs
index 1ed45a8..3dce100 100644
--- a/ReactiveUI.Winforms.Samples.Routing/Properties/Resources.Designer.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/Properties/Resources.Designer.cs
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
//
-// Dieser Code wurde von einem Tool generiert.
-// Laufzeitversion:4.0.30319.42000
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
//
-// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
-// der Code erneut generiert wird.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
//
//------------------------------------------------------------------------------
@@ -13,13 +13,13 @@ namespace ReactiveUI.Winforms.Samples.Routing.Properties {
///
- /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
+ /// A strongly-typed resource class, for looking up localized strings, etc.
///
- // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
- // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
- // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
- // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -33,7 +33,7 @@ internal Resources() {
}
///
- /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
+ /// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
@@ -47,8 +47,8 @@ internal Resources() {
}
///
- /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
- /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
diff --git a/ReactiveUI.Winforms.Samples.Routing/Properties/Settings.Designer.cs b/ReactiveUI.Winforms.Samples.Routing/Properties/Settings.Designer.cs
index 9cd50e7..ff56b7f 100644
--- a/ReactiveUI.Winforms.Samples.Routing/Properties/Settings.Designer.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/Properties/Settings.Designer.cs
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
//
-// Dieser Code wurde von einem Tool generiert.
-// Laufzeitversion:4.0.30319.42000
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
//
-// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
-// der Code erneut generiert wird.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
//
//------------------------------------------------------------------------------
@@ -12,7 +12,7 @@ namespace ReactiveUI.Winforms.Samples.Routing.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
diff --git a/ReactiveUI.Winforms.Samples.Routing/ReactiveUI.Winforms.Samples.Routing.csproj b/ReactiveUI.Winforms.Samples.Routing/ReactiveUI.Winforms.Samples.Routing.csproj
index c30f786..6998292 100644
--- a/ReactiveUI.Winforms.Samples.Routing/ReactiveUI.Winforms.Samples.Routing.csproj
+++ b/ReactiveUI.Winforms.Samples.Routing/ReactiveUI.Winforms.Samples.Routing.csproj
@@ -8,9 +8,10 @@
WinExe
ReactiveUI.Winforms.Samples.Routing
ReactiveUI.Winforms.Samples.Routing
- v4.6.1
+ v4.8
512
true
+
AnyCPU
@@ -21,6 +22,7 @@
DEBUG;TRACE
prompt
4
+ false
AnyCPU
@@ -37,36 +39,9 @@
-
- ..\packages\ReactiveUI.8.0.1\lib\net461\ReactiveUI.dll
-
-
- ..\packages\ReactiveUI.WinForms.8.0.1\lib\net461\ReactiveUI.Winforms.dll
-
-
- ..\packages\Splat.4.0.0\lib\net461\Splat.dll
-
-
- ..\packages\System.Drawing.Primitives.4.3.0\lib\net45\System.Drawing.Primitives.dll
-
-
- ..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll
-
-
- ..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll
-
-
- ..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll
-
-
- ..\packages\System.Reactive.PlatformServices.3.1.1\lib\net46\System.Reactive.PlatformServices.dll
-
-
- ..\packages\System.Reactive.Windows.Threading.3.1.1\lib\net45\System.Reactive.Windows.Threading.dll
-
@@ -127,7 +102,6 @@
ShellView.cs
-
SettingsSingleFileGenerator
Settings.Designer.cs
@@ -141,5 +115,10 @@
+
+
+ 13.2.2
+
+
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/ViewModels/AboutViewModel.cs b/ReactiveUI.Winforms.Samples.Routing/ViewModels/AboutViewModel.cs
index 01302f1..5dc68f2 100644
--- a/ReactiveUI.Winforms.Samples.Routing/ViewModels/AboutViewModel.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/ViewModels/AboutViewModel.cs
@@ -1,21 +1,23 @@
-namespace ReactiveUI.Winforms.Samples.Routing.ViewModels
-{
- public class AboutViewModel : ReactiveObject, IRoutableViewModel
- {
- private string _viewTitle;
-
- public AboutViewModel()
- {
- ViewTitle = "About View";
- }
-
- public string ViewTitle
- {
- get => _viewTitle;
- set => this.RaiseAndSetIfChanged(ref _viewTitle, value);
- }
-
- public IScreen HostScreen { get; protected set; }
- public string UrlPathSegment { get; protected set; }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Routing.ViewModels {
+
+ using System;
+
+ public class AboutViewModel : ReactiveObject, IRoutableViewModel {
+
+ private String _viewTitle;
+
+ public AboutViewModel() => this.ViewTitle = "About View";
+
+ public String ViewTitle {
+ get => this._viewTitle;
+
+ set => this.RaiseAndSetIfChanged( ref this._viewTitle, value );
+ }
+
+ public IScreen HostScreen { get; protected set; }
+
+ public String UrlPathSegment { get; protected set; }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/ViewModels/ContactViewModel.cs b/ReactiveUI.Winforms.Samples.Routing/ViewModels/ContactViewModel.cs
index 15fd167..548c152 100644
--- a/ReactiveUI.Winforms.Samples.Routing/ViewModels/ContactViewModel.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/ViewModels/ContactViewModel.cs
@@ -1,21 +1,23 @@
-namespace ReactiveUI.Winforms.Samples.Routing.ViewModels
-{
- public class ContactViewModel : ReactiveObject, IRoutableViewModel
- {
- private string _viewTitle;
-
- public ContactViewModel()
- {
- ViewTitle = "Contact View";
- }
-
- public string ViewTitle
- {
- get => _viewTitle;
- set => this.RaiseAndSetIfChanged(ref _viewTitle, value);
- }
-
- public IScreen HostScreen { get; protected set; }
- public string UrlPathSegment { get; protected set; }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Routing.ViewModels {
+
+ using System;
+
+ public class ContactViewModel : ReactiveObject, IRoutableViewModel {
+
+ private String _viewTitle;
+
+ public ContactViewModel() => this.ViewTitle = "Contact View";
+
+ public String ViewTitle {
+ get => this._viewTitle;
+
+ set => this.RaiseAndSetIfChanged( ref this._viewTitle, value );
+ }
+
+ public IScreen HostScreen { get; protected set; }
+
+ public String UrlPathSegment { get; protected set; }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/ViewModels/HomeViewModel.cs b/ReactiveUI.Winforms.Samples.Routing/ViewModels/HomeViewModel.cs
index 27ad9ca..6fac99c 100644
--- a/ReactiveUI.Winforms.Samples.Routing/ViewModels/HomeViewModel.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/ViewModels/HomeViewModel.cs
@@ -1,21 +1,23 @@
-namespace ReactiveUI.Winforms.Samples.Routing.ViewModels
-{
- public class HomeViewModel : ReactiveObject, IRoutableViewModel
- {
- private string _viewTitle;
-
- public HomeViewModel()
- {
- ViewTitle = "Home View";
- }
-
- public string ViewTitle
- {
- get => _viewTitle;
- set => this.RaiseAndSetIfChanged(ref _viewTitle, value);
- }
-
- public IScreen HostScreen { get; protected set; }
- public string UrlPathSegment { get; protected set; }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Routing.ViewModels {
+
+ using System;
+
+ public class HomeViewModel : ReactiveObject, IRoutableViewModel {
+
+ private String _viewTitle;
+
+ public HomeViewModel() => this.ViewTitle = "Home View";
+
+ public String ViewTitle {
+ get => this._viewTitle;
+
+ set => this.RaiseAndSetIfChanged( ref this._viewTitle, value );
+ }
+
+ public IScreen HostScreen { get; protected set; }
+
+ public String UrlPathSegment { get; protected set; }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/ViewModels/ShellViewModel.cs b/ReactiveUI.Winforms.Samples.Routing/ViewModels/ShellViewModel.cs
index c47bf32..809125a 100644
--- a/ReactiveUI.Winforms.Samples.Routing/ViewModels/ShellViewModel.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/ViewModels/ShellViewModel.cs
@@ -1,80 +1,77 @@
-using System;
-
-namespace ReactiveUI.Winforms.Samples.Routing.ViewModels
-{
- public class ShellViewModel : ReactiveObject, IScreen
- {
- private string _applicationTitle;
-
- public ShellViewModel()
- {
- // Create router for IScreen
- Router = new RoutingState();
- // Set properties
- ApplicationTitle = "ReactiveUI Winforms Samples by Asesjix - Routing";
- // Create commands
- ShowHomeCommand = ReactiveCommand.Create(ShowHome);
- ShowAboutCommand = ReactiveCommand.Create(ShowAbout);
- ShowContactCommand = ReactiveCommand.Create(ShowContact);
- GoBackCommand = ReactiveCommand.Create(GoBack, Router.NavigateBack.CanExecute);
- // Navigate to HomeViewModel and reset NavigationStack (shows HomeView at application start)
- Router
- .NavigateAndReset
- .Execute(new HomeViewModel())
- .Subscribe();
- }
-
- public RoutingState Router { get; }
-
- public string ApplicationTitle
- {
- get => _applicationTitle;
- set => this.RaiseAndSetIfChanged(ref _applicationTitle, value);
- }
-
- public ReactiveCommand ShowHomeCommand { get; }
- public ReactiveCommand ShowAboutCommand { get; }
- public ReactiveCommand ShowContactCommand { get; }
- public ReactiveCommand GoBackCommand { get; }
-
- private void ShowHome()
- {
- // Navigate to HomeViewModel
- Router
- .Navigate
- .Execute(new HomeViewModel())
- .Subscribe();
- }
-
- private void ShowAbout()
- {
- // Navigate to AboutViewModel
- Router
- .Navigate
- .Execute(new AboutViewModel())
- .Subscribe();
- }
-
- private void ShowContact()
- {
- // Navigate to ContactViewModel
- Router
- .Navigate
- .Execute(new ContactViewModel())
- .Subscribe();
- }
-
- private void GoBack()
- {
- // Navigate back in NavigationStack
- // Note: You have to check the count to prevent an ArgumentOutOfRangeException or navigate to empty
- if (Router.NavigationStack.Count > 0)
- {
- Router
- .NavigateBack
- .Execute()
- .Subscribe();
- }
- }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Routing.ViewModels {
+
+ using System;
+ using System.Reactive;
+
+ public class ShellViewModel : ReactiveObject, IScreen {
+
+ private String _applicationTitle;
+
+ public ShellViewModel() {
+ // Create router for IScreen
+ this.Router = new RoutingState();
+
+ // Set properties
+ this.ApplicationTitle = "ReactiveUI Winforms Samples by Asesjix - Routing";
+
+ // Create commands
+ this.ShowHomeCommand = ReactiveCommand.Create( this.ShowHome );
+ this.ShowAboutCommand = ReactiveCommand.Create( this.ShowAbout );
+ this.ShowContactCommand = ReactiveCommand.Create( this.ShowContact );
+ this.GoBackCommand = ReactiveCommand.Create( this.GoBack, this.Router?.NavigateBack.CanExecute );
+
+ // Navigate to HomeViewModel and reset NavigationStack (shows HomeView at application start)
+ var _ = this.Router?.NavigateAndReset.Execute( new HomeViewModel() ).Subscribe();
+ }
+
+ public String ApplicationTitle {
+ get => this._applicationTitle;
+
+ set => this.RaiseAndSetIfChanged( ref this._applicationTitle, value );
+ }
+
+ public ReactiveCommand ShowHomeCommand { get; }
+
+ public ReactiveCommand ShowAboutCommand { get; }
+
+ public ReactiveCommand ShowContactCommand { get; }
+
+ public ReactiveCommand GoBackCommand { get; }
+
+ public RoutingState Router { get; }
+
+ ///
+ /// Navigate to HomeViewModel
+ ///
+ private void ShowHome() {
+ var _ = this.Router?.Navigate.Execute( new HomeViewModel() ).Subscribe();
+ }
+
+ ///
+ /// Navigate to AboutViewModel
+ ///
+ private void ShowAbout() {
+ var _ = this.Router?.Navigate.Execute( new AboutViewModel() ).Subscribe();
+ }
+
+ ///
+ /// Navigate to ContactViewModel
+ ///
+ private void ShowContact() {
+ var _ = this.Router?.Navigate.Execute( new ContactViewModel() ).Subscribe();
+ }
+
+ ///
+ /// Navigate back in NavigationStack
+ ///
+ private void GoBack() {
+ // Note: You have to check the count to prevent an ArgumentOutOfRangeException or navigate to empty
+ var router = this.Router;
+ if ( router?.NavigationStack.Count > 0 ) {
+ var _ = router.NavigateBack.Execute().Subscribe();
+ }
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/Views/AboutView.cs b/ReactiveUI.Winforms.Samples.Routing/Views/AboutView.cs
index ed6c230..ee28259 100644
--- a/ReactiveUI.Winforms.Samples.Routing/Views/AboutView.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/Views/AboutView.cs
@@ -1,26 +1,25 @@
-using ReactiveUI.Winforms.Samples.Routing.ViewModels;
-using System.Windows.Forms;
-
-namespace ReactiveUI.Winforms.Samples.Routing.Views
-{
- public partial class AboutView : UserControl, IViewFor
- {
- public AboutView()
- {
- InitializeComponent();
-
- this.WhenActivated(d =>
- {
- d(this.OneWayBind(ViewModel, vm => vm.ViewTitle, v => v.lViewTitle.Text));
- });
- }
-
- public AboutViewModel ViewModel { get; set; }
-
- object IViewFor.ViewModel
- {
- get => ViewModel;
- set => ViewModel = (AboutViewModel)value;
- }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Routing.Views {
+
+ using System;
+ using System.Windows.Forms;
+ using ViewModels;
+
+ public partial class AboutView : UserControl, IViewFor {
+
+ public AboutView() {
+ this.InitializeComponent();
+
+ var _ = this.WhenActivated( d => d?.Invoke( this.OneWayBind( this.ViewModel, vm => vm.ViewTitle, v => v.lViewTitle.Text ) ) );
+ }
+
+ public AboutViewModel ViewModel { get; set; }
+
+ Object IViewFor.ViewModel {
+ get => this.ViewModel;
+
+ set => this.ViewModel = ( AboutViewModel ) value;
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/Views/ContactView.cs b/ReactiveUI.Winforms.Samples.Routing/Views/ContactView.cs
index 10f05f2..c2b9504 100644
--- a/ReactiveUI.Winforms.Samples.Routing/Views/ContactView.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/Views/ContactView.cs
@@ -1,26 +1,25 @@
-using ReactiveUI.Winforms.Samples.Routing.ViewModels;
-using System.Windows.Forms;
-
-namespace ReactiveUI.Winforms.Samples.Routing.Views
-{
- public partial class ContactView : UserControl, IViewFor
- {
- public ContactView()
- {
- InitializeComponent();
-
- this.WhenActivated(d =>
- {
- d(this.OneWayBind(ViewModel, vm => vm.ViewTitle, v => v.lViewTitle.Text));
- });
- }
-
- public ContactViewModel ViewModel { get; set; }
-
- object IViewFor.ViewModel
- {
- get => ViewModel;
- set => ViewModel = (ContactViewModel)value;
- }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Routing.Views {
+
+ using System;
+ using System.Windows.Forms;
+ using ViewModels;
+
+ public partial class ContactView : UserControl, IViewFor {
+
+ public ContactView() {
+ this.InitializeComponent();
+
+ var _ = this.WhenActivated( d => d?.Invoke( this.OneWayBind( this.ViewModel, vm => vm.ViewTitle, v => v.lViewTitle.Text ) ) );
+ }
+
+ public ContactViewModel ViewModel { get; set; }
+
+ Object IViewFor.ViewModel {
+ get => this.ViewModel;
+
+ set => this.ViewModel = ( ContactViewModel ) value;
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/Views/HomeView.cs b/ReactiveUI.Winforms.Samples.Routing/Views/HomeView.cs
index 925b476..46c29cc 100644
--- a/ReactiveUI.Winforms.Samples.Routing/Views/HomeView.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/Views/HomeView.cs
@@ -1,26 +1,25 @@
-using ReactiveUI.Winforms.Samples.Routing.ViewModels;
-using System.Windows.Forms;
-
-namespace ReactiveUI.Winforms.Samples.Routing.Views
-{
- public partial class HomeView : UserControl, IViewFor
- {
- public HomeView()
- {
- InitializeComponent();
-
- this.WhenActivated(d =>
- {
- d(this.OneWayBind(ViewModel, vm => vm.ViewTitle, v => v.lViewTitle.Text));
- });
- }
-
- public HomeViewModel ViewModel { get; set; }
-
- object IViewFor.ViewModel
- {
- get => ViewModel;
- set => ViewModel = (HomeViewModel)value;
- }
- }
-}
+namespace ReactiveUI.Winforms.Samples.Routing.Views {
+
+ using System;
+ using System.Windows.Forms;
+ using ViewModels;
+
+ public partial class HomeView : UserControl, IViewFor {
+
+ public HomeView() {
+ this.InitializeComponent();
+
+ var _ = this.WhenActivated( d => d?.Invoke( this.OneWayBind( this.ViewModel, vm => vm.ViewTitle, v => v.lViewTitle.Text ) ) );
+ }
+
+ public HomeViewModel ViewModel { get; set; }
+
+ Object IViewFor.ViewModel {
+ get => this.ViewModel;
+
+ set => this.ViewModel = ( HomeViewModel ) value;
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/Views/ShellView.cs b/ReactiveUI.Winforms.Samples.Routing/Views/ShellView.cs
index e8aa332..5bc0995 100644
--- a/ReactiveUI.Winforms.Samples.Routing/Views/ShellView.cs
+++ b/ReactiveUI.Winforms.Samples.Routing/Views/ShellView.cs
@@ -1,20 +1,21 @@
-using ReactiveUI.Winforms.Samples.Routing.ViewModels;
-using System.Windows.Forms;
+namespace ReactiveUI.Winforms.Samples.Routing.Views {
-namespace ReactiveUI.Winforms.Samples.Routing.Views
-{
- public partial class ShellView : Form, IViewFor
- {
- /*
+ using System;
+ using System.Windows.Forms;
+ using ViewModels;
+
+ public partial class ShellView : Form, IViewFor {
+
+ /*
* To see the RoutedControlHost in the Designer you have to create it manually in the ShellView.Designer.cs
- *
+ *
* private void InitializeComponent()
* {
* this.routedControlHost = new ReactiveUI.Winforms.RoutedControlHost();
* ...
- * //
+ * //
* // routedControlHost
- * //
+ * //
* this.routedControlHost.DefaultContent = null;
* this.routedControlHost.Location = new System.Drawing.Point(3, 55);
* this.routedControlHost.Name = "routedControlHost";
@@ -23,43 +24,51 @@ public partial class ShellView : Form, IViewFor
* this.routedControlHost.TabIndex = 4;
* this.routedControlHost.ViewLocator = null;
* ...
- * //
+ * //
* // ShellView
* //
* ...
* this.Controls.Add(this.routedControlHost);
* }
- *
+ *
* private RoutedControlHost routedControlHost;
- *
+ *
*/
- public ShellView()
- {
- InitializeComponent();
+ public ShellView() {
+ this.InitializeComponent();
+
+ var _ = this.WhenActivated( action => {
+ if ( action is null ) {
+ return;
+ }
+
+ if ( this.ViewModel is null ) {
+ return;
+ }
+
+ // Bind router
+ action( this.OneWayBind( this.ViewModel, vm => vm.Router, v => v.routedControlHost.Router ) );
+
+ // Bind properties
+ action( this.OneWayBind( this.ViewModel, vm => vm.ApplicationTitle, v => v.Text ) );
+
+ // Bind commands
+ action( this.BindCommand( this.ViewModel, vm => vm.ShowHomeCommand, v => v.btHome ) );
+ action( this.BindCommand( this.ViewModel, vm => vm.ShowAboutCommand, v => v.btAbout ) );
+ action( this.BindCommand( this.ViewModel, vm => vm.ShowContactCommand, v => v.btContact ) );
+ action( this.BindCommand( this.ViewModel, vm => vm.GoBackCommand, v => v.btGoBack ) );
+ } );
+ }
+
+ public ShellViewModel ViewModel { get; set; }
- this.WhenActivated(b =>
- {
- // Bind router
- b(this.OneWayBind(ViewModel, vm => vm.Router, v => v.routedControlHost.Router));
+ Object IViewFor.ViewModel {
+ get => this.ViewModel;
- // Bind properties
- b(this.OneWayBind(ViewModel, vm => vm.ApplicationTitle, v => v.Text));
+ set => this.ViewModel = ( ShellViewModel ) value;
+ }
- // Bind commands
- b(this.BindCommand(ViewModel, vm => vm.ShowHomeCommand, v => v.btHome));
- b(this.BindCommand(ViewModel, vm => vm.ShowAboutCommand, v => v.btAbout));
- b(this.BindCommand(ViewModel, vm => vm.ShowContactCommand, v => v.btContact));
- b(this.BindCommand(ViewModel, vm => vm.GoBackCommand, v => v.btGoBack));
- });
- }
-
- public ShellViewModel ViewModel { get; set; }
+ }
- object IViewFor.ViewModel
- {
- get => ViewModel;
- set => ViewModel = (ShellViewModel)value;
- }
- }
-}
+}
\ No newline at end of file
diff --git a/ReactiveUI.Winforms.Samples.Routing/packages.config b/ReactiveUI.Winforms.Samples.Routing/packages.config
deleted file mode 100644
index 60139cd..0000000
--- a/ReactiveUI.Winforms.Samples.Routing/packages.config
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file