diff --git a/BuildTools/ReactiveProperty.nuspec b/BuildTools/ReactiveProperty.nuspec index 49dfa876..c1363894 100644 --- a/BuildTools/ReactiveProperty.nuspec +++ b/BuildTools/ReactiveProperty.nuspec @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/Sample/ReactiveProperty.Sample.Core/Mvvm/BindableBase.cs b/Sample/ReactiveProperty.Sample.Core/Mvvm/BindableBase.cs new file mode 100644 index 00000000..b6daba42 --- /dev/null +++ b/Sample/ReactiveProperty.Sample.Core/Mvvm/BindableBase.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ReactiveProperty.Sample.Core.Mvvm +{ + public abstract class BindableBase : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void RaisePropertyChanged([CallerMemberName]string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + protected virtual bool SetProperty(ref T field, T value, [CallerMemberName]string propertyName = null) + { + if (EqualityComparer.Default.Equals(field, value)) + { + return false; + } + + field = value; + RaisePropertyChanged(propertyName); + return true; + } + } +} diff --git a/Sample/ReactiveProperty.Sample.Core/ReactiveProperty.Sample.Core.csproj b/Sample/ReactiveProperty.Sample.Core/ReactiveProperty.Sample.Core.csproj new file mode 100644 index 00000000..6f48c085 --- /dev/null +++ b/Sample/ReactiveProperty.Sample.Core/ReactiveProperty.Sample.Core.csproj @@ -0,0 +1,15 @@ + + + + netstandard2.0 + + + + + + + + + + + diff --git a/Sample/ReactiveProperty.Sample.Core/ViewModels/BasicUsageViewModel.cs b/Sample/ReactiveProperty.Sample.Core/ViewModels/BasicUsageViewModel.cs new file mode 100644 index 00000000..34d13e9e --- /dev/null +++ b/Sample/ReactiveProperty.Sample.Core/ViewModels/BasicUsageViewModel.cs @@ -0,0 +1,22 @@ +using Reactive.Bindings; +using System; +using System.Collections.Generic; +using System.Reactive.Linq; +using System.Text; + +namespace ReactiveProperty.Sample.Core.ViewModels +{ + public class BasicUsageViewModel + { + public ReactiveProperty Input { get; } + public ReadOnlyReactiveProperty Output { get; } + + public BasicUsageViewModel() + { + Input = new ReactiveProperty(""); + Output = Input.Delay(TimeSpan.FromSeconds(1)) + .Select(x => x.ToUpper()) + .ToReadOnlyReactiveProperty(); + } + } +} diff --git a/Sample/ReactiveProperty.Sample.UWP/App.xaml b/Sample/ReactiveProperty.Sample.UWP/App.xaml new file mode 100644 index 00000000..7043c1ff --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/App.xaml @@ -0,0 +1,7 @@ + + + diff --git a/Sample/ReactiveProperty.Sample.UWP/App.xaml.cs b/Sample/ReactiveProperty.Sample.UWP/App.xaml.cs new file mode 100644 index 00000000..b5ebda76 --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/App.xaml.cs @@ -0,0 +1,102 @@ +using ReactiveProperty.Sample.UWP.Views; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +namespace ReactiveProperty.Sample.UWP +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + sealed partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + this.Suspending += OnSuspending; + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs e) + { + var rootFrame = (Window.Current.Content as MainPage).RootFrame; + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == null) + { + var mainPage = new MainPage(); + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = mainPage.RootFrame; + + rootFrame.NavigationFailed += OnNavigationFailed; + + if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) + { + //TODO: Load state from previously suspended application + } + + // Place the frame in the current Window + Window.Current.Content = mainPage; + } + + if (e.PrelaunchActivated == false) + { + if (rootFrame.Content == null) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(typeof(TopPage), e.Arguments); + } + // Ensure the current window is active + Window.Current.Activate(); + } + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + //TODO: Save application state and stop any background activity + deferral.Complete(); + } + } +} diff --git a/Sample/ReactiveProperty.Sample.UWP/Assets/LockScreenLogo.scale-200.png b/Sample/ReactiveProperty.Sample.UWP/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 00000000..735f57ad Binary files /dev/null and b/Sample/ReactiveProperty.Sample.UWP/Assets/LockScreenLogo.scale-200.png differ diff --git a/Sample/ReactiveProperty.Sample.UWP/Assets/SplashScreen.scale-200.png b/Sample/ReactiveProperty.Sample.UWP/Assets/SplashScreen.scale-200.png new file mode 100644 index 00000000..023e7f1f Binary files /dev/null and b/Sample/ReactiveProperty.Sample.UWP/Assets/SplashScreen.scale-200.png differ diff --git a/Sample/ReactiveProperty.Sample.UWP/Assets/Square150x150Logo.scale-200.png b/Sample/ReactiveProperty.Sample.UWP/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 00000000..af49fec1 Binary files /dev/null and b/Sample/ReactiveProperty.Sample.UWP/Assets/Square150x150Logo.scale-200.png differ diff --git a/Sample/ReactiveProperty.Sample.UWP/Assets/Square44x44Logo.scale-200.png b/Sample/ReactiveProperty.Sample.UWP/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 00000000..ce342a2e Binary files /dev/null and b/Sample/ReactiveProperty.Sample.UWP/Assets/Square44x44Logo.scale-200.png differ diff --git a/Sample/ReactiveProperty.Sample.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Sample/ReactiveProperty.Sample.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 00000000..f6c02ce9 Binary files /dev/null and b/Sample/ReactiveProperty.Sample.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/Sample/ReactiveProperty.Sample.UWP/Assets/StoreLogo.png b/Sample/ReactiveProperty.Sample.UWP/Assets/StoreLogo.png new file mode 100644 index 00000000..7385b56c Binary files /dev/null and b/Sample/ReactiveProperty.Sample.UWP/Assets/StoreLogo.png differ diff --git a/Sample/ReactiveProperty.Sample.UWP/Assets/Wide310x150Logo.scale-200.png b/Sample/ReactiveProperty.Sample.UWP/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 00000000..288995b3 Binary files /dev/null and b/Sample/ReactiveProperty.Sample.UWP/Assets/Wide310x150Logo.scale-200.png differ diff --git a/Sample/ReactiveProperty.Sample.UWP/Mvvm/NavigationService.cs b/Sample/ReactiveProperty.Sample.UWP/Mvvm/NavigationService.cs new file mode 100644 index 00000000..2b5f8dcf --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Mvvm/NavigationService.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.UI.Xaml.Controls; + +namespace ReactiveProperty.Sample.UWP.Mvvm +{ + public interface INavigationService + { + void Navigate(string viewName, object parameter); + } + + public class NavigationService : INavigationService + { + private static readonly Dictionary _viewTypeMap = new Dictionary(); + + public static void RegisteryViewType(string viewName, Type type) => _viewTypeMap[viewName] = type; + + private readonly Frame _frame; + + public NavigationService(Frame frame) + { + _frame = frame; + } + public void Navigate(string viewName, object parameter) + { + _frame.Navigate(_viewTypeMap[viewName], parameter); + } + } +} diff --git a/Sample/ReactiveProperty.Sample.UWP/Package.appxmanifest b/Sample/ReactiveProperty.Sample.UWP/Package.appxmanifest new file mode 100644 index 00000000..7744b0ef --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Package.appxmanifest @@ -0,0 +1,49 @@ + + + + + + + + + + ReactiveProperty.Sample.UWP + kaota + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Sample/ReactiveProperty.Sample.UWP/Properties/AssemblyInfo.cs b/Sample/ReactiveProperty.Sample.UWP/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..ef9beaea --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ReactiveProperty.Sample.UWP")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ReactiveProperty.Sample.UWP")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Sample/ReactiveProperty.Sample.UWP/Properties/Default.rd.xml b/Sample/ReactiveProperty.Sample.UWP/Properties/Default.rd.xml new file mode 100644 index 00000000..af00722c --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Properties/Default.rd.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Sample/ReactiveProperty.Sample.UWP/ReactiveProperty.Sample.UWP.csproj b/Sample/ReactiveProperty.Sample.UWP/ReactiveProperty.Sample.UWP.csproj new file mode 100644 index 00000000..1f53cd3b --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/ReactiveProperty.Sample.UWP.csproj @@ -0,0 +1,181 @@ + + + + + Debug + x86 + {CB427AE5-0762-43BA-AF42-E7DAADF9C379} + AppContainerExe + Properties + ReactiveProperty.Sample.UWP + ReactiveProperty.Sample.UWP + en-US + UAP + 10.0.17134.0 + 10.0.16299.0 + 14 + 512 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + true + ReactiveProperty.Sample.UWP_TemporaryKey.pfx + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x86 + false + prompt + true + + + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x86 + false + prompt + true + true + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM + false + prompt + true + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x64 + false + prompt + true + true + + + PackageReference + + + + App.xaml + + + + + + BasicUsagePage.xaml + + + + MainPage.xaml + + + + TopPage.xaml + + + + + + Designer + + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + + + 6.1.7 + + + + + {157f0f88-34ac-4c49-971f-7027aac757ae} + ReactiveProperty.NETStandard + + + {cd8f2562-e3a0-4f6d-8285-70349597adbc} + ReactiveProperty.Platform.UWP + + + {61a05318-58f5-452d-a47e-659390c8f55b} + ReactiveProperty.Sample.Core + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + 14.0 + + + + \ No newline at end of file diff --git a/Sample/ReactiveProperty.Sample.UWP/ReactiveProperty.Sample.UWP_TemporaryKey.pfx b/Sample/ReactiveProperty.Sample.UWP/ReactiveProperty.Sample.UWP_TemporaryKey.pfx new file mode 100644 index 00000000..e54bfca1 Binary files /dev/null and b/Sample/ReactiveProperty.Sample.UWP/ReactiveProperty.Sample.UWP_TemporaryKey.pfx differ diff --git a/Sample/ReactiveProperty.Sample.UWP/ViewModels/MainPageViewModel.cs b/Sample/ReactiveProperty.Sample.UWP/ViewModels/MainPageViewModel.cs new file mode 100644 index 00000000..6f4d1cea --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/ViewModels/MainPageViewModel.cs @@ -0,0 +1,25 @@ +using ReactiveProperty.Sample.UWP.Mvvm; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.UI.Xaml.Controls; + +namespace ReactiveProperty.Sample.UWP.ViewModels +{ + public class MainPageViewModel + { + private readonly INavigationService _navigationService; + + public MainPageViewModel(INavigationService navigationService) + { + _navigationService = navigationService; + } + + public void Navigate(object invokedItem) + { + + } + } +} diff --git a/Sample/ReactiveProperty.Sample.UWP/ViewModels/ViewNames.cs b/Sample/ReactiveProperty.Sample.UWP/ViewModels/ViewNames.cs new file mode 100644 index 00000000..67c79268 --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/ViewModels/ViewNames.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReactiveProperty.Sample.UWP.ViewModels +{ + static class ViewNames + { + public static string BasicUsage => nameof(BasicUsage); + } +} diff --git a/Sample/ReactiveProperty.Sample.UWP/Views/BasicUsagePage.xaml b/Sample/ReactiveProperty.Sample.UWP/Views/BasicUsagePage.xaml new file mode 100644 index 00000000..37863507 --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Views/BasicUsagePage.xaml @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/Sample/ReactiveProperty.Sample.UWP/Views/BasicUsagePage.xaml.cs b/Sample/ReactiveProperty.Sample.UWP/Views/BasicUsagePage.xaml.cs new file mode 100644 index 00000000..f63b8917 --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Views/BasicUsagePage.xaml.cs @@ -0,0 +1,32 @@ +using ReactiveProperty.Sample.Core.ViewModels; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace ReactiveProperty.Sample.UWP.Views +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class BasicUsagePage : Page + { + private BasicUsageViewModel ViewModel { get; } = new BasicUsageViewModel(); + public BasicUsagePage() + { + this.InitializeComponent(); + } + } +} diff --git a/Sample/ReactiveProperty.Sample.UWP/Views/BindingHelper.cs b/Sample/ReactiveProperty.Sample.UWP/Views/BindingHelper.cs new file mode 100644 index 00000000..131830f9 --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Views/BindingHelper.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReactiveProperty.Sample.UWP.Views +{ + public static class BindingHelper + { + } +} diff --git a/Sample/ReactiveProperty.Sample.UWP/Views/MainPage.xaml b/Sample/ReactiveProperty.Sample.UWP/Views/MainPage.xaml new file mode 100644 index 00000000..b1e3153e --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Views/MainPage.xaml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/Sample/ReactiveProperty.Sample.UWP/Views/MainPage.xaml.cs b/Sample/ReactiveProperty.Sample.UWP/Views/MainPage.xaml.cs new file mode 100644 index 00000000..d19f515a --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Views/MainPage.xaml.cs @@ -0,0 +1,41 @@ +using ReactiveProperty.Sample.UWP.Mvvm; +using ReactiveProperty.Sample.UWP.ViewModels; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace ReactiveProperty.Sample.UWP.Views +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class MainPage : Page + { + private MainPageViewModel ViewModel { get; } + public MainPage() + { + NavigationService.RegisteryViewType(ViewNames.BasicUsage, typeof(BasicUsagePage)); + + ViewModel = new MainPageViewModel(new NavigationService(RootFrame)); + this.InitializeComponent(); + } + + private void NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) + { + ViewModel.Navigate(args.InvokedItem); + } + } +} diff --git a/Sample/ReactiveProperty.Sample.UWP/Views/PageInfoViewModel.cs b/Sample/ReactiveProperty.Sample.UWP/Views/PageInfoViewModel.cs new file mode 100644 index 00000000..9287a48e --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Views/PageInfoViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReactiveProperty.Sample.UWP.Views +{ + public class PageInfoViewModel + { + public string Text { get; set; } + public string PageName { get; set; } + } +} diff --git a/Sample/ReactiveProperty.Sample.UWP/Views/TopPage.xaml b/Sample/ReactiveProperty.Sample.UWP/Views/TopPage.xaml new file mode 100644 index 00000000..354cc337 --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Views/TopPage.xaml @@ -0,0 +1,18 @@ + + + + + + diff --git a/Sample/ReactiveProperty.Sample.UWP/Views/TopPage.xaml.cs b/Sample/ReactiveProperty.Sample.UWP/Views/TopPage.xaml.cs new file mode 100644 index 00000000..bed43e3d --- /dev/null +++ b/Sample/ReactiveProperty.Sample.UWP/Views/TopPage.xaml.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace ReactiveProperty.Sample.UWP.Views +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class TopPage : Page + { + public TopPage() + { + this.InitializeComponent(); + } + } +} diff --git a/Sample/Sample.ViewModels/AsyncReactiveCommandViewModel.cs b/Sample/Sample.ViewModels/AsyncReactiveCommandViewModel.cs index ceeee255..46efdd77 100644 --- a/Sample/Sample.ViewModels/AsyncReactiveCommandViewModel.cs +++ b/Sample/Sample.ViewModels/AsyncReactiveCommandViewModel.cs @@ -1,10 +1,6 @@ -using Reactive.Bindings; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; +using System.ComponentModel; using System.Threading.Tasks; +using Reactive.Bindings; namespace Sample.ViewModels { diff --git a/Sample/Sample.ViewModels/EventToReactiveCommandViewModel.cs b/Sample/Sample.ViewModels/EventToReactiveCommandViewModel.cs index b150ec1d..68c2de83 100644 --- a/Sample/Sample.ViewModels/EventToReactiveCommandViewModel.cs +++ b/Sample/Sample.ViewModels/EventToReactiveCommandViewModel.cs @@ -1,12 +1,6 @@ -using Reactive.Bindings; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Linq; using System.Reactive.Linq; -using System.Diagnostics; -using Reactive.Bindings.Extensions; +using Reactive.Bindings; namespace Sample.ViewModels { diff --git a/Sample/Sample.ViewModels/EventToReactivePropertyViewModel.cs b/Sample/Sample.ViewModels/EventToReactivePropertyViewModel.cs index 332d0c7e..62d82688 100644 --- a/Sample/Sample.ViewModels/EventToReactivePropertyViewModel.cs +++ b/Sample/Sample.ViewModels/EventToReactivePropertyViewModel.cs @@ -1,12 +1,8 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using Reactive.Bindings; -using System.Reactive.Linq; -using System.Windows.Input; -using System.Windows; using System.Reactive; +using System.Reactive.Linq; +using Reactive.Bindings; using Reactive.Bindings.Interactivity; namespace Sample.ViewModels @@ -62,4 +58,4 @@ protected override IObservable> OnConvert(IObservable s .Select(x => Tuple.Create((int)x.X, (int)x.Y)); } } -} \ No newline at end of file +} diff --git a/Sample/Sample.ViewModels/FilteredReadOnlyObservableCollectionBasicsViewModel.cs b/Sample/Sample.ViewModels/FilteredReadOnlyObservableCollectionBasicsViewModel.cs index 4cd95782..9619f404 100644 --- a/Sample/Sample.ViewModels/FilteredReadOnlyObservableCollectionBasicsViewModel.cs +++ b/Sample/Sample.ViewModels/FilteredReadOnlyObservableCollectionBasicsViewModel.cs @@ -1,13 +1,10 @@ -using Reactive.Bindings; -using Reactive.Bindings.Helpers; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; -using System.Linq; using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; +using Reactive.Bindings; +using Reactive.Bindings.Helpers; namespace Sample.ViewModels { diff --git a/Sample/Sample.ViewModels/ReactivePropertyBasicsViewModel.cs b/Sample/Sample.ViewModels/ReactivePropertyBasicsViewModel.cs index 4d4246a5..db86b2df 100644 --- a/Sample/Sample.ViewModels/ReactivePropertyBasicsViewModel.cs +++ b/Sample/Sample.ViewModels/ReactivePropertyBasicsViewModel.cs @@ -1,9 +1,8 @@ using System; +using System.Reactive.Concurrency; // using Namespace using System.Reactive.Linq; -using System.Windows; using Reactive.Bindings; using Reactive.Bindings.Extensions; -using System.Reactive.Concurrency; // using Namespace namespace Sample.ViewModels { @@ -42,4 +41,4 @@ public ReactivePropertyBasicsViewModel() ReplaceTextCommand.Subscribe(_ => InputText.Value = "Hello, ReactiveProperty!"); } } -} \ No newline at end of file +} diff --git a/Sample/Sample.ViewModels/Sample.ViewModels.csproj b/Sample/Sample.ViewModels/Sample.ViewModels.csproj index 22b5b057..2122f28d 100644 --- a/Sample/Sample.ViewModels/Sample.ViewModels.csproj +++ b/Sample/Sample.ViewModels/Sample.ViewModels.csproj @@ -6,7 +6,7 @@ - + diff --git a/Sample/Sample.ViewModels/SynchronizeObjectViewModel.cs b/Sample/Sample.ViewModels/SynchronizeObjectViewModel.cs index 5d1f80cb..a0803a66 100644 --- a/Sample/Sample.ViewModels/SynchronizeObjectViewModel.cs +++ b/Sample/Sample.ViewModels/SynchronizeObjectViewModel.cs @@ -1,8 +1,7 @@ using System; +using System.ComponentModel; using System.Reactive.Linq; -using System.Windows; using Reactive.Bindings; -using System.ComponentModel; using Reactive.Bindings.Extensions; // using namespace namespace Sample.ViewModels @@ -32,7 +31,7 @@ public SynchronizeObjectViewModel() // synchronization check CheckCommand = new ReactiveCommand(); - this.AlertMessage = CheckCommand.Select(_ => + this.AlertMessage = CheckCommand.Select(_ => "INPC Name:" + inpc.Name + Environment.NewLine + "POCO Name:" + poco.Name) .ToReactiveProperty(mode: ReactivePropertyMode.None); @@ -59,4 +58,4 @@ public class PlainObject { public string Name { get; set; } } -} \ No newline at end of file +} diff --git a/Sample/Sample.ViewModels/ValidationViewModel.cs b/Sample/Sample.ViewModels/ValidationViewModel.cs index 0ad892f3..d18593d9 100644 --- a/Sample/Sample.ViewModels/ValidationViewModel.cs +++ b/Sample/Sample.ViewModels/ValidationViewModel.cs @@ -3,11 +3,9 @@ using System.Linq; using System.Reactive; using System.Reactive.Linq; -using System.Windows; +using System.Threading.Tasks; using Reactive.Bindings; using Reactive.Bindings.Extensions; -using System.Diagnostics; -using System.Threading.Tasks; namespace Sample.ViewModels { @@ -33,11 +31,11 @@ public ValidationViewModel() // null is success(have no error), string is error message ValidationData = new ReactiveProperty() - .SetValidateNotifyError((string s) => - string.IsNullOrEmpty(s) ? + .SetValidateNotifyError((string s) => + string.IsNullOrEmpty(s) ? "required" : - s.Cast().All(Char.IsUpper) ? - null : + s.Cast().All(Char.IsUpper) ? + null : "not all uppercase"); // Can set both validation @@ -51,18 +49,18 @@ public ValidationViewModel() .SetValidateNotifyError(async x => { await Task.Delay(2000); - if (x == null) return null; - if (x.Contains("a")) return "'a' shouldn't be contained"; + if (x == null) return null; + if (x.Contains("a")) return "'a' shouldn't be contained"; return null; }) .SetValidateNotifyError(xs => { return xs - .Throttle(TimeSpan.FromMilliseconds(500)) + .Throttle(TimeSpan.FromMilliseconds(500)) .Select(x => { - if (x == null) return null; - if (x.Contains("b")) return "'b' shouldn't be contained"; + if (x == null) return null; + if (x.Contains("b")) return "'b' shouldn't be contained"; return null; }); }); @@ -104,4 +102,4 @@ public ValidationViewModel() .ToReactiveProperty(mode: ReactivePropertyMode.None); } } -} \ No newline at end of file +} diff --git a/Sample/UWP.TodoMVVM/App.xaml.cs b/Sample/UWP.TodoMVVM/App.xaml.cs index 9d55815d..ae9a5044 100644 --- a/Sample/UWP.TodoMVVM/App.xaml.cs +++ b/Sample/UWP.TodoMVVM/App.xaml.cs @@ -1,6 +1,6 @@ -using Microsoft.Practices.Unity; +using System.Threading.Tasks; +using Microsoft.Practices.Unity; using Prism.Unity.Windows; -using System.Threading.Tasks; using UWP.TodoMVVM.Models; using UWP.TodoMVVM.Services; using Windows.ApplicationModel.Activation; diff --git a/Sample/UWP.TodoMVVM/Converters/BooleanToVisibilityConverter.cs b/Sample/UWP.TodoMVVM/Converters/BooleanToVisibilityConverter.cs index 687b3fc5..51f84932 100644 --- a/Sample/UWP.TodoMVVM/Converters/BooleanToVisibilityConverter.cs +++ b/Sample/UWP.TodoMVVM/Converters/BooleanToVisibilityConverter.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml; using Windows.UI.Xaml.Data; diff --git a/Sample/UWP.TodoMVVM/Converters/NoopConverter.cs b/Sample/UWP.TodoMVVM/Converters/NoopConverter.cs index 12141d11..9562ab39 100644 --- a/Sample/UWP.TodoMVVM/Converters/NoopConverter.cs +++ b/Sample/UWP.TodoMVVM/Converters/NoopConverter.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Data; namespace UWP.TodoMVVM.Converters diff --git a/Sample/UWP.TodoMVVM/Models/TodoItemRepository.cs b/Sample/UWP.TodoMVVM/Models/TodoItemRepository.cs index a08723ad..04c49a0a 100644 --- a/Sample/UWP.TodoMVVM/Models/TodoItemRepository.cs +++ b/Sample/UWP.TodoMVVM/Models/TodoItemRepository.cs @@ -1,9 +1,6 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Newtonsoft.Json; using Windows.Storage; namespace UWP.TodoMVVM.Models diff --git a/Sample/UWP.TodoMVVM/Models/TodoManager.cs b/Sample/UWP.TodoMVVM/Models/TodoManager.cs index 77a85068..ff489f6e 100644 --- a/Sample/UWP.TodoMVVM/Models/TodoManager.cs +++ b/Sample/UWP.TodoMVVM/Models/TodoManager.cs @@ -1,11 +1,11 @@ -using Prism.Mvvm; -using Reactive.Bindings.Extensions; -using Reactive.Bindings.Helpers; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Reactive.Linq; +using Prism.Mvvm; +using Reactive.Bindings.Extensions; +using Reactive.Bindings.Helpers; namespace UWP.TodoMVVM.Models { @@ -81,7 +81,7 @@ public void ClearCompletedTodoItem() private void ChangeCurrentView() { - switch(this.ViewType) + switch (this.ViewType) { case ViewType.All: this.CurrentView = this.AllTodoItems.ToFilteredReadOnlyObservableCollection(_ => true); diff --git a/Sample/UWP.TodoMVVM/Services/TodoService.cs b/Sample/UWP.TodoMVVM/Services/TodoService.cs index 84e0d52e..a5f47ed7 100644 --- a/Sample/UWP.TodoMVVM/Services/TodoService.cs +++ b/Sample/UWP.TodoMVVM/Services/TodoService.cs @@ -1,6 +1,6 @@ -using Reactive.Bindings.Extensions; -using System; +using System; using System.Reactive.Linq; +using Reactive.Bindings.Extensions; using UWP.TodoMVVM.Models; using UWP.TodoMVVM.ViewModels; diff --git a/Sample/UWP.TodoMVVM/UWP.TodoMVVM.csproj b/Sample/UWP.TodoMVVM/UWP.TodoMVVM.csproj index 74be0c28..c89db22c 100644 --- a/Sample/UWP.TodoMVVM/UWP.TodoMVVM.csproj +++ b/Sample/UWP.TodoMVVM/UWP.TodoMVVM.csproj @@ -141,19 +141,19 @@ - 6.1.7 + 6.1.9 2.0.0 - 11.0.2 + 12.0.1 6.3.0 - 4.1.0 + 4.1.2 diff --git a/Sample/UWP.TodoMVVM/ViewModels/MainPageViewModel.cs b/Sample/UWP.TodoMVVM/ViewModels/MainPageViewModel.cs index 2dcb5e9e..90caaf92 100644 --- a/Sample/UWP.TodoMVVM/ViewModels/MainPageViewModel.cs +++ b/Sample/UWP.TodoMVVM/ViewModels/MainPageViewModel.cs @@ -1,9 +1,9 @@ -using Reactive.Bindings; -using Reactive.Bindings.Extensions; -using Reactive.Bindings.Helpers; -using System; +using System; using System.Linq; using System.Reactive.Linq; +using Reactive.Bindings; +using Reactive.Bindings.Extensions; +using Reactive.Bindings.Helpers; using UWP.TodoMVVM.Models; using UWP.TodoMVVM.Services; diff --git a/Sample/UWP.TodoMVVM/ViewModels/TodoItemViewModel.cs b/Sample/UWP.TodoMVVM/ViewModels/TodoItemViewModel.cs index 3489660d..bef7479c 100644 --- a/Sample/UWP.TodoMVVM/ViewModels/TodoItemViewModel.cs +++ b/Sample/UWP.TodoMVVM/ViewModels/TodoItemViewModel.cs @@ -1,12 +1,8 @@ -using Reactive.Bindings; -using Reactive.Bindings.Extensions; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Reactive.Linq; -using System.Text; -using System.Threading.Tasks; +using Reactive.Bindings; +using Reactive.Bindings.Extensions; using UWP.TodoMVVM.Models; using Windows.UI; using Windows.UI.Xaml.Media; diff --git a/Sample/UWP.TodoMVVM/Views/MainPage.xaml.cs b/Sample/UWP.TodoMVVM/Views/MainPage.xaml.cs index 35501b03..e2a78c78 100644 --- a/Sample/UWP.TodoMVVM/Views/MainPage.xaml.cs +++ b/Sample/UWP.TodoMVVM/Views/MainPage.xaml.cs @@ -1,18 +1,7 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using UWP.TodoMVVM.ViewModels; -using Windows.Foundation; -using Windows.Foundation.Collections; +using UWP.TodoMVVM.ViewModels; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; // 空白ページのアイテム テンプレートについては、http://go.microsoft.com/fwlink/?LinkId=234238 を参照してください diff --git a/Sample/UWP/App.xaml.cs b/Sample/UWP/App.xaml.cs index 57a8c9b4..9919b4d7 100644 --- a/Sample/UWP/App.xaml.cs +++ b/Sample/UWP/App.xaml.cs @@ -1,18 +1,8 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; -using Windows.Foundation; -using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace UWP diff --git a/Sample/UWP/Item.cs b/Sample/UWP/Item.cs index cbc8e19a..23e2956e 100644 --- a/Sample/UWP/Item.cs +++ b/Sample/UWP/Item.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel; namespace UWP { diff --git a/Sample/UWP/MainPage.xaml.cs b/Sample/UWP/MainPage.xaml.cs index c806783d..b3428b87 100644 --- a/Sample/UWP/MainPage.xaml.cs +++ b/Sample/UWP/MainPage.xaml.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; +using Windows.UI.Xaml.Controls; // 空白ページのアイテム テンプレートについては、http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 を参照してください @@ -23,7 +10,7 @@ namespace UWP public sealed partial class MainPage : Page { private MainPageViewModel ViewModel { get; } = new MainPageViewModel(); - + public MainPage() { this.InitializeComponent(); diff --git a/Sample/UWP/MainPageViewModel.cs b/Sample/UWP/MainPageViewModel.cs index 3be18833..623e8f3a 100644 --- a/Sample/UWP/MainPageViewModel.cs +++ b/Sample/UWP/MainPageViewModel.cs @@ -1,12 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Reactive.Bindings.Helpers; using System.Collections.ObjectModel; +using Reactive.Bindings.Helpers; using Windows.UI.Xaml; -using Reactive.Bindings; namespace UWP { diff --git a/Sample/UWP/UWP.csproj b/Sample/UWP/UWP.csproj index b0cb8ea0..be2e1efa 100644 --- a/Sample/UWP/UWP.csproj +++ b/Sample/UWP/UWP.csproj @@ -138,13 +138,13 @@ - 6.1.7 + 6.1.9 2.0.0 - 4.1.0 + 4.1.2 diff --git a/Sample/WPF/App.xaml.cs b/Sample/WPF/App.xaml.cs index efd1763e..4156963e 100644 --- a/Sample/WPF/App.xaml.cs +++ b/Sample/WPF/App.xaml.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Windows; +using System.Windows; namespace WPF { @@ -19,4 +14,4 @@ private void Application_Startup(object sender, StartupEventArgs e) //Reactive.Bindings.UIDispatcherScheduler.Initialize(); } } -} \ No newline at end of file +} diff --git a/Sample/WPF/Views/AsyncReactiveCommand.xaml.cs b/Sample/WPF/Views/AsyncReactiveCommand.xaml.cs index b2a25ebc..20cc12ec 100644 --- a/Sample/WPF/Views/AsyncReactiveCommand.xaml.cs +++ b/Sample/WPF/Views/AsyncReactiveCommand.xaml.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; +using System.Windows; namespace WPF.Views { diff --git a/Sample/WPF/Views/Asynchronous.xaml.cs b/Sample/WPF/Views/Asynchronous.xaml.cs index 4a95996e..770371f8 100644 --- a/Sample/WPF/Views/Asynchronous.xaml.cs +++ b/Sample/WPF/Views/Asynchronous.xaml.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; +using System.Windows; namespace WPF.Views { diff --git a/Sample/WPF/Views/EventToReactiveProperty.xaml.cs b/Sample/WPF/Views/EventToReactiveProperty.xaml.cs index c2cf1a24..4fc47f76 100644 --- a/Sample/WPF/Views/EventToReactiveProperty.xaml.cs +++ b/Sample/WPF/Views/EventToReactiveProperty.xaml.cs @@ -1,17 +1,4 @@ -using Reactive.Bindings; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; +using System.Windows; namespace WPF.Views { diff --git a/Sample/WPF/Views/FilteredReadOnlyObservableCollectionBasics.xaml.cs b/Sample/WPF/Views/FilteredReadOnlyObservableCollectionBasics.xaml.cs index 6ee3e472..54b9836a 100644 --- a/Sample/WPF/Views/FilteredReadOnlyObservableCollectionBasics.xaml.cs +++ b/Sample/WPF/Views/FilteredReadOnlyObservableCollectionBasics.xaml.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +using System.Windows; namespace WPF.Views { diff --git a/Sample/WPF/Views/ReactivePropertyBasics.xaml.cs b/Sample/WPF/Views/ReactivePropertyBasics.xaml.cs index c8cee818..2030eddd 100644 --- a/Sample/WPF/Views/ReactivePropertyBasics.xaml.cs +++ b/Sample/WPF/Views/ReactivePropertyBasics.xaml.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; +using System.Windows; namespace WPF.Views { @@ -20,4 +9,4 @@ public ReactivePropertyBasics() InitializeComponent(); } } -} \ No newline at end of file +} diff --git a/Sample/WPF/Views/SynchronizeObject.xaml.cs b/Sample/WPF/Views/SynchronizeObject.xaml.cs index 2ee0a81b..6f6624a1 100644 --- a/Sample/WPF/Views/SynchronizeObject.xaml.cs +++ b/Sample/WPF/Views/SynchronizeObject.xaml.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; +using System.Windows; namespace WPF.Views { diff --git a/Sample/WPF/Views/Validation.xaml.cs b/Sample/WPF/Views/Validation.xaml.cs index 9771202c..47fd41c5 100644 --- a/Sample/WPF/Views/Validation.xaml.cs +++ b/Sample/WPF/Views/Validation.xaml.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; +using System.Windows; namespace WPF.Views { diff --git a/Sample/WPF/WPF.csproj b/Sample/WPF/WPF.csproj index f81ec0c8..58cafb0e 100644 --- a/Sample/WPF/WPF.csproj +++ b/Sample/WPF/WPF.csproj @@ -221,14 +221,12 @@ - 2.1.1 + 2.1.2 - - + - 4.1.0 + 4.1.2 - 1.0.0 diff --git a/Sample/XamarinAndroid/Resources/Resource.Designer.cs b/Sample/XamarinAndroid/Resources/Resource.Designer.cs index f15bf681..b6de0ed2 100644 --- a/Sample/XamarinAndroid/Resources/Resource.Designer.cs +++ b/Sample/XamarinAndroid/Resources/Resource.Designer.cs @@ -1,11 +1,11 @@ #pragma warning disable 1591 //------------------------------------------------------------------------------ // -// このコードはツールによって生成されました。 -// ランタイム バージョン:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 -// コードが再生成されるときに損失したりします。 +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/Sample/XamarinAndroid/ViewModels/DisposableHolder.cs b/Sample/XamarinAndroid/ViewModels/DisposableHolder.cs index fd64ae5d..bff47de2 100644 --- a/Sample/XamarinAndroid/ViewModels/DisposableHolder.cs +++ b/Sample/XamarinAndroid/ViewModels/DisposableHolder.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using Android.App; -using Android.Content; -using Android.OS; -using Android.Runtime; -using Android.Views; -using Android.Widget; +using System; namespace XamarinAndroid.ViewModels { @@ -30,4 +20,4 @@ protected override void Dispose(bool disposing) } } } -} \ No newline at end of file +} diff --git a/Sample/XamarinAndroid/ViewModels/ListAdapterActivityViewModel.cs b/Sample/XamarinAndroid/ViewModels/ListAdapterActivityViewModel.cs index 47ecd9c0..3e2aed9d 100644 --- a/Sample/XamarinAndroid/ViewModels/ListAdapterActivityViewModel.cs +++ b/Sample/XamarinAndroid/ViewModels/ListAdapterActivityViewModel.cs @@ -1,15 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using Android.App; -using Android.Content; -using Android.OS; -using Android.Runtime; -using Android.Views; -using Android.Widget; +using System; using System.Collections.ObjectModel; +using Android.App; using Reactive.Bindings; using Reactive.Bindings.Extensions; @@ -59,4 +50,4 @@ public PersonViewModel(long id, string name, int age) this.timer.Start(); } } -} \ No newline at end of file +} diff --git a/Sample/XamarinAndroid/ViewModels/MainActivityViewModel.cs b/Sample/XamarinAndroid/ViewModels/MainActivityViewModel.cs index 04b8df9c..75986d1a 100644 --- a/Sample/XamarinAndroid/ViewModels/MainActivityViewModel.cs +++ b/Sample/XamarinAndroid/ViewModels/MainActivityViewModel.cs @@ -1,14 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System; using Android.App; -using Android.Content; -using Android.OS; -using Android.Runtime; -using Android.Views; -using Android.Widget; using Reactive.Bindings; using XamarinAndroid.Views; @@ -31,4 +23,4 @@ public MainActivityViewModel(Activity context) .Subscribe(_ => context.StartActivity(typeof(ListAdapterActivity))); } } -} \ No newline at end of file +} diff --git a/Sample/XamarinAndroid/Views/ListAdapterActivity.cs b/Sample/XamarinAndroid/Views/ListAdapterActivity.cs index 615901d5..3127b58c 100644 --- a/Sample/XamarinAndroid/Views/ListAdapterActivity.cs +++ b/Sample/XamarinAndroid/Views/ListAdapterActivity.cs @@ -1,19 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - + +using System.Reactive.Disposables; using Android.App; -using Android.Content; using Android.OS; -using Android.Runtime; using Android.Views; using Android.Widget; -using XamarinAndroid.ViewModels; - using Reactive.Bindings; using Reactive.Bindings.Extensions; -using System.Reactive.Disposables; +using XamarinAndroid.ViewModels; namespace XamarinAndroid.Views { @@ -60,4 +53,4 @@ protected override void OnCreate(Bundle bundle) (index, value) => value.Id.Value); } } -} \ No newline at end of file +} diff --git a/Sample/XamarinAndroid/Views/MainActivity.cs b/Sample/XamarinAndroid/Views/MainActivity.cs index 456b6c14..334e5bdb 100644 --- a/Sample/XamarinAndroid/Views/MainActivity.cs +++ b/Sample/XamarinAndroid/Views/MainActivity.cs @@ -1,13 +1,9 @@ -using System; -using Android.App; -using Android.Content; -using Android.Runtime; -using Android.Views; -using Android.Widget; +using Android.App; using Android.OS; -using XamarinAndroid.ViewModels; +using Android.Widget; using Reactive.Bindings; using Reactive.Bindings.Extensions; +using XamarinAndroid.ViewModels; namespace XamarinAndroid.Views { diff --git a/Sample/XamarinAndroid/Views/ReactivePropertyBasicsActivity.cs b/Sample/XamarinAndroid/Views/ReactivePropertyBasicsActivity.cs index ec9a5046..4eb03f6e 100644 --- a/Sample/XamarinAndroid/Views/ReactivePropertyBasicsActivity.cs +++ b/Sample/XamarinAndroid/Views/ReactivePropertyBasicsActivity.cs @@ -1,20 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Linq; using System.Reactive.Linq; using Android.App; -using Android.Content; using Android.OS; -using Android.Runtime; -using Android.Views; using Android.Widget; using Reactive.Bindings; using Reactive.Bindings.Extensions; using Sample.ViewModels; -using Android.Util; namespace XamarinAndroid.Views { @@ -53,7 +46,7 @@ protected override void OnCreate(Bundle bundle) .CanExecuteChangedAsObservable() .Select(_ => this.viewModel.ReplaceTextCommand.CanExecute()) .ToReactiveProperty()); - + } } -} \ No newline at end of file +} diff --git a/Sample/XamarinAndroid/XamarinAndroid.csproj b/Sample/XamarinAndroid/XamarinAndroid.csproj index 2345bff3..9af0654d 100644 --- a/Sample/XamarinAndroid/XamarinAndroid.csproj +++ b/Sample/XamarinAndroid/XamarinAndroid.csproj @@ -54,6 +54,16 @@ prompt MinimumRecommendedRules.ruleset + + + + + + + $(UserProfile)\.nuget\packages\system.threading.tasks.extensions\4.5.1\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + + + @@ -63,7 +73,7 @@ - ..\..\packages\System.Reactive.4.1.0\lib\netstandard2.0\System.Reactive.dll + ..\..\packages\System.Reactive.4.1.2\lib\netstandard2.0\System.Reactive.dll @@ -122,12 +132,12 @@ - + - このプロジェクトは、このコンピューター上にない NuGet パッケージを参照しています。それらのパッケージをダウンロードするには、[NuGet パッケージの復元] を使用します。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。見つからないファイルは {0} です。 + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + + + + + + + $(UserProfile)\.nuget\packages\system.threading.tasks.extensions\4.5.1\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + + + @@ -57,7 +67,7 @@ - ..\..\packages\System.Reactive.4.1.0\lib\netstandard2.0\System.Reactive.dll + ..\..\packages\System.Reactive.4.1.2\lib\netstandard2.0\System.Reactive.dll diff --git a/Source/ReactiveProperty.Platform.Android/packages.config b/Source/ReactiveProperty.Platform.Android/packages.config index efcf85f0..69ac982f 100644 --- a/Source/ReactiveProperty.Platform.Android/packages.config +++ b/Source/ReactiveProperty.Platform.Android/packages.config @@ -1,6 +1,6 @@  - + @@ -23,11 +23,11 @@ - + - + diff --git a/Source/ReactiveProperty.Platform.NET46/ReactiveProperty.Platform.NET46.csproj b/Source/ReactiveProperty.Platform.NET46/ReactiveProperty.Platform.NET46.csproj index a71e99f9..174f04c2 100644 --- a/Source/ReactiveProperty.Platform.NET46/ReactiveProperty.Platform.NET46.csproj +++ b/Source/ReactiveProperty.Platform.NET46/ReactiveProperty.Platform.NET46.csproj @@ -14,7 +14,7 @@ ..\..\Binary\net461\ReactiveProperty.NET46.xml - + diff --git a/Source/ReactiveProperty.Platform.Shared/Extensions/DependencyObjectExtensions.cs b/Source/ReactiveProperty.Platform.Shared/Extensions/DependencyObjectExtensions.cs index 140c1e59..f05476b0 100644 --- a/Source/ReactiveProperty.Platform.Shared/Extensions/DependencyObjectExtensions.cs +++ b/Source/ReactiveProperty.Platform.Shared/Extensions/DependencyObjectExtensions.cs @@ -45,14 +45,14 @@ public static IObservable ObserveDependencyProperty(this T self, Depend /// /// Create ReadOnlyReactiveProperty from DependencyObject /// - public static ReadOnlyReactiveProperty ToReadOnlyReactiveProperty(this DependencyObject self, + public static ReadOnlyReactiveProperty ToReadOnlyReactiveProperty(this DependencyObject self, DependencyProperty dp, ReactivePropertyMode mode = ReactivePropertyMode.DistinctUntilChanged | ReactivePropertyMode.RaiseLatestValueOnSubscribe, IScheduler eventScheduler = null) => new ReadOnlyReactiveProperty( self.ObserveDependencyProperty(dp).Select(_ => (T)self.GetValue(dp)), - (T)self.GetValue(dp), - mode, + (T)self.GetValue(dp), + mode, eventScheduler); /// diff --git a/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactive.cs b/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactive.cs index c596448c..ff402742 100644 --- a/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactive.cs +++ b/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactive.cs @@ -21,13 +21,17 @@ public class EventToReactive : TriggerAction /// The parameter. protected override void Invoke(object parameter) { - if (ReactiveProperty == null) { + if (ReactiveProperty == null) + { return; } - if (IgnoreEventArgs) { + if (IgnoreEventArgs) + { ((IReactiveProperty)ReactiveProperty).Value = new Unit(); - } else { + } + else + { var converter = Converter; ((IReactiveProperty)ReactiveProperty).Value = (converter != null) ? converter(parameter) : parameter; diff --git a/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactiveCommand.cs b/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactiveCommand.cs index 1732741b..62e474e5 100644 --- a/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactiveCommand.cs +++ b/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactiveCommand.cs @@ -78,9 +78,11 @@ protected override void OnDetaching() /// The parameter. protected override void Invoke(object parameter) { - if (disposable == null) { + if (disposable == null) + { IObservable ox = source; - foreach (var c in Converters) { + foreach (var c in Converters) + { c.AssociateObject = AssociatedObject; ox = c.Convert(ox); } @@ -90,9 +92,12 @@ protected override void Invoke(object parameter) .Subscribe(x => Command.Execute(x)); } - if (!IgnoreEventArgs) { + if (!IgnoreEventArgs) + { source.OnNext(parameter); - } else { + } + else + { source.OnNext(Unit.Default); } } diff --git a/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactiveProperty.cs b/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactiveProperty.cs index 48697018..bf639be9 100644 --- a/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactiveProperty.cs +++ b/Source/ReactiveProperty.Platform.Shared/Interactivity/EventToReactiveProperty.cs @@ -1,7 +1,6 @@ using System; using System.Reactive; using System.Reactive.Subjects; -using System.Windows.Input; using System.Reactive.Linq; using Reactive.Bindings.Extensions; @@ -75,9 +74,11 @@ protected override void OnDetaching() /// The parameter. protected override void Invoke(object parameter) { - if (disposable == null) { + if (disposable == null) + { IObservable ox = source; - foreach (var c in Converters) { + foreach (var c in Converters) + { c.AssociateObject = AssociatedObject; ox = c.Convert(ox); } @@ -87,9 +88,12 @@ protected override void Invoke(object parameter) .Subscribe(x => ReactiveProperty.Value = x); } - if (!IgnoreEventArgs) { + if (!IgnoreEventArgs) + { source.OnNext(parameter); - } else { + } + else + { source.OnNext(Unit.Default); } } diff --git a/Source/ReactiveProperty.Platform.Shared/ObjectExtensions/ObserveEveryValueChangedExtensions.cs b/Source/ReactiveProperty.Platform.Shared/ObjectExtensions/ObserveEveryValueChangedExtensions.cs index cc0c5c43..cd2cd776 100644 --- a/Source/ReactiveProperty.Platform.Shared/ObjectExtensions/ObserveEveryValueChangedExtensions.cs +++ b/Source/ReactiveProperty.Platform.Shared/ObjectExtensions/ObserveEveryValueChangedExtensions.cs @@ -15,7 +15,8 @@ public static class ObserveEveryValueChangedExtensions public static IObservable ObserveEveryValueChanged(this TSource source, Func propertySelector, IEqualityComparer comparer = null) where TSource : class { - if (source == null) { + if (source == null) + { return Observable.Empty(); } @@ -24,20 +25,29 @@ public static IObservable ObserveEveryValueChanged(observer => { + return Observable.Create(observer => + { var currentValue = default(TProperty); var prevValue = default(TProperty); var t = reference.Target; - if (t != null) { - try { + if (t != null) + { + try + { currentValue = propertySelector((TSource)t); - } catch (Exception ex) { + } + catch (Exception ex) + { observer.OnError(ex); - } finally { + } + finally + { t = null; } - } else { + } + else + { observer.OnCompleted(); return Disposable.Empty; } @@ -49,21 +59,31 @@ public static IObservable ObserveEveryValueChanged (sender, e) => h.Invoke(e), h => CompositionTarget.Rendering += h, h => CompositionTarget.Rendering -= h) - .Subscribe(_ => { + .Subscribe(_ => + { var target = reference.Target; - if (target != null) { - try { + if (target != null) + { + try + { currentValue = propertySelector((TSource)target); - } catch (Exception ex) { + } + catch (Exception ex) + { observer.OnError(ex); - } finally { + } + finally + { target = null; } - } else { + } + else + { observer.OnCompleted(); } - if (!comparer.Equals(currentValue, prevValue)) { + if (!comparer.Equals(currentValue, prevValue)) + { observer.OnNext(currentValue); prevValue = currentValue; } diff --git a/Source/ReactiveProperty.Platform.UWP/ReactiveProperty.Platform.UWP.csproj b/Source/ReactiveProperty.Platform.UWP/ReactiveProperty.Platform.UWP.csproj index 17f024b3..df090081 100644 --- a/Source/ReactiveProperty.Platform.UWP/ReactiveProperty.Platform.UWP.csproj +++ b/Source/ReactiveProperty.Platform.UWP/ReactiveProperty.Platform.UWP.csproj @@ -138,13 +138,13 @@ - 6.1.7 + 6.1.9 2.0.0 - 4.1.0 + 4.1.2 diff --git a/Source/ReactiveProperty.Platform.iOS/IUICollectionViewDataSourceExtensions.cs b/Source/ReactiveProperty.Platform.iOS/IUICollectionViewDataSourceExtensions.cs index 73c86eec..69fa19bc 100644 --- a/Source/ReactiveProperty.Platform.iOS/IUICollectionViewDataSourceExtensions.cs +++ b/Source/ReactiveProperty.Platform.iOS/IUICollectionViewDataSourceExtensions.cs @@ -39,13 +39,18 @@ public static IDisposable SetBindingCollectionViewDataSource( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null) { + if (updateSourceTrigger != null) + { var getter = AccessorCache.LookupGet(propertySelector, out propertyName); - updateSourceTrigger(self).Subscribe(_ => { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }).AddTo(d); @@ -80,12 +85,17 @@ public static IDisposable SetBindingCollectionViewDataSource( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null && getter != null) { - updateSourceTrigger(self).Subscribe(_ => { + if (updateSourceTrigger != null && getter != null) + { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }); diff --git a/Source/ReactiveProperty.Platform.iOS/IUITableViewDataSourceExtensions.cs b/Source/ReactiveProperty.Platform.iOS/IUITableViewDataSourceExtensions.cs index 984b864c..395fc2d3 100644 --- a/Source/ReactiveProperty.Platform.iOS/IUITableViewDataSourceExtensions.cs +++ b/Source/ReactiveProperty.Platform.iOS/IUITableViewDataSourceExtensions.cs @@ -39,13 +39,18 @@ public static IDisposable SetBindingTableViewDataSource( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null) { + if (updateSourceTrigger != null) + { var getter = AccessorCache.LookupGet(propertySelector, out propertyName); - updateSourceTrigger(self).Subscribe(_ => { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }).AddTo(d); @@ -80,12 +85,17 @@ public static IDisposable SetBindingTableViewDataSource( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null && getter != null) { - updateSourceTrigger(self).Subscribe(_ => { + if (updateSourceTrigger != null && getter != null) + { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }); diff --git a/Source/ReactiveProperty.Platform.iOS/Internal/AccessorCache.cs b/Source/ReactiveProperty.Platform.iOS/Internal/AccessorCache.cs index 5a8923c6..b6615d7e 100644 --- a/Source/ReactiveProperty.Platform.iOS/Internal/AccessorCache.cs +++ b/Source/ReactiveProperty.Platform.iOS/Internal/AccessorCache.cs @@ -15,8 +15,10 @@ public static Func LookupGet(Expression LookupSet(ExpressionMinimumRecommendedRules.ruleset - - + + diff --git a/Source/ReactiveProperty.Platform.iOS/UIBarItemExtensions.cs b/Source/ReactiveProperty.Platform.iOS/UIBarItemExtensions.cs index 06c1c224..80ac36b9 100644 --- a/Source/ReactiveProperty.Platform.iOS/UIBarItemExtensions.cs +++ b/Source/ReactiveProperty.Platform.iOS/UIBarItemExtensions.cs @@ -39,13 +39,18 @@ public static IDisposable SetBindingBarItem( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null) { + if (updateSourceTrigger != null) + { var getter = AccessorCache.LookupGet(propertySelector, out propertyName); - updateSourceTrigger(self).Subscribe(_ => { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }).AddTo(d); @@ -80,12 +85,17 @@ public static IDisposable SetBindingBarItem( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null && getter != null) { - updateSourceTrigger(self).Subscribe(_ => { + if (updateSourceTrigger != null && getter != null) + { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }); diff --git a/Source/ReactiveProperty.Platform.iOS/UICollectionViewSourceExtensions.cs b/Source/ReactiveProperty.Platform.iOS/UICollectionViewSourceExtensions.cs index 9fcac6fe..0ee46825 100644 --- a/Source/ReactiveProperty.Platform.iOS/UICollectionViewSourceExtensions.cs +++ b/Source/ReactiveProperty.Platform.iOS/UICollectionViewSourceExtensions.cs @@ -39,13 +39,18 @@ public static IDisposable SetBindingCollectionViewSource( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null) { + if (updateSourceTrigger != null) + { var getter = AccessorCache.LookupGet(propertySelector, out propertyName); - updateSourceTrigger(self).Subscribe(_ => { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }).AddTo(d); @@ -80,12 +85,17 @@ public static IDisposable SetBindingCollectionViewSource( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null && getter != null) { - updateSourceTrigger(self).Subscribe(_ => { + if (updateSourceTrigger != null && getter != null) + { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }); diff --git a/Source/ReactiveProperty.Platform.iOS/UIGestureRecognizerExtensions.cs b/Source/ReactiveProperty.Platform.iOS/UIGestureRecognizerExtensions.cs index 1bc14ba7..68488f5d 100644 --- a/Source/ReactiveProperty.Platform.iOS/UIGestureRecognizerExtensions.cs +++ b/Source/ReactiveProperty.Platform.iOS/UIGestureRecognizerExtensions.cs @@ -39,13 +39,18 @@ public static IDisposable SetBindingGestureRecognizer( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null) { + if (updateSourceTrigger != null) + { var getter = AccessorCache.LookupGet(propertySelector, out propertyName); - updateSourceTrigger(self).Subscribe(_ => { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }).AddTo(d); @@ -80,12 +85,17 @@ public static IDisposable SetBindingGestureRecognizer( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null && getter != null) { - updateSourceTrigger(self).Subscribe(_ => { + if (updateSourceTrigger != null && getter != null) + { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }); diff --git a/Source/ReactiveProperty.Platform.iOS/UIResponderExtensions.cs b/Source/ReactiveProperty.Platform.iOS/UIResponderExtensions.cs index 8d4c70d6..af12ee38 100644 --- a/Source/ReactiveProperty.Platform.iOS/UIResponderExtensions.cs +++ b/Source/ReactiveProperty.Platform.iOS/UIResponderExtensions.cs @@ -39,13 +39,18 @@ public static IDisposable SetBinding( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null) { + if (updateSourceTrigger != null) + { var getter = AccessorCache.LookupGet(propertySelector, out propertyName); - updateSourceTrigger(self).Subscribe(_ => { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }).AddTo(d); @@ -80,12 +85,17 @@ public static IDisposable SetBinding( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null && getter != null) { - updateSourceTrigger(self).Subscribe(_ => { + if (updateSourceTrigger != null && getter != null) + { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }); diff --git a/Source/ReactiveProperty.Platform.iOS/UITableViewSourceExtensions.cs b/Source/ReactiveProperty.Platform.iOS/UITableViewSourceExtensions.cs index ab6e14f6..06dd524c 100644 --- a/Source/ReactiveProperty.Platform.iOS/UITableViewSourceExtensions.cs +++ b/Source/ReactiveProperty.Platform.iOS/UITableViewSourceExtensions.cs @@ -39,13 +39,18 @@ public static IDisposable SetBindingTableViewSource( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null) { + if (updateSourceTrigger != null) + { var getter = AccessorCache.LookupGet(propertySelector, out propertyName); - updateSourceTrigger(self).Subscribe(_ => { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }).AddTo(d); @@ -80,12 +85,17 @@ public static IDisposable SetBindingTableViewSource( .Where(_ => !isUpdating) .Subscribe(x => setter(self, x)) .AddTo(d); - if (updateSourceTrigger != null && getter != null) { - updateSourceTrigger(self).Subscribe(_ => { + if (updateSourceTrigger != null && getter != null) + { + updateSourceTrigger(self).Subscribe(_ => + { isUpdating = true; - try { + try + { source.Value = getter(self); - } finally { + } + finally + { isUpdating = false; } }); diff --git a/Test/ReactiveProperty.Tests/AwaiterTest.cs b/Test/ReactiveProperty.Tests/AwaiterTest.cs index 79652290..a36f9492 100644 --- a/Test/ReactiveProperty.Tests/AwaiterTest.cs +++ b/Test/ReactiveProperty.Tests/AwaiterTest.cs @@ -44,7 +44,8 @@ public async Task AwaitPropertyHandler() Value = 999 }; - using (var handler = prop.GetAsyncHandler(CancellationToken.None)) { + using (var handler = prop.GetAsyncHandler(CancellationToken.None)) + { { var __ = Task.Delay(1000).ContinueWith(_ => prop.Value = 1000); } var v1 = await handler; v1.Is(1000); diff --git a/Test/ReactiveProperty.Tests/Binding/RxBindingExtensionsTest.cs b/Test/ReactiveProperty.Tests/Binding/RxBindingExtensionsTest.cs index b4fae92b..e58db73e 100644 --- a/Test/ReactiveProperty.Tests/Binding/RxBindingExtensionsTest.cs +++ b/Test/ReactiveProperty.Tests/Binding/RxBindingExtensionsTest.cs @@ -1,9 +1,6 @@ -using System; -using System.ComponentModel; +using System.ComponentModel; using System.Diagnostics; using System.Globalization; -using System.Reactive; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; @@ -75,7 +72,8 @@ public void BindToTwoWayConvertTest() o => o.Name, mode: BindingMode.TwoWay, convert: i => "value is " + i, - convertBack: s => { + convertBack: s => + { Debug.WriteLine(s); return int.Parse(s, NumberStyles.Integer); }, @@ -99,7 +97,8 @@ public void BindToOneWayToSourceTest() target.BindTo(obj, o => o.Name, mode: BindingMode.OneWayToSource, - convertBack: s => { + convertBack: s => + { Debug.WriteLine(s); return s + "!"; }, diff --git a/Test/ReactiveProperty.Tests/Binding/RxCommandExtensionsTest.cs b/Test/ReactiveProperty.Tests/Binding/RxCommandExtensionsTest.cs index 20f6ce1a..26e7ee99 100644 --- a/Test/ReactiveProperty.Tests/Binding/RxCommandExtensionsTest.cs +++ b/Test/ReactiveProperty.Tests/Binding/RxCommandExtensionsTest.cs @@ -1,10 +1,8 @@ using System; -using System.Reactive; using System.Reactive.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; using Reactive.Bindings.Binding; -using Reactive.Bindings.Extensions; namespace ReactiveProperty.Tests.Binding { diff --git a/Test/ReactiveProperty.Tests/ChainingAssertion.MSTest.cs b/Test/ReactiveProperty.Tests/ChainingAssertion.MSTest.cs index 0c336374..c79c2944 100644 --- a/Test/ReactiveProperty.Tests/ChainingAssertion.MSTest.cs +++ b/Test/ReactiveProperty.Tests/ChainingAssertion.MSTest.cs @@ -1212,4 +1212,4 @@ public static void Run "Age:" + x, // convert x => int.Parse(x.Replace("Age:", "")), // convertBack ignoreValidationErrorValue: true) - .SetValidateNotifyError((string x) => { + .SetValidateNotifyError((string x) => + { // no use return int.TryParse(x.Replace("Age:", ""), out var result) ? null : "error"; }); diff --git a/Test/ReactiveProperty.Tests/Extensions/InverseObservableExtensionsTest.cs b/Test/ReactiveProperty.Tests/Extensions/InverseObservableExtensionsTest.cs index c2770b69..1467e9ea 100644 --- a/Test/ReactiveProperty.Tests/Extensions/InverseObservableExtensionsTest.cs +++ b/Test/ReactiveProperty.Tests/Extensions/InverseObservableExtensionsTest.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using System.Text; -using System.Threading.Tasks; +using System.Reactive.Subjects; using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings.Extensions; diff --git a/Test/ReactiveProperty.Tests/Extensions/ObserveCollectionExtensionsTest.cs b/Test/ReactiveProperty.Tests/Extensions/ObserveCollectionExtensionsTest.cs index da9656ec..d8fd3a0e 100644 --- a/Test/ReactiveProperty.Tests/Extensions/ObserveCollectionExtensionsTest.cs +++ b/Test/ReactiveProperty.Tests/Extensions/ObserveCollectionExtensionsTest.cs @@ -574,7 +574,8 @@ public string Name set { - if (name != value) { + if (name != value) + { name = value; RaisePropertyChanged(); } @@ -592,7 +593,8 @@ public int Age set { - if (age != value) { + if (age != value) + { age = value; RaisePropertyChanged(); } @@ -614,7 +616,8 @@ public int Age private void RaisePropertyChanged([CallerMemberName] string propertyName = null) { var handler = PropertyChanged; - if (handler != null) { + if (handler != null) + { handler(this, new PropertyChangedEventArgs(propertyName)); } } diff --git a/Test/ReactiveProperty.Tests/Extensions/OldNewPairTest.cs b/Test/ReactiveProperty.Tests/Extensions/OldNewPairTest.cs index 949b178e..622dc99b 100644 --- a/Test/ReactiveProperty.Tests/Extensions/OldNewPairTest.cs +++ b/Test/ReactiveProperty.Tests/Extensions/OldNewPairTest.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Reactive.Testing; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Reactive.Bindings; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings.Extensions; namespace ReactiveProperty.Tests diff --git a/Test/ReactiveProperty.Tests/Extensions/PairwiseTest.cs b/Test/ReactiveProperty.Tests/Extensions/PairwiseTest.cs index 22fa09c4..467c3b61 100644 --- a/Test/ReactiveProperty.Tests/Extensions/PairwiseTest.cs +++ b/Test/ReactiveProperty.Tests/Extensions/PairwiseTest.cs @@ -1,12 +1,9 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Reactive.Bindings; using Reactive.Bindings.Extensions; -using Reactive.Bindings.Interactivity; namespace ReactiveProperty.Tests { diff --git a/Test/ReactiveProperty.Tests/Extensions/ReactiveCollectionTest.cs b/Test/ReactiveProperty.Tests/Extensions/ReactiveCollectionTest.cs index 662f2405..9931f5bf 100644 --- a/Test/ReactiveProperty.Tests/Extensions/ReactiveCollectionTest.cs +++ b/Test/ReactiveProperty.Tests/Extensions/ReactiveCollectionTest.cs @@ -1,8 +1,4 @@ -using System; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; +using System.Reactive.Subjects; using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; diff --git a/Test/ReactiveProperty.Tests/Extensions/RetryObservableExtensionsTest.cs b/Test/ReactiveProperty.Tests/Extensions/RetryObservableExtensionsTest.cs index e4ace4a7..d048420e 100644 --- a/Test/ReactiveProperty.Tests/Extensions/RetryObservableExtensionsTest.cs +++ b/Test/ReactiveProperty.Tests/Extensions/RetryObservableExtensionsTest.cs @@ -1,12 +1,8 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Net; using System.Reactive.Linq; -using System.Reactive.Subjects; using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Reactive.Bindings; using Reactive.Bindings.Extensions; namespace ReactiveProperty.Tests diff --git a/Test/ReactiveProperty.Tests/Helpers/FilteredReadOnlyObservableCollectionTest.cs b/Test/ReactiveProperty.Tests/Helpers/FilteredReadOnlyObservableCollectionTest.cs index 80082188..bc905b3f 100644 --- a/Test/ReactiveProperty.Tests/Helpers/FilteredReadOnlyObservableCollectionTest.cs +++ b/Test/ReactiveProperty.Tests/Helpers/FilteredReadOnlyObservableCollectionTest.cs @@ -5,8 +5,6 @@ using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings.Extensions; using Reactive.Bindings.Helpers; diff --git a/Test/ReactiveProperty.Tests/Init.cs b/Test/ReactiveProperty.Tests/Init.cs index 1fd83bb9..94e73e02 100644 --- a/Test/ReactiveProperty.Tests/Init.cs +++ b/Test/ReactiveProperty.Tests/Init.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; +using System.Net; using System.Reactive.Concurrency; -using System.Text; -using System.Threading; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; diff --git a/Test/ReactiveProperty.Tests/Interactivity/EventToReactiveTest.cs b/Test/ReactiveProperty.Tests/Interactivity/EventToReactiveTest.cs index 2d0ec43d..1461cb0e 100644 --- a/Test/ReactiveProperty.Tests/Interactivity/EventToReactiveTest.cs +++ b/Test/ReactiveProperty.Tests/Interactivity/EventToReactiveTest.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Text; -using System.Threading; +using System.Reactive; using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; diff --git a/Test/ReactiveProperty.Tests/Notifiers/BooleanNotifierTest.cs b/Test/ReactiveProperty.Tests/Notifiers/BooleanNotifierTest.cs index 29b0e714..dc226bff 100644 --- a/Test/ReactiveProperty.Tests/Notifiers/BooleanNotifierTest.cs +++ b/Test/ReactiveProperty.Tests/Notifiers/BooleanNotifierTest.cs @@ -1,6 +1,4 @@ -using System; -using System.Reactive.Linq; -using Microsoft.Reactive.Testing; +using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings.Notifiers; diff --git a/Test/ReactiveProperty.Tests/Notifiers/BusyNotifierTest.cs b/Test/ReactiveProperty.Tests/Notifiers/BusyNotifierTest.cs index eac3c625..0247f032 100644 --- a/Test/ReactiveProperty.Tests/Notifiers/BusyNotifierTest.cs +++ b/Test/ReactiveProperty.Tests/Notifiers/BusyNotifierTest.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings.Notifiers; @@ -16,14 +12,17 @@ public void SimpleCase() { var n = new BusyNotifier(); var notifyPropertyChangedCounter = 0; - n.PropertyChanged += (_, e) => { - if (e.PropertyName == nameof(BusyNotifier.IsBusy)) { + n.PropertyChanged += (_, e) => + { + if (e.PropertyName == nameof(BusyNotifier.IsBusy)) + { notifyPropertyChangedCounter++; } }; var observeNotifyIsBusyCounter = 0; var latestNotifyIsBusyValue = false; - n.Subscribe(x => { + n.Subscribe(x => + { observeNotifyIsBusyCounter++; latestNotifyIsBusyValue = x; }); @@ -52,14 +51,17 @@ public void MultipleCase() { var n = new BusyNotifier(); var notifyPropertyChangedCounter = 0; - n.PropertyChanged += (_, e) => { - if (e.PropertyName == nameof(BusyNotifier.IsBusy)) { + n.PropertyChanged += (_, e) => + { + if (e.PropertyName == nameof(BusyNotifier.IsBusy)) + { notifyPropertyChangedCounter++; } }; var observeNotifyIsBusyCounter = 0; var latestNotifyIsBusyValue = false; - n.Subscribe(x => { + n.Subscribe(x => + { observeNotifyIsBusyCounter++; latestNotifyIsBusyValue = x; }); @@ -100,7 +102,8 @@ public void NotifyCase() var observeNotifyIsBusyCounter = 0; var latestNotifyIsBusyValue = false; - n.Subscribe(x => { + n.Subscribe(x => + { observeNotifyIsBusyCounter++; latestNotifyIsBusyValue = x; }); diff --git a/Test/ReactiveProperty.Tests/Notifiers/CountNotifierTest.cs b/Test/ReactiveProperty.Tests/Notifiers/CountNotifierTest.cs index 18430c4a..85b76f5b 100644 --- a/Test/ReactiveProperty.Tests/Notifiers/CountNotifierTest.cs +++ b/Test/ReactiveProperty.Tests/Notifiers/CountNotifierTest.cs @@ -1,5 +1,4 @@ using System; -using System.Reactive.Linq; using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings.Notifiers; diff --git a/Test/ReactiveProperty.Tests/Notifiers/MessageBrokerTest.cs b/Test/ReactiveProperty.Tests/Notifiers/MessageBrokerTest.cs index 8b6daf65..0cd804dc 100644 --- a/Test/ReactiveProperty.Tests/Notifiers/MessageBrokerTest.cs +++ b/Test/ReactiveProperty.Tests/Notifiers/MessageBrokerTest.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings.Notifiers; diff --git a/Test/ReactiveProperty.Tests/Notifiers/ScheduledNotifierTest.cs b/Test/ReactiveProperty.Tests/Notifiers/ScheduledNotifierTest.cs index ec516582..6c90cd69 100644 --- a/Test/ReactiveProperty.Tests/Notifiers/ScheduledNotifierTest.cs +++ b/Test/ReactiveProperty.Tests/Notifiers/ScheduledNotifierTest.cs @@ -1,7 +1,5 @@ using System; -using System.Diagnostics.Contracts; using System.Linq; -using System.Reactive.Concurrency; using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings.Notifiers; diff --git a/Test/ReactiveProperty.Tests/ReactiveCommandTest.cs b/Test/ReactiveProperty.Tests/ReactiveCommandTest.cs index 5abb4615..341b7950 100644 --- a/Test/ReactiveProperty.Tests/ReactiveCommandTest.cs +++ b/Test/ReactiveProperty.Tests/ReactiveCommandTest.cs @@ -1,11 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Text; -using System.Threading; using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; diff --git a/Test/ReactiveProperty.Tests/ReactiveProperty.Tests.csproj b/Test/ReactiveProperty.Tests/ReactiveProperty.Tests.csproj index 11e5c38f..d4e86cfe 100644 --- a/Test/ReactiveProperty.Tests/ReactiveProperty.Tests.csproj +++ b/Test/ReactiveProperty.Tests/ReactiveProperty.Tests.csproj @@ -8,13 +8,13 @@ true - + - - - + + + 2.0.3 diff --git a/Test/ReactiveProperty.Tests/ReactivePropertyPerformanceTest.cs b/Test/ReactiveProperty.Tests/ReactivePropertyPerformanceTest.cs index 3e53e548..19f8fae7 100644 --- a/Test/ReactiveProperty.Tests/ReactivePropertyPerformanceTest.cs +++ b/Test/ReactiveProperty.Tests/ReactivePropertyPerformanceTest.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Collections.Generic; using System.Reactive.Linq; -using System.Reactive.Subjects; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; using Reactive.Bindings.Extensions; @@ -18,7 +15,8 @@ public void PerformanceCheck() { var source = Observable.Return(1); var properties = new List>(); - for (var i = 0; i < 100000; i++) { + for (var i = 0; i < 100000; i++) + { properties.Add(source.ToReactiveProperty()); } } diff --git a/Test/ReactiveProperty.Tests/ReactivePropertySlimTest.cs b/Test/ReactiveProperty.Tests/ReactivePropertySlimTest.cs index b0bfb6ad..2e1475b7 100644 --- a/Test/ReactiveProperty.Tests/ReactivePropertySlimTest.cs +++ b/Test/ReactiveProperty.Tests/ReactivePropertySlimTest.cs @@ -1,12 +1,7 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Reactive; using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Text; -using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; diff --git a/Test/ReactiveProperty.Tests/ReactivePropertyTest.Static.cs b/Test/ReactiveProperty.Tests/ReactivePropertyTest.Static.cs index 9d87dbfb..9bdaf107 100644 --- a/Test/ReactiveProperty.Tests/ReactivePropertyTest.Static.cs +++ b/Test/ReactiveProperty.Tests/ReactivePropertyTest.Static.cs @@ -1,9 +1,5 @@ using System; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Reactive.Concurrency; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Reactive.Bindings; namespace RxPropTest { @@ -75,11 +71,15 @@ public void FromObjectConverterIgnoreValidationErrorValue() var rxAge = Reactive.Bindings.ReactiveProperty.FromObject(homuhomu, x => x.Age, x => Convert.ToString(x, 16), x => Convert.ToInt32(x, 16), ignoreValidationErrorValue: true) - .SetValidateNotifyError((string x) => { - try { + .SetValidateNotifyError((string x) => + { + try + { Convert.ToInt32(x, 16); return null; - } catch { + } + catch + { return "error"; } }); diff --git a/Test/ReactiveProperty.Tests/ReactivePropertyTest.cs b/Test/ReactiveProperty.Tests/ReactivePropertyTest.cs index 19fc0678..915d3018 100644 --- a/Test/ReactiveProperty.Tests/ReactivePropertyTest.cs +++ b/Test/ReactiveProperty.Tests/ReactivePropertyTest.cs @@ -2,11 +2,8 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Reactive; using System.Reactive.Linq; using System.Reactive.Subjects; -using System.Text; -using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; diff --git a/Test/ReactiveProperty.Tests/ReactivePropertyValidationTest.cs b/Test/ReactiveProperty.Tests/ReactivePropertyValidationTest.cs index 8cd8e5e4..dda8d9f5 100644 --- a/Test/ReactiveProperty.Tests/ReactivePropertyValidationTest.cs +++ b/Test/ReactiveProperty.Tests/ReactivePropertyValidationTest.cs @@ -149,7 +149,8 @@ public void AsyncValidation_ThrottleTest() { var scheduler = new TestScheduler(); var rprop = new ReactiveProperty() - .SetValidateNotifyError(xs => { + .SetValidateNotifyError(xs => + { return xs .Throttle(TimeSpan.FromSeconds(1), scheduler) .Select(x => string.IsNullOrEmpty(x) ? "required" : null); @@ -258,8 +259,10 @@ public TestTarget() .SetValidateNotifyError(s => string.IsNullOrWhiteSpace(s) ? "required" : null); TaskValidationTestProperty = new ReactiveProperty() - .SetValidateNotifyError(async s => { - if (string.IsNullOrWhiteSpace(s)) { + .SetValidateNotifyError(async s => + { + if (string.IsNullOrWhiteSpace(s)) + { return await Task.FromResult("required"); } return await Task.FromResult((string)null); diff --git a/Test/ReactiveProperty.Tests/ReactiveTimerTest.cs b/Test/ReactiveProperty.Tests/ReactiveTimerTest.cs index f2850579..1b0f6a5b 100644 --- a/Test/ReactiveProperty.Tests/ReactiveTimerTest.cs +++ b/Test/ReactiveProperty.Tests/ReactiveTimerTest.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Text; -using System.Threading; using Microsoft.Reactive.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; diff --git a/Test/ReactiveProperty.Tests/ReadOnlyReactiveCollectionTest.cs b/Test/ReactiveProperty.Tests/ReadOnlyReactiveCollectionTest.cs index 6e624c04..8186ba0f 100644 --- a/Test/ReactiveProperty.Tests/ReadOnlyReactiveCollectionTest.cs +++ b/Test/ReactiveProperty.Tests/ReadOnlyReactiveCollectionTest.cs @@ -6,7 +6,6 @@ using System.Reactive.Concurrency; using System.Reactive.Disposables; using System.Reactive.Subjects; -using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; diff --git a/Test/ReactiveProperty.Tests/ReadOnlyReactivePropertySlimTest.cs b/Test/ReactiveProperty.Tests/ReadOnlyReactivePropertySlimTest.cs index ec091deb..0854da6b 100644 --- a/Test/ReactiveProperty.Tests/ReadOnlyReactivePropertySlimTest.cs +++ b/Test/ReactiveProperty.Tests/ReadOnlyReactivePropertySlimTest.cs @@ -1,12 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Concurrency; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Reactive.Subjects; -using System.Text; -using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; @@ -92,7 +89,8 @@ public void PropertyChangedTest() var s = new Subject(); var rp = s.ToReadOnlyReactivePropertySlim(); var buffer = new List(); - rp.PropertyChanged += (_, args) => { + rp.PropertyChanged += (_, args) => + { buffer.Add(args.PropertyName); }; @@ -115,7 +113,8 @@ public void PropertyChangedNoDistinctUntilChangedTest() var rp = s.ToReadOnlyReactivePropertySlim( mode: ReactivePropertyMode.RaiseLatestValueOnSubscribe); var buffer = new List(); - rp.PropertyChanged += (_, args) => { + rp.PropertyChanged += (_, args) => + { buffer.Add(args.PropertyName); }; @@ -143,7 +142,8 @@ public void BehaviorSubjectTest() public void ObservableCreateTest() { var i = 0; - var s = Observable.Create(ox => { + var s = Observable.Create(ox => + { i++; return Disposable.Empty; }); diff --git a/Test/ReactiveProperty.Tests/ReadOnlyReactivePropertyTest.cs b/Test/ReactiveProperty.Tests/ReadOnlyReactivePropertyTest.cs index 45965d9e..5699be1e 100644 --- a/Test/ReactiveProperty.Tests/ReadOnlyReactivePropertyTest.cs +++ b/Test/ReactiveProperty.Tests/ReadOnlyReactivePropertyTest.cs @@ -1,12 +1,9 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Reactive.Concurrency; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Reactive.Subjects; -using System.Text; -using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Reactive.Bindings; @@ -93,7 +90,8 @@ public void PropertyChangedTest() var s = new Subject(); var rp = s.ToReadOnlyReactiveProperty(eventScheduler: Scheduler.CurrentThread); var buffer = new List(); - rp.PropertyChanged += (_, args) => { + rp.PropertyChanged += (_, args) => + { buffer.Add(args.PropertyName); }; @@ -117,7 +115,8 @@ public void PropertyChangedNoDistinctUntilChangedTest() mode: ReactivePropertyMode.RaiseLatestValueOnSubscribe, eventScheduler: Scheduler.CurrentThread); var buffer = new List(); - rp.PropertyChanged += (_, args) => { + rp.PropertyChanged += (_, args) => + { buffer.Add(args.PropertyName); }; @@ -167,7 +166,8 @@ public void BehaviorSubjectTest() public void ObservableCreateTest() { var i = 0; - var s = Observable.Create(ox => { + var s = Observable.Create(ox => + { i++; return Disposable.Empty; });