Bladeren bron

Remove ReactiveUI usage from sample apps

Nikita Tsukanov 5 jaren geleden
bovenliggende
commit
303b6c1586
45 gewijzigde bestanden met toevoegingen van 349 en 145 verwijderingen
  1. 27 0
      Avalonia.sln
  2. 0 2
      samples/BindingDemo/App.xaml.cs
  3. 1 2
      samples/BindingDemo/BindingDemo.csproj
  4. 2 2
      samples/BindingDemo/ViewModels/ExceptionErrorViewModel.cs
  5. 2 2
      samples/BindingDemo/ViewModels/IndeiErrorViewModel.cs
  6. 6 6
      samples/BindingDemo/ViewModels/MainWindowViewModel.cs
  7. 4 4
      samples/BindingDemo/ViewModels/NestedCommandViewModel.cs
  8. 2 2
      samples/BindingDemo/ViewModels/TestItem.cs
  9. 1 3
      samples/ControlCatalog.Desktop/Program.cs
  10. 0 2
      samples/ControlCatalog.NetCore/Program.cs
  11. 1 1
      samples/ControlCatalog/ControlCatalog.csproj
  12. 0 1
      samples/ControlCatalog/Pages/LabelsPage.axaml.cs
  13. 1 1
      samples/ControlCatalog/Pages/ListBoxPage.xaml
  14. 0 1
      samples/ControlCatalog/Pages/MenuPage.xaml.cs
  15. 2 2
      samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs
  16. 2 2
      samples/ControlCatalog/Pages/ScrollViewerPage.xaml.cs
  17. 2 2
      samples/ControlCatalog/Pages/TabControlPage.xaml.cs
  18. 7 7
      samples/ControlCatalog/ViewModels/ContextMenuPageViewModel.cs
  19. 3 3
      samples/ControlCatalog/ViewModels/ItemsRepeaterPageViewModel.cs
  20. 13 14
      samples/ControlCatalog/ViewModels/ListBoxPageViewModel.cs
  21. 14 14
      samples/ControlCatalog/ViewModels/MainWindowViewModel.cs
  22. 7 7
      samples/ControlCatalog/ViewModels/MenuPageViewModel.cs
  23. 5 5
      samples/ControlCatalog/ViewModels/NotificationViewModel.cs
  24. 2 2
      samples/ControlCatalog/ViewModels/SplitViewPageViewModel.cs
  25. 8 8
      samples/ControlCatalog/ViewModels/TreeViewPageViewModel.cs
  26. 66 0
      samples/MiniMvvm/MiniCommand.cs
  27. 6 0
      samples/MiniMvvm/MiniMvvm.csproj
  28. 108 0
      samples/MiniMvvm/PropertyChangedExtensions.cs
  29. 26 0
      samples/MiniMvvm/ViewModelBase.cs
  30. 0 1
      samples/Previewer/Previewer.csproj
  31. 0 2
      samples/RenderDemo/App.xaml.cs
  32. 1 1
      samples/RenderDemo/MainWindow.xaml.cs
  33. 1 2
      samples/RenderDemo/RenderDemo.csproj
  34. 2 2
      samples/RenderDemo/ViewModels/AnimationsPageViewModel.cs
  35. 8 9
      samples/RenderDemo/ViewModels/MainWindowViewModel.cs
  36. 0 2
      samples/Sandbox/Program.cs
  37. 0 1
      samples/Sandbox/Sandbox.csproj
  38. 0 2
      samples/VirtualizationDemo/Program.cs
  39. 2 2
      samples/VirtualizationDemo/ViewModels/ItemViewModel.cs
  40. 12 12
      samples/VirtualizationDemo/ViewModels/MainWindowViewModel.cs
  41. 1 2
      samples/VirtualizationDemo/VirtualizationDemo.csproj
  42. 1 1
      samples/interop/Direct3DInteropSample/Direct3DInteropSample.csproj
  43. 2 2
      samples/interop/Direct3DInteropSample/MainWindowViewModel.cs
  44. 1 5
      samples/interop/WindowsInteropTest/WindowsInteropTest.csproj
  45. 0 4
      src/Android/Avalonia.AndroidTestApplication/Avalonia.AndroidTestApplication.csproj

+ 27 - 0
Avalonia.sln

@@ -230,6 +230,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicroComGenerator", "src\to
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.MicroCom", "src\Avalonia.MicroCom\Avalonia.MicroCom.csproj", "{FE2F3E5E-1E34-4972-8DC1-5C2C588E5ECE}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniMvvm", "samples\MiniMvvm\MiniMvvm.csproj", "{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}"
+EndProject
 Global
 	GlobalSection(SharedMSBuildProjectFiles) = preSolution
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{3c4c0cb4-0c0f-4450-a37b-148c84ff905f}*SharedItemsImports = 13
@@ -2116,6 +2118,30 @@ Global
 		{FE2F3E5E-1E34-4972-8DC1-5C2C588E5ECE}.Release|iPhone.Build.0 = Release|Any CPU
 		{FE2F3E5E-1E34-4972-8DC1-5C2C588E5ECE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
 		{FE2F3E5E-1E34-4972-8DC1-5C2C588E5ECE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.AppStore|Any CPU.Build.0 = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.AppStore|iPhone.Build.0 = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Release|Any CPU.Build.0 = Release|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Release|iPhone.Build.0 = Release|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -2176,6 +2202,7 @@ Global
 		{909A8CBD-7D0E-42FD-B841-022AD8925820} = {8B6A8209-894F-4BA1-B880-965FD453982C}
 		{11BE52AF-E2DD-4CF0-B19A-05285ACAF571} = {9B9E3891-2366-4253-A952-D08BCEB71098}
 		{AEC9031E-06EA-4A9E-9E7F-7D7C719404DD} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637}
+		{BC594FD5-4AF2-409E-A1E6-04123F54D7C5} = {9B9E3891-2366-4253-A952-D08BCEB71098}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {87366D66-1391-4D90-8999-95A620AD786A}

+ 0 - 2
samples/BindingDemo/App.xaml.cs

@@ -1,7 +1,6 @@
 using Avalonia;
 using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Markup.Xaml;
-using Avalonia.ReactiveUI;
 
 namespace BindingDemo
 {
@@ -25,7 +24,6 @@ namespace BindingDemo
         public static AppBuilder BuildAvaloniaApp()
           => AppBuilder.Configure<App>()
                 .UsePlatformDetect()
-                .UseReactiveUI()
                 .LogToTrace();
     }
 }

