Skip to content

Commit

Permalink
fix Bind with Trigger reinstated ViewToViewModel added option (#2867)
Browse files Browse the repository at this point in the history
* fix Bind with Trigger reinstated ViewToViewModel added option

Added TriggerUpdate option to Bind with Trigger to choose which direction the update will occur.
TriggerUpdate default is ViewToViewModel which uses original functionality.
Added tests

* Update Directory.build.props

* Update Directory.build.props

Issue with GitHub Actions causing build failure, was thinking was issue with DiffEngine 7.1.0

* Add Test for Bind with trigger and type converter

Add DecimalToStringTypeConverter and DoubleToStringTypeConverter
Add test for Bind with trigger and type converter
  • Loading branch information
ChrisPulman authored Aug 11, 2021
1 parent 326a0ee commit 7896a49
Show file tree
Hide file tree
Showing 45 changed files with 487 additions and 160 deletions.
2 changes: 2 additions & 0 deletions integrationtests/IntegrationTests.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// See the LICENSE file in the project root for full license information.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
Expand All @@ -20,6 +21,7 @@ namespace IntegrationTests.Android
/// The main activity for the application.
/// </summary>
[Activity(Label = "@string/app_name", Theme = "@style/AppTheme.NoActionBar", MainLauncher = true)]
[ExcludeFromCodeCoverage]
public class MainActivity : ReactiveActivity<LoginViewModel>
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.Mac/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace IntegrationTests.Mac
/// The main application delegate.
/// </summary>
[Register("AppDelegate")]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class AppDelegate : NSApplicationDelegate
{
/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace IntegrationTests.Mac
/// <summary>
/// A controller responsible for logging in the user.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class LoginViewController : ReactiveViewController<LoginViewModel>
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.Mac/MainClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace IntegrationTests.Mac
/// <summary>
/// The class which hosts the main entry point for the application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public static class MainClass
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.Shared/LoginViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace IntegrationTests.Shared
/// View model for login functionality.
/// </summary>
/// <seealso cref="ReactiveUI.ReactiveObject" />
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class LoginViewModel : ReactiveObject
{
private string _userName;
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.UWP/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace IntegrationTests.UWP
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public sealed partial class App : Application
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.UWP/LoginControlBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace IntegrationTests.UWP
/// <summary>
/// A base level control for logging the user in.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class LoginControlBase : ReactiveUserControl<LoginViewModel>
{
}
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.UWP/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace IntegrationTests.UWP
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public sealed partial class MainPage : Page
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.WPF/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace IntegrationTests.WPF
/// <summary>
/// Interaction logic for App.xaml.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class App : Application
{
}
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.WPF/LoginControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace IntegrationTests.WPF
/// <summary>
/// Interaction logic for LoginControl.xaml.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class LoginControl : ReactiveUserControl<LoginViewModel>
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace IntegrationTests.WPF
/// <summary>
/// Interaction logic for MainWindow.xaml.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class MainWindow
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace IntegrationTests.WPF
/// <summary>
/// Extension methods associated with the UserControl class.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public static class UserControlExtensions
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.WinForms/LoginControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace IntegrationTests.WinForms
/// <summary>
/// A control for logging in a user.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class LoginControl : UserControl, IViewFor<LoginViewModel>
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.WinForms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace IntegrationTests.WinForms
/// <summary>
/// The main form of the application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class MainForm : Form
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.WinForms/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace IntegrationTests.WinForms
/// <summary>
/// The class which hosts the main entry point to the application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public static class Program
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace IntegrationTests.XamarinForms.Droid
/// The main activity for the application.
/// </summary>
[Activity(Label = "IntegrationTests.XamarinForms", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace IntegrationTests.XamarinForms.UWP
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public sealed partial class App : Application
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace IntegrationTests.XamarinForms.UWP
/// <summary>
/// The main page for the application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public sealed partial class MainPage
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace IntegrationTests.XamarinForms.iOS
/// application events from iOS.
/// </summary>
[Register("AppDelegate")]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace IntegrationTests.XamarinForms.iOS
/// <summary>
/// The class which hosts the main entry point to the application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public static class AppLaunch
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions integrationtests/IntegrationTests.XamarinForms/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace IntegrationTests.XamarinForms
/// <summary>
/// The class which represents the main application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class App : Application
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace IntegrationTests.XamarinForms
/// <summary>
/// The main page for the application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class MainPage : ReactiveContentPage<LoginViewModel>
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions integrationtests/IntegrationTests.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
using UIKit;

#pragma warning disable SA1300 // Element should begin with upper-case letter

namespace IntegrationTests.iOS
{
/// <summary>
/// The UIApplicationDelegate for the application. This class is responsible for launching the
/// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
/// </summary>
[Register("AppDelegate")]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class AppDelegate : UIApplicationDelegate
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions integrationtests/IntegrationTests.iOS/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
using UIKit;

#pragma warning disable SA1300 // Element should begin with upper-case letter

namespace IntegrationTests.iOS
{
/// <summary>
/// The main application which contains the entry point to the application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public static class Application
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace IntegrationTests.iOS
/// <summary>
/// The main login view controller for the application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class LoginViewController : ReactiveViewController<LoginViewModel>
{
/// <summary>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Benchmarks/AutoPersistBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace ReactiveUI.Benchmarks
[CoreJob]
[MemoryDiagnoser]
[MarkdownExporterAttribute.GitHub]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class AutoPersistBenchmark
{
private ObservableCollection<MockViewModel>? _collection;
Expand Down
1 change: 1 addition & 0 deletions src/Benchmarks/INPCObservableForPropertyBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace ReactiveUI.Benchmarks
[CoreJob]
[MemoryDiagnoser]
[MarkdownExporterAttribute.GitHub]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class INPCObservableForPropertyBenchmarks
{
private readonly Expression<Func<TestClassChanged, string?>> _expr = x => x.Property1;
Expand Down
1 change: 1 addition & 0 deletions src/Benchmarks/Mocks/MockHostScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace ReactiveUI.Benchmarks
/// <summary>
/// A mock for the screen in ReactiveUI. This will only contain the routing state.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class MockHostScreen : IScreen
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/Benchmarks/Mocks/MockViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ReactiveUI.Benchmarks
/// A mock for a ReactiveObject which is routable.
/// </summary>
[DataContract]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class MockViewModel : ReactiveObject, IRoutableViewModel
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/Benchmarks/NavigationStackBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace ReactiveUI.Benchmarks
[CoreJob]
[MemoryDiagnoser]
[MarkdownExporterAttribute.GitHub]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class NavigationStackBenchmark
{
private static readonly Func<MockViewModel> _mockViewModel;
Expand Down
1 change: 1 addition & 0 deletions src/Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace ReactiveUI.Benchmarks
/// <summary>
/// Class which hosts the main entry point into the application.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public static class Program
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/Benchmarks/ReactiveCommandCreateBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace ReactiveUI.Benchmarks
[CoreJob]
[MemoryDiagnoser]
[MarkdownExporterAttribute.GitHub]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class ReactiveCommandCreateBenchmark
{
private readonly IObservable<bool> _canExecute = new Subject<bool>().AsObservable();
Expand Down
1 change: 1 addition & 0 deletions src/Benchmarks/RoutableViewModelMixinsBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace ReactiveUI.Benchmarks
[CoreJob]
[MemoryDiagnoser]
[MarkdownExporterAttribute.GitHub]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class RoutableViewModelMixinsBenchmarks
{
private Func<MockViewModel>? _mockViewModel;
Expand Down
Loading

0 comments on commit 7896a49

Please sign in to comment.