+ 1 - 2
samples/BindingDemo/BindingDemo.csproj

@@ -6,12 +6,11 @@
   <ItemGroup>
     <ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
     <ProjectReference Include="..\..\src\Linux\Avalonia.LinuxFramebuffer\Avalonia.LinuxFramebuffer.csproj" />
-    <ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj" />
+    <ProjectReference Include="..\MiniMvvm\MiniMvvm.csproj" />
   </ItemGroup>
   <Import Project="..\..\build\SampleApp.props" />
   <Import Project="..\..\build\EmbedXaml.props" />
   <Import Project="..\..\build\Rx.props" />
-  <Import Project="..\..\build\ReactiveUI.props" />
   <Import Condition="'$(TargetFramework)'=='net461'" Project="..\..\build\NetFX.props" />
   <Import Project="..\..\build\ReferenceCoreLibraries.props" />
   <Import Project="..\..\build\BuildTargets.targets" />

+ 2 - 2
samples/BindingDemo/ViewModels/ExceptionErrorViewModel.cs

@@ -1,9 +1,9 @@
-using ReactiveUI;
+using MiniMvvm;
 using System;
 
 namespace BindingDemo.ViewModels
 {
-    public class ExceptionErrorViewModel : ReactiveObject
+    public class ExceptionErrorViewModel : ViewModelBase
     {
         private int _lessThan10;
 

+ 2 - 2
samples/BindingDemo/ViewModels/IndeiErrorViewModel.cs

@@ -1,11 +1,11 @@
-using ReactiveUI;
+using MiniMvvm;
 using System;
 using System.ComponentModel;
 using System.Collections;
 
 namespace BindingDemo.ViewModels
 {
-    public class IndeiErrorViewModel : ReactiveObject, INotifyDataErrorInfo
+    public class IndeiErrorViewModel : ViewModelBase, INotifyDataErrorInfo
     {
         private int _maximum = 10;
         private int _value;

+ 6 - 6
samples/BindingDemo/ViewModels/MainWindowViewModel.cs

@@ -5,14 +5,14 @@ using System.Reactive;
 using System.Reactive.Linq;
 using System.Threading.Tasks;
 using System.Threading;
-using ReactiveUI;
+using MiniMvvm;
 using Avalonia.Controls;
 using Avalonia.Metadata;
 using Avalonia.Controls.Selection;
 
 namespace BindingDemo.ViewModels
 {
-    public class MainWindowViewModel : ReactiveObject
+    public class MainWindowViewModel : ViewModelBase
     {
         private string _booleanString = "True";
         private double _doubleValue = 5.0;
@@ -32,13 +32,13 @@ namespace BindingDemo.ViewModels
 
             Selection = new SelectionModel<TestItem> { SingleSelect = false };
 
-            ShuffleItems = ReactiveCommand.Create(() =>
+            ShuffleItems = MiniCommand.Create(() =>
             {
                 var r = new Random();
                 Items.Move(r.Next(Items.Count), 1);
             });
 
-            StringValueCommand = ReactiveCommand.Create<object>(param =>
+            StringValueCommand = MiniCommand.Create<object>(param =>
             {
                 BooleanFlag = !BooleanFlag;
                 StringValue = param.ToString();
@@ -60,7 +60,7 @@ namespace BindingDemo.ViewModels
 
         public ObservableCollection<TestItem> Items { get; }
         public SelectionModel<TestItem> Selection { get; }
-        public ReactiveCommand<Unit, Unit> ShuffleItems { get; }
+        public MiniCommand ShuffleItems { get; }
 
         public string BooleanString
         {
@@ -93,7 +93,7 @@ namespace BindingDemo.ViewModels
         }
 
         public IObservable<DateTimeOffset> CurrentTimeObservable { get; }
-        public ReactiveCommand<object, Unit> StringValueCommand { get; }
+        public MiniCommand StringValueCommand { get; }
 
         public DataAnnotationsErrorViewModel DataAnnotationsValidation { get; } = new DataAnnotationsErrorViewModel();
         public ExceptionErrorViewModel ExceptionDataValidation { get; } = new ExceptionErrorViewModel();

+ 4 - 4
samples/BindingDemo/ViewModels/NestedCommandViewModel.cs

@@ -1,18 +1,18 @@
-using ReactiveUI;
-using System;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Input;
+using MiniMvvm;
 
 namespace BindingDemo.ViewModels
 {
-    public class NestedCommandViewModel : ReactiveObject
+    public class NestedCommandViewModel : ViewModelBase
     {
         public NestedCommandViewModel()
         {
-            Command = ReactiveCommand.Create(() => { });
+            Command = MiniCommand.Create(() => { });
         }
 
         public ICommand Command { get; }

+ 2 - 2
samples/BindingDemo/ViewModels/TestItem.cs

@@ -1,8 +1,8 @@
-using ReactiveUI;
+using MiniMvvm;
 
 namespace BindingDemo.ViewModels
 {
-    public class TestItem : ReactiveObject
+    public class TestItem : ViewModelBase
     {
         private string _stringValue = "String Value";
         private string _detail;

+ 1 - 3
samples/ControlCatalog.Desktop/Program.cs

@@ -3,7 +3,6 @@ using System.Linq;
 using Avalonia;
 using Avalonia.Controls;
 using Avalonia.Platform;
-using Avalonia.ReactiveUI;
 
 namespace ControlCatalog
 {
@@ -19,8 +18,7 @@ namespace ControlCatalog
         public static AppBuilder BuildAvaloniaApp()
             => AppBuilder.Configure<App>()
                 .LogToTrace()
-                .UsePlatformDetect()
-                .UseReactiveUI();
+                .UsePlatformDetect();
 
         private static void ConfigureAssetAssembly(AppBuilder builder)
         {

+ 0 - 2
samples/ControlCatalog.NetCore/Program.cs

@@ -10,7 +10,6 @@ using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Dialogs;
 using Avalonia.Headless;
 using Avalonia.LogicalTree;
-using Avalonia.ReactiveUI;
 using Avalonia.Threading;
 
 namespace ControlCatalog.NetCore
@@ -118,7 +117,6 @@ namespace ControlCatalog.NetCore
                     AllowEglInitialization = true
                 })
                 .UseSkia()
-                .UseReactiveUI()
                 .UseManagedSystemDialogs()
                 .LogToTrace();
 

+ 1 - 1
samples/ControlCatalog/ControlCatalog.csproj

@@ -24,8 +24,8 @@
   <ItemGroup>
     <ProjectReference Include="..\..\packages\Avalonia\Avalonia.csproj" />
     <ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
-    <ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj" />
     <ProjectReference Include="..\..\src\Avalonia.Controls.DataGrid\Avalonia.Controls.DataGrid.csproj" />
+    <ProjectReference Include="..\MiniMvvm\MiniMvvm.csproj" />
   </ItemGroup>
   
   <Import Project="..\..\build\BuildTargets.targets" />

+ 0 - 1
samples/ControlCatalog/Pages/LabelsPage.axaml.cs

@@ -2,7 +2,6 @@
 using Avalonia.Controls;
 using Avalonia.Markup.Xaml;
 using ControlCatalog.Models;
-using ReactiveUI;
 
 namespace ControlCatalog.Pages
 {

+ 1 - 1
samples/ControlCatalog/Pages/ListBoxPage.xaml

@@ -20,6 +20,6 @@
     <ListBox Items="{Binding Items}"
              Selection="{Binding Selection}"
              AutoScrollToSelectedItem="{Binding AutoScrollToSelectedItem}"
-             SelectionMode="{Binding SelectionMode}"/>
+             SelectionMode="{Binding SelectionMode^}"/>
   </DockPanel>
 </UserControl>

+ 0 - 1
samples/ControlCatalog/Pages/MenuPage.xaml.cs

@@ -6,7 +6,6 @@ using System.Windows.Input;
 using Avalonia.Controls;
 using Avalonia.Markup.Xaml;
 using ControlCatalog.ViewModels;
-using ReactiveUI;
 
 namespace ControlCatalog.Pages
 {

+ 2 - 2
samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs

@@ -6,7 +6,7 @@ using Avalonia;
 using Avalonia.Controls;
 using Avalonia.Controls.Primitives;
 using Avalonia.Markup.Xaml;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.Pages
 {
@@ -26,7 +26,7 @@ namespace ControlCatalog.Pages
 
     }
 
-    public class NumbersPageViewModel : ReactiveObject
+    public class NumbersPageViewModel : ViewModelBase
     {
         private IList<FormatObject> _formats;
         private FormatObject _selectedFormat;

+ 2 - 2
samples/ControlCatalog/Pages/ScrollViewerPage.xaml.cs

@@ -2,11 +2,11 @@ using System.Collections.Generic;
 using Avalonia.Controls;
 using Avalonia.Controls.Primitives;
 using Avalonia.Markup.Xaml;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.Pages
 {
-    public class ScrollViewerPageViewModel : ReactiveObject
+    public class ScrollViewerPageViewModel : ViewModelBase
     {
         private bool _allowAutoHide;
         private ScrollBarVisibility _horizontalScrollVisibility;

+ 2 - 2
samples/ControlCatalog/Pages/TabControlPage.xaml.cs

@@ -6,7 +6,7 @@ using Avalonia.Markup.Xaml;
 using Avalonia.Media.Imaging;
 using Avalonia.Platform;
 
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.Pages
 {
@@ -56,7 +56,7 @@ namespace ControlCatalog.Pages
             return new Bitmap(assets.Open(new Uri(uri)));
         }
 
-        private class PageViewModel : ReactiveObject
+        private class PageViewModel : ViewModelBase
         {
             private Dock _tabPlacement;
 

+ 7 - 7
samples/ControlCatalog/ViewModels/ContextMenuPageViewModel.cs

@@ -3,7 +3,7 @@ using System.Reactive;
 using System.Threading.Tasks;
 using Avalonia.Controls;
 using Avalonia.VisualTree;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.ViewModels
 {
@@ -12,9 +12,9 @@ namespace ControlCatalog.ViewModels
         public Control View { get; set; }
         public ContextMenuPageViewModel()
         {
-            OpenCommand = ReactiveCommand.CreateFromTask(Open);
-            SaveCommand = ReactiveCommand.Create(Save);
-            OpenRecentCommand = ReactiveCommand.Create<string>(OpenRecent);
+            OpenCommand = MiniCommand.CreateFromTask(Open);
+            SaveCommand = MiniCommand.Create(Save);
+            OpenRecentCommand = MiniCommand.Create<string>(OpenRecent);
 
             MenuItems = new[]
             {
@@ -44,9 +44,9 @@ namespace ControlCatalog.ViewModels
         }
 
         public IReadOnlyList<MenuItemViewModel> MenuItems { get; set; }
-        public ReactiveCommand<Unit, Unit> OpenCommand { get; }
-        public ReactiveCommand<Unit, Unit> SaveCommand { get; }
-        public ReactiveCommand<string, Unit> OpenRecentCommand { get; }
+        public MiniCommand OpenCommand { get; }
+        public MiniCommand SaveCommand { get; }
+        public MiniCommand OpenRecentCommand { get; }
 
         public async Task Open()
         {

+ 3 - 3
samples/ControlCatalog/ViewModels/ItemsRepeaterPageViewModel.cs

@@ -2,11 +2,11 @@
 using System.Collections.ObjectModel;
 using System.Linq;
 using Avalonia.Media;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.ViewModels
 {
-    public class ItemsRepeaterPageViewModel : ReactiveObject
+    public class ItemsRepeaterPageViewModel : ViewModelBase
     {
         private int _newItemIndex = 1;
         private int _newGenerationIndex = 0;
@@ -59,7 +59,7 @@ namespace ControlCatalog.ViewModels
                 }));
         }
 
-        public class Item : ReactiveObject
+        public class Item : ViewModelBase
         {
             private double _height = double.NaN;
 

+ 13 - 14
samples/ControlCatalog/ViewModels/ListBoxPageViewModel.cs

@@ -4,18 +4,18 @@ using System.Linq;
 using System.Reactive;
 using Avalonia.Controls;
 using Avalonia.Controls.Selection;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.ViewModels
 {
-    public class ListBoxPageViewModel : ReactiveObject
+    public class ListBoxPageViewModel : ViewModelBase
     {
         private bool _multiple;
         private bool _toggle;
         private bool _alwaysSelected;
         private bool _autoScrollToSelectedItem = true;
         private int _counter;
-        private ObservableAsPropertyHelper<SelectionMode> _selectionMode;
+        private IObservable<SelectionMode> _selectionMode;
 
         public ListBoxPageViewModel()
         {
@@ -29,14 +29,13 @@ namespace ControlCatalog.ViewModels
                 x => x.Toggle,
                 x => x.AlwaysSelected,
                 (m, t, a) =>
-                    (m ? SelectionMode.Multiple : 0) |
-                    (t ? SelectionMode.Toggle : 0) |
-                    (a ? SelectionMode.AlwaysSelected : 0))
-                .ToProperty(this, x => x.SelectionMode);
+                    (m ? Avalonia.Controls.SelectionMode.Multiple : 0) |
+                    (t ? Avalonia.Controls.SelectionMode.Toggle : 0) |
+                    (a ? Avalonia.Controls.SelectionMode.AlwaysSelected : 0));
 
-            AddItemCommand = ReactiveCommand.Create(() => Items.Add(GenerateItem()));
+            AddItemCommand = MiniCommand.Create(() => Items.Add(GenerateItem()));
 
-            RemoveItemCommand = ReactiveCommand.Create(() =>
+            RemoveItemCommand = MiniCommand.Create(() =>
             {
                 var items = Selection.SelectedItems.ToList();
 
@@ -46,7 +45,7 @@ namespace ControlCatalog.ViewModels
                 }
             });
 
-            SelectRandomItemCommand = ReactiveCommand.Create(() =>
+            SelectRandomItemCommand = MiniCommand.Create(() =>
             {
                 var random = new Random();
 
@@ -60,7 +59,7 @@ namespace ControlCatalog.ViewModels
 
         public ObservableCollection<string> Items { get; }
         public SelectionModel<string> Selection { get; }
-        public SelectionMode SelectionMode => _selectionMode.Value;
+        public IObservable<SelectionMode> SelectionMode => _selectionMode;
 
         public bool Multiple
         {
@@ -86,9 +85,9 @@ namespace ControlCatalog.ViewModels
             set => this.RaiseAndSetIfChanged(ref _autoScrollToSelectedItem, value);
         }
 
-        public ReactiveCommand<Unit, Unit> AddItemCommand { get; }
-        public ReactiveCommand<Unit, Unit> RemoveItemCommand { get; }
-        public ReactiveCommand<Unit, Unit> SelectRandomItemCommand { get; }
+        public MiniCommand AddItemCommand { get; }
+        public MiniCommand RemoveItemCommand { get; }
+        public MiniCommand SelectRandomItemCommand { get; }
 
         private string GenerateItem() => $"Item {_counter++.ToString()}";
     }

+ 14 - 14
samples/ControlCatalog/ViewModels/MainWindowViewModel.cs

@@ -5,11 +5,11 @@ using Avalonia.Controls.Notifications;
 using Avalonia.Dialogs;
 using Avalonia.Platform;
 using System;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.ViewModels
 {
-    class MainWindowViewModel : ReactiveObject
+    class MainWindowViewModel : ViewModelBase
     {
         private IManagedNotificationManager _notificationManager;
 
@@ -27,22 +27,22 @@ namespace ControlCatalog.ViewModels
         {
             _notificationManager = notificationManager;
 
-            ShowCustomManagedNotificationCommand = ReactiveCommand.Create(() =>
+            ShowCustomManagedNotificationCommand = MiniCommand.Create(() =>
             {
                 NotificationManager.Show(new NotificationViewModel(NotificationManager) { Title = "Hey There!", Message = "Did you know that Avalonia now supports Custom In-Window Notifications?" });
             });
 
-            ShowManagedNotificationCommand = ReactiveCommand.Create(() =>
+            ShowManagedNotificationCommand = MiniCommand.Create(() =>
             {
                 NotificationManager.Show(new Avalonia.Controls.Notifications.Notification("Welcome", "Avalonia now supports Notifications.", NotificationType.Information));
             });
 
-            ShowNativeNotificationCommand = ReactiveCommand.Create(() =>
+            ShowNativeNotificationCommand = MiniCommand.Create(() =>
             {
                 NotificationManager.Show(new Avalonia.Controls.Notifications.Notification("Error", "Native Notifications are not quite ready. Coming soon.", NotificationType.Error));
             });
 
-            AboutCommand = ReactiveCommand.CreateFromTask(async () =>
+            AboutCommand = MiniCommand.CreateFromTask(async () =>
             {
                 var dialog = new AboutAvaloniaDialog();
 
@@ -51,12 +51,12 @@ namespace ControlCatalog.ViewModels
                 await dialog.ShowDialog(mainWindow);
             });
 
-            ExitCommand = ReactiveCommand.Create(() =>
+            ExitCommand = MiniCommand.Create(() =>
             {
                 (App.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime).Shutdown();
             });
 
-            ToggleMenuItemCheckedCommand = ReactiveCommand.Create(() =>
+            ToggleMenuItemCheckedCommand = MiniCommand.Create(() =>
             {
                 IsMenuItemChecked = !IsMenuItemChecked;
             });
@@ -153,16 +153,16 @@ namespace ControlCatalog.ViewModels
             set { this.RaiseAndSetIfChanged(ref _isMenuItemChecked, value); }
         }
 
-        public ReactiveCommand<Unit, Unit> ShowCustomManagedNotificationCommand { get; }
+        public MiniCommand ShowCustomManagedNotificationCommand { get; }
 
-        public ReactiveCommand<Unit, Unit> ShowManagedNotificationCommand { get; }
+        public MiniCommand ShowManagedNotificationCommand { get; }
 
-        public ReactiveCommand<Unit, Unit> ShowNativeNotificationCommand { get; }
+        public MiniCommand ShowNativeNotificationCommand { get; }
 
-        public ReactiveCommand<Unit, Unit> AboutCommand { get; }
+        public MiniCommand AboutCommand { get; }
 
-        public ReactiveCommand<Unit, Unit> ExitCommand { get; }
+        public MiniCommand ExitCommand { get; }
 
-        public ReactiveCommand<Unit, Unit> ToggleMenuItemCheckedCommand { get; }
+        public MiniCommand ToggleMenuItemCheckedCommand { get; }
     }
 }

+ 7 - 7
samples/ControlCatalog/ViewModels/MenuPageViewModel.cs

@@ -4,7 +4,7 @@ using System.Reactive.Linq;
 using System.Threading.Tasks;
 using Avalonia.Controls;
 using Avalonia.VisualTree;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.ViewModels
 {
@@ -13,9 +13,9 @@ namespace ControlCatalog.ViewModels
         public Control View { get; set; }
         public MenuPageViewModel()
         {
-            OpenCommand = ReactiveCommand.CreateFromTask(Open);
-            SaveCommand = ReactiveCommand.Create(Save, Observable.Return(false));
-            OpenRecentCommand = ReactiveCommand.Create<string>(OpenRecent);
+            OpenCommand = MiniCommand.CreateFromTask(Open);
+            SaveCommand = MiniCommand.Create(Save);
+            OpenRecentCommand = MiniCommand.Create<string>(OpenRecent);
 
             var recentItems = new[]
             {
@@ -65,9 +65,9 @@ namespace ControlCatalog.ViewModels
 
         public IReadOnlyList<MenuItemViewModel> MenuItems { get; set; }
         public IReadOnlyList<MenuItemViewModel> RecentItems { get; set; }
-        public ReactiveCommand<Unit, Unit> OpenCommand { get; }
-        public ReactiveCommand<Unit, Unit> SaveCommand { get; }
-        public ReactiveCommand<string, Unit> OpenRecentCommand { get; }
+        public MiniCommand OpenCommand { get; }
+        public MiniCommand SaveCommand { get; }
+        public MiniCommand OpenRecentCommand { get; }
 
         public async Task Open()
         {

+ 5 - 5
samples/ControlCatalog/ViewModels/NotificationViewModel.cs

@@ -1,6 +1,6 @@
 using System.Reactive;
 using Avalonia.Controls.Notifications;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.ViewModels
 {
@@ -8,12 +8,12 @@ namespace ControlCatalog.ViewModels
     {
         public NotificationViewModel(INotificationManager manager)
         {
-            YesCommand = ReactiveCommand.Create(() =>
+            YesCommand = MiniCommand.Create(() =>
             {
                 manager.Show(new Avalonia.Controls.Notifications.Notification("Avalonia Notifications", "Start adding notifications to your app today."));
             });
 
-            NoCommand = ReactiveCommand.Create(() =>
+            NoCommand = MiniCommand.Create(() =>
             {
                 manager.Show(new Avalonia.Controls.Notifications.Notification("Avalonia Notifications", "Start adding notifications to your app today. To find out more visit..."));
             });
@@ -22,9 +22,9 @@ namespace ControlCatalog.ViewModels
         public string Title { get; set; }
         public string Message { get; set; }
 
-        public ReactiveCommand<Unit, Unit> YesCommand { get; }
+        public MiniCommand YesCommand { get; }
 
-        public ReactiveCommand<Unit, Unit> NoCommand { get; }
+        public MiniCommand NoCommand { get; }
 
     }
 }

+ 2 - 2
samples/ControlCatalog/ViewModels/SplitViewPageViewModel.cs

@@ -1,10 +1,10 @@
 using System;
 using Avalonia.Controls;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.ViewModels
 {
-    public class SplitViewPageViewModel : ReactiveObject
+    public class SplitViewPageViewModel : ViewModelBase
     {
         private bool _isLeft = true;
         private int _displayMode = 3; //CompactOverlay

+ 8 - 8
samples/ControlCatalog/ViewModels/TreeViewPageViewModel.cs

@@ -3,11 +3,11 @@ using System.Collections.ObjectModel;
 using System.Linq;
 using System.Reactive;
 using Avalonia.Controls;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace ControlCatalog.ViewModels
 {
-    public class TreeViewPageViewModel : ReactiveObject
+    public class TreeViewPageViewModel : ViewModelBase
     {
         private readonly Node _root;
         private SelectionMode _selectionMode;
@@ -19,16 +19,16 @@ namespace ControlCatalog.ViewModels
             Items = _root.Children;
             SelectedItems = new ObservableCollection<Node>();
 
-            AddItemCommand = ReactiveCommand.Create(AddItem);
-            RemoveItemCommand = ReactiveCommand.Create(RemoveItem);
-            SelectRandomItemCommand = ReactiveCommand.Create(SelectRandomItem);
+            AddItemCommand = MiniCommand.Create(AddItem);
+            RemoveItemCommand = MiniCommand.Create(RemoveItem);
+            SelectRandomItemCommand = MiniCommand.Create(SelectRandomItem);
         }
 
         public ObservableCollection<Node> Items { get; }
         public ObservableCollection<Node> SelectedItems { get; }
-        public ReactiveCommand<Unit, Unit> AddItemCommand { get; }
-        public ReactiveCommand<Unit, Unit> RemoveItemCommand { get; }
-        public ReactiveCommand<Unit, Unit> SelectRandomItemCommand { get; }
+        public MiniCommand AddItemCommand { get; }
+        public MiniCommand RemoveItemCommand { get; }
+        public MiniCommand SelectRandomItemCommand { get; }
 
         public SelectionMode SelectionMode
         {

+ 66 - 0
samples/MiniMvvm/MiniCommand.cs

@@ -0,0 +1,66 @@
+using System;
+using System.Threading.Tasks;
+using System.Windows.Input;
+
+namespace MiniMvvm
+{
+    public sealed class MiniCommand<T> : MiniCommand, ICommand
+    {
+        private readonly Action<T> _cb;
+        private bool _busy;
+        private Func<T, Task> _acb;
+        
+        public MiniCommand(Action<T> cb)
+        {
+            _cb = cb;
+        }
+
+        public MiniCommand(Func<T, Task> cb)
+        {
+            _acb = cb;
+        }
+
+        private bool Busy
+        {
+            get => _busy;
+            set
+            {
+                _busy = value;
+                CanExecuteChanged?.Invoke(this, EventArgs.Empty);
+            }
+        }
+
+        
+        public override event EventHandler CanExecuteChanged;
+        public override bool CanExecute(object parameter) => !_busy;
+
+        public override async void Execute(object parameter)
+        {
+            if(Busy)
+                return;
+            try
+            {
+                Busy = true;
+                if (_cb != null)
+                    _cb((T)parameter);
+                else
+                    await _acb((T)parameter);
+            }
+            finally
+            {
+                Busy = false;
+            }
+        }
+    }
+    
+    public abstract class MiniCommand : ICommand
+    {
+        public static MiniCommand Create(Action cb) => new MiniCommand<object>(_ => cb());
+        public static MiniCommand Create<TArg>(Action<TArg> cb) => new MiniCommand<TArg>(cb);
+        public static MiniCommand CreateFromTask(Func<Task> cb) => new MiniCommand<object>(_ => cb());
+        
+        public abstract bool CanExecute(object parameter);
+        public abstract void Execute(object parameter);
+        public abstract event EventHandler CanExecuteChanged;
+    }
+}

+ 6 - 0
samples/MiniMvvm/MiniMvvm.csproj

@@ -0,0 +1,6 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>netstandard2.0</TargetFramework>
+  </PropertyGroup>
+  <Import Project="..\..\build\Rx.props" />
+</Project>

+ 108 - 0
samples/MiniMvvm/PropertyChangedExtensions.cs

@@ -0,0 +1,108 @@
+using System;
+using System.ComponentModel;
+using System.Linq.Expressions;
+using System.Reactive.Linq;
+using System.Reflection;
+
+namespace MiniMvvm
+{
+    public static class PropertyChangedExtensions
+    {
+        class PropertyObservable<T> : IObservable<T>
+        {
+            private readonly INotifyPropertyChanged _target;
+            private readonly PropertyInfo _info;
+
+            public PropertyObservable(INotifyPropertyChanged target, PropertyInfo info)
+            {
+                _target = target;
+                _info = info;
+            }
+
+            class Subscription : IDisposable
+            {
+                private readonly INotifyPropertyChanged _target;
+                private readonly PropertyInfo _info;
+                private readonly IObserver<T> _observer;
+
+                public Subscription(INotifyPropertyChanged target, PropertyInfo info, IObserver<T> observer)
+                {
+                    _target = target;
+                    _info = info;
+                    _observer = observer;
+                    _target.PropertyChanged += OnPropertyChanged;
+                    _observer.OnNext((T)_info.GetValue(_target));
+                }
+
+                private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
+                {
+                    if (e.PropertyName == _info.Name)
+                        _observer.OnNext((T)_info.GetValue(_target));
+                }
+
+                public void Dispose()
+                {
+                    _target.PropertyChanged -= OnPropertyChanged;
+                    _observer.OnCompleted();
+                }
+            }
+
+            public IDisposable Subscribe(IObserver<T> observer)
+            {
+                return new Subscription(_target, _info, observer);
+            }
+        }
+
+        public static IObservable<TRes> WhenAnyValue<TModel, TRes>(this TModel model,
+            Expression<Func<TModel, TRes>> expr) where TModel : INotifyPropertyChanged
+        {
+            var l = (LambdaExpression)expr;
+            var ma = (MemberExpression)l.Body;
+            var prop = (PropertyInfo)ma.Member;
+            return new PropertyObservable<TRes>(model, prop);
+        }
+        
+        public static IObservable<TRes> WhenAnyValue<TModel, T1, TRes>(this TModel model,
+            Expression<Func<TModel, T1>> v1,
+            Func<T1,  TRes> cb
+        ) where TModel : INotifyPropertyChanged
+        {
+            return model.WhenAnyValue(v1).Select(cb);
+        }
+        
+        public static IObservable<TRes> WhenAnyValue<TModel, T1, T2, TRes>(this TModel model,
+            Expression<Func<TModel, T1>> v1,
+            Expression<Func<TModel, T2>> v2,
+            Func<T1, T2, TRes> cb
+        ) where TModel : INotifyPropertyChanged =>
+            Observable.CombineLatest(
+                model.WhenAnyValue(v1),
+                model.WhenAnyValue(v2),
+                cb);
+
+        public static IObservable<ValueTuple<T1, T2>> WhenAnyValue<TModel, T1, T2>(this TModel model,
+            Expression<Func<TModel, T1>> v1,
+            Expression<Func<TModel, T2>> v2
+        ) where TModel : INotifyPropertyChanged =>
+            model.WhenAnyValue(v1, v2, (a1, a2) => (a1, a2));
+
+        public static IObservable<TRes> WhenAnyValue<TModel, T1, T2, T3, TRes>(this TModel model,
+            Expression<Func<TModel, T1>> v1,
+            Expression<Func<TModel, T2>> v2,
+            Expression<Func<TModel, T3>> v3,
+            Func<T1, T2, T3, TRes> cb
+        ) where TModel : INotifyPropertyChanged =>
+            Observable.CombineLatest(
+                model.WhenAnyValue(v1),
+                model.WhenAnyValue(v2),
+                model.WhenAnyValue(v3),
+                cb);
+
+        public static IObservable<ValueTuple<T1, T2, T3>> WhenAnyValue<TModel, T1, T2, T3>(this TModel model,
+            Expression<Func<TModel, T1>> v1,
+            Expression<Func<TModel, T2>> v2,
+            Expression<Func<TModel, T3>> v3
+        ) where TModel : INotifyPropertyChanged =>
+            model.WhenAnyValue(v1, v2, v3, (a1, a2, a3) => (a1, a2, a3));
+    }
+}

+ 26 - 0
samples/MiniMvvm/ViewModelBase.cs

@@ -0,0 +1,26 @@
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Reactive.Joins;
+using System.Runtime.CompilerServices;
+
+namespace MiniMvvm
+{
+    public class ViewModelBase : INotifyPropertyChanged
+    {
+        public event PropertyChangedEventHandler PropertyChanged;
+        protected bool RaiseAndSetIfChanged<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
+        {
+            if (!EqualityComparer<T>.Default.Equals(field, value))
+            {
+                field = value;
+                RaisePropertyChanged(propertyName);
+                return true;
+            }
+            return false;
+        }
+        
+        
+        protected void RaisePropertyChanged([CallerMemberName] string propertyName = null)
+            => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+    }
+}

+ 0 - 1
samples/Previewer/Previewer.csproj

@@ -8,7 +8,6 @@
       <DependentUpon>%(Filename)</DependentUpon>
     </Compile>
     <EmbeddedResource Include="**\*.xaml" />
-    <ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj" />
   </ItemGroup>
   
   <Import Project="..\..\build\SampleApp.props" />

+ 0 - 2
samples/RenderDemo/App.xaml.cs

@@ -1,7 +1,6 @@
 using Avalonia;
 using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Markup.Xaml;
-using Avalonia.ReactiveUI;
 
 namespace RenderDemo
 {
@@ -32,7 +31,6 @@ namespace RenderDemo
                    OverlayPopups = true,
                })
                 .UsePlatformDetect()
-                .UseReactiveUI()
                 .LogToTrace();
     }
 }

+ 1 - 1
samples/RenderDemo/MainWindow.xaml.cs

@@ -3,7 +3,7 @@ using Avalonia;
 using Avalonia.Controls;
 using Avalonia.Markup.Xaml;
 using RenderDemo.ViewModels;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace RenderDemo
 {

+ 1 - 2
samples/RenderDemo/RenderDemo.csproj

@@ -9,12 +9,11 @@
   <ItemGroup>
     <ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
     <ProjectReference Include="..\..\src\Linux\Avalonia.LinuxFramebuffer\Avalonia.LinuxFramebuffer.csproj" />
-    <ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj" />
+    <ProjectReference Include="..\MiniMvvm\MiniMvvm.csproj" />
   </ItemGroup>
   <Import Project="..\..\build\SampleApp.props" />
   <Import Project="..\..\build\EmbedXaml.props" />
   <Import Project="..\..\build\Rx.props" />
-  <Import Project="..\..\build\ReactiveUI.props" />
   <Import Condition="'$(TargetFramework)'=='net461'" Project="..\..\build\NetFX.props" />
   <Import Project="..\..\build\ReferenceCoreLibraries.props" />
   <Import Project="..\..\build\BuildTargets.targets" />

+ 2 - 2
samples/RenderDemo/ViewModels/AnimationsPageViewModel.cs

@@ -1,10 +1,10 @@
 using System;
-using ReactiveUI;
+using MiniMvvm;
 using Avalonia.Animation;
 
 namespace RenderDemo.ViewModels
 {
-    public class AnimationsPageViewModel : ReactiveObject
+    public class AnimationsPageViewModel : ViewModelBase
     {
         private bool _isPlaying = true;
 

+ 8 - 9
samples/RenderDemo/ViewModels/MainWindowViewModel.cs

@@ -1,11 +1,10 @@
 using System.Reactive;
 using System.Threading.Tasks;
-
-using ReactiveUI;
+using MiniMvvm;
 
 namespace RenderDemo.ViewModels
 {
-    public class MainWindowViewModel : ReactiveObject
+    public class MainWindowViewModel : ViewModelBase
     {
         private bool drawDirtyRects = false;
         private bool drawFps = true;
@@ -14,9 +13,9 @@ namespace RenderDemo.ViewModels
 
         public MainWindowViewModel()
         {
-            ToggleDrawDirtyRects = ReactiveCommand.Create(() => DrawDirtyRects = !DrawDirtyRects);
-            ToggleDrawFps = ReactiveCommand.Create(() => DrawFps = !DrawFps);
-            ResizeWindow = ReactiveCommand.CreateFromTask(ResizeWindowAsync);
+            ToggleDrawDirtyRects = MiniCommand.Create(() => DrawDirtyRects = !DrawDirtyRects);
+            ToggleDrawFps = MiniCommand.Create(() => DrawFps = !DrawFps);
+            ResizeWindow = MiniCommand.CreateFromTask(ResizeWindowAsync);
         }
 
         public bool DrawDirtyRects
@@ -43,9 +42,9 @@ namespace RenderDemo.ViewModels
             set => this.RaiseAndSetIfChanged(ref height, value);
         }
 
-        public ReactiveCommand<Unit, bool> ToggleDrawDirtyRects { get; }
-        public ReactiveCommand<Unit, bool> ToggleDrawFps { get; }
-        public ReactiveCommand<Unit, Unit> ResizeWindow { get; }
+        public MiniCommand ToggleDrawDirtyRects { get; }
+        public MiniCommand ToggleDrawFps { get; }
+        public MiniCommand ResizeWindow { get; }
 
         private async Task ResizeWindowAsync()
         {

+ 0 - 2
samples/Sandbox/Program.cs

@@ -1,5 +1,4 @@
 using Avalonia;
-using Avalonia.ReactiveUI;
 
 namespace Sandbox
 {
@@ -9,7 +8,6 @@ namespace Sandbox
         {
             AppBuilder.Configure<App>()
                 .UsePlatformDetect()
-                .UseReactiveUI()
                 .LogToTrace()
                 .StartWithClassicDesktopLifetime(args);
         }

+ 0 - 1
samples/Sandbox/Sandbox.csproj

@@ -8,7 +8,6 @@
 
   <ItemGroup>
     <ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
-    <ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj" />
     <ProjectReference Include="..\..\src\Avalonia.Controls.DataGrid\Avalonia.Controls.DataGrid.csproj" />
   </ItemGroup>
   

+ 0 - 2
samples/VirtualizationDemo/Program.cs

@@ -1,5 +1,4 @@
 using Avalonia;
-using Avalonia.ReactiveUI;
 
 namespace VirtualizationDemo
 {
@@ -8,7 +7,6 @@ namespace VirtualizationDemo
         public static AppBuilder BuildAvaloniaApp()
             => AppBuilder.Configure<App>()
                 .UsePlatformDetect()
-                .UseReactiveUI()
                 .LogToTrace();
 
         public static int Main(string[] args)

+ 2 - 2
samples/VirtualizationDemo/ViewModels/ItemViewModel.cs

@@ -1,9 +1,9 @@
 using System;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace VirtualizationDemo.ViewModels
 {
-    internal class ItemViewModel : ReactiveObject
+    internal class ItemViewModel : ViewModelBase
     {
         private string _prefix;
         private int _index;

+ 12 - 12
samples/VirtualizationDemo/ViewModels/MainWindowViewModel.cs

@@ -5,13 +5,13 @@ using System.Reactive;
 using Avalonia.Collections;
 using Avalonia.Controls;
 using Avalonia.Controls.Primitives;
-using ReactiveUI;
 using Avalonia.Layout;
 using Avalonia.Controls.Selection;
+using MiniMvvm;
 
 namespace VirtualizationDemo.ViewModels
 {
-    internal class MainWindowViewModel : ReactiveObject
+    internal class MainWindowViewModel : ViewModelBase
     {
         private int _itemCount = 200;
         private string _newItemString = "New Item";
@@ -26,15 +26,15 @@ namespace VirtualizationDemo.ViewModels
         public MainWindowViewModel()
         {
             this.WhenAnyValue(x => x.ItemCount).Subscribe(ResizeItems);
-            RecreateCommand = ReactiveCommand.Create(() => Recreate());
+            RecreateCommand = MiniCommand.Create(() => Recreate());
 
-            AddItemCommand = ReactiveCommand.Create(() => AddItem());
+            AddItemCommand = MiniCommand.Create(() => AddItem());
 
-            RemoveItemCommand = ReactiveCommand.Create(() => Remove());
+            RemoveItemCommand = MiniCommand.Create(() => Remove());
 
-            SelectFirstCommand = ReactiveCommand.Create(() => SelectItem(0));
+            SelectFirstCommand = MiniCommand.Create(() => SelectItem(0));
 
-            SelectLastCommand = ReactiveCommand.Create(() => SelectItem(Items.Count - 1));
+            SelectLastCommand = MiniCommand.Create(() => SelectItem(Items.Count - 1));
         }
 
         public string NewItemString
@@ -90,11 +90,11 @@ namespace VirtualizationDemo.ViewModels
         public IEnumerable<ItemVirtualizationMode> VirtualizationModes => 
             Enum.GetValues(typeof(ItemVirtualizationMode)).Cast<ItemVirtualizationMode>();
 
-        public ReactiveCommand<Unit, Unit> AddItemCommand { get; private set; }
-        public ReactiveCommand<Unit, Unit> RecreateCommand { get; private set; }
-        public ReactiveCommand<Unit, Unit> RemoveItemCommand { get; private set; }
-        public ReactiveCommand<Unit, Unit> SelectFirstCommand { get; private set; }
-        public ReactiveCommand<Unit, Unit> SelectLastCommand { get; private set; }
+        public MiniCommand AddItemCommand { get; private set; }
+        public MiniCommand RecreateCommand { get; private set; }
+        public MiniCommand RemoveItemCommand { get; private set; }
+        public MiniCommand SelectFirstCommand { get; private set; }
+        public MiniCommand SelectLastCommand { get; private set; }
 
         public void RandomizeSize()
         {

+ 1 - 2
samples/VirtualizationDemo/VirtualizationDemo.csproj

@@ -6,12 +6,11 @@
   <ItemGroup>
     <ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
     <ProjectReference Include="..\..\src\Linux\Avalonia.LinuxFramebuffer\Avalonia.LinuxFramebuffer.csproj" />
-    <ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj" />
+    <ProjectReference Include="..\MiniMvvm\MiniMvvm.csproj" />
   </ItemGroup>
   <Import Project="..\..\build\SampleApp.props" />
   <Import Project="..\..\build\EmbedXaml.props" />
   <Import Project="..\..\build\Rx.props" />
-  <Import Project="..\..\build\ReactiveUI.props" />
   <Import Condition="'$(TargetFramework)'=='net461'" Project="..\..\build\NetFX.props" />
   <Import Project="..\..\build\ReferenceCoreLibraries.props" />
   <Import Project="..\..\build\BuildTargets.targets" />

+ 1 - 1
samples/interop/Direct3DInteropSample/Direct3DInteropSample.csproj

@@ -22,9 +22,9 @@
       </EmbeddedResource>
     </ItemGroup>
     <ItemGroup>
-        <ProjectReference Include="..\..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj" />
         <ProjectReference Include="..\..\..\src\Windows\Avalonia.Direct2D1\Avalonia.Direct2D1.csproj" />
         <ProjectReference Include="..\..\..\src\Windows\Avalonia.Win32\Avalonia.Win32.csproj" />
+        <ProjectReference Include="..\..\MiniMvvm\MiniMvvm.csproj" />
     </ItemGroup>
     <Import Project="..\..\..\build\Rx.props" />
     <Import Project="..\..\..\build\ReferenceCoreLibraries.props" />

+ 2 - 2
samples/interop/Direct3DInteropSample/MainWindowViewModel.cs

@@ -3,11 +3,11 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using ReactiveUI;
+using MiniMvvm;
 
 namespace Direct3DInteropSample
 {
-    public class MainWindowViewModel : ReactiveObject
+    public class MainWindowViewModel : ViewModelBase
     {
         private double _rotationX;
 

+ 1 - 5
samples/interop/WindowsInteropTest/WindowsInteropTest.csproj

@@ -136,10 +136,6 @@
       <Project>{42472427-4774-4c81-8aff-9f27b8e31721}</Project>
       <Name>Avalonia.Layout</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj">
-      <Project>{6417b24e-49c2-4985-8db2-3ab9d898ec91}</Project>
-      <Name>Avalonia.ReactiveUI</Name>
-    </ProjectReference>
     <ProjectReference Include="..\..\..\src\Avalonia.Visuals\Avalonia.Visuals.csproj">
       <Project>{eb582467-6abb-43a1-b052-e981ba910e3a}</Project>
       <Name>Avalonia.Visuals</Name>
@@ -190,4 +186,4 @@
   <Import Project="..\..\..\build\Rx.props" />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="..\..\..\build\LegacyProject.targets" />
-</Project>
+</Project>

+ 0 - 4
src/Android/Avalonia.AndroidTestApplication/Avalonia.AndroidTestApplication.csproj

@@ -127,10 +127,6 @@
       <Project>{42472427-4774-4c81-8aff-9f27b8e31721}</Project>
       <Name>Avalonia.Layout</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj">
-      <Project>{6417b24e-49c2-4985-8db2-3ab9d898ec91}</Project>
-      <Name>Avalonia.ReactiveUI</Name>
-    </ProjectReference>
     <ProjectReference Include="..\..\Avalonia.Visuals\Avalonia.Visuals.csproj">
       <Project>{eb582467-6abb-43a1-b052-e981ba910e3a}</Project>
       <Name>Avalonia.Visuals</Name>