Browse Source

Merge branch 'master' into feature/window-showactive

pull/5063/head
Dan Walmsley 5 years ago
committed by GitHub
parent
commit
10720ddd34
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      Avalonia.sln
  2. 3
      build/EmbedXaml.props
  3. 2
      build/SharedVersion.props
  4. 2
      samples/BindingDemo/App.xaml.cs
  5. 3
      samples/BindingDemo/BindingDemo.csproj
  6. 4
      samples/BindingDemo/ViewModels/ExceptionErrorViewModel.cs
  7. 4
      samples/BindingDemo/ViewModels/IndeiErrorViewModel.cs
  8. 12
      samples/BindingDemo/ViewModels/MainWindowViewModel.cs
  9. 8
      samples/BindingDemo/ViewModels/NestedCommandViewModel.cs
  10. 4
      samples/BindingDemo/ViewModels/TestItem.cs
  11. 4
      samples/ControlCatalog.Desktop/Program.cs
  12. 2
      samples/ControlCatalog.NetCore/Program.cs
  13. 4
      samples/ControlCatalog/App.xaml.cs
  14. 2
      samples/ControlCatalog/ControlCatalog.csproj
  15. 2
      samples/ControlCatalog/MainWindow.xaml.cs
  16. 1
      samples/ControlCatalog/Pages/LabelsPage.axaml.cs
  17. 2
      samples/ControlCatalog/Pages/ListBoxPage.xaml
  18. 1
      samples/ControlCatalog/Pages/MenuPage.xaml.cs
  19. 4
      samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs
  20. 4
      samples/ControlCatalog/Pages/ScrollViewerPage.xaml.cs
  21. 4
      samples/ControlCatalog/Pages/TabControlPage.xaml.cs
  22. 14
      samples/ControlCatalog/ViewModels/ContextMenuPageViewModel.cs
  23. 6
      samples/ControlCatalog/ViewModels/ItemsRepeaterPageViewModel.cs
  24. 27
      samples/ControlCatalog/ViewModels/ListBoxPageViewModel.cs
  25. 28
      samples/ControlCatalog/ViewModels/MainWindowViewModel.cs
  26. 14
      samples/ControlCatalog/ViewModels/MenuPageViewModel.cs
  27. 10
      samples/ControlCatalog/ViewModels/NotificationViewModel.cs
  28. 4
      samples/ControlCatalog/ViewModels/SplitViewPageViewModel.cs
  29. 16
      samples/ControlCatalog/ViewModels/TreeViewPageViewModel.cs
  30. 66
      samples/MiniMvvm/MiniCommand.cs
  31. 6
      samples/MiniMvvm/MiniMvvm.csproj
  32. 108
      samples/MiniMvvm/PropertyChangedExtensions.cs
  33. 26
      samples/MiniMvvm/ViewModelBase.cs
  34. 1
      samples/Previewer/Previewer.csproj
  35. 2
      samples/RenderDemo/App.xaml
  36. 2
      samples/RenderDemo/App.xaml.cs
  37. 2
      samples/RenderDemo/MainWindow.xaml.cs
  38. 3
      samples/RenderDemo/RenderDemo.csproj
  39. 4
      samples/RenderDemo/ViewModels/AnimationsPageViewModel.cs
  40. 17
      samples/RenderDemo/ViewModels/MainWindowViewModel.cs
  41. 2
      samples/Sandbox/App.axaml
  42. 2
      samples/Sandbox/Program.cs
  43. 1
      samples/Sandbox/Sandbox.csproj
  44. 2
      samples/VirtualizationDemo/Program.cs
  45. 4
      samples/VirtualizationDemo/ViewModels/ItemViewModel.cs
  46. 24
      samples/VirtualizationDemo/ViewModels/MainWindowViewModel.cs
  47. 3
      samples/VirtualizationDemo/VirtualizationDemo.csproj
  48. 2
      samples/interop/Direct3DInteropSample/Direct3DInteropSample.csproj
  49. 4
      samples/interop/Direct3DInteropSample/MainWindowViewModel.cs
  50. 6
      samples/interop/WindowsInteropTest/WindowsInteropTest.csproj
  51. 4
      src/Android/Avalonia.AndroidTestApplication/Avalonia.AndroidTestApplication.csproj
  52. 18
      src/Avalonia.Base/Collections/AvaloniaList.cs
  53. 60
      src/Avalonia.Controls/DefinitionList.cs
  54. 4
      src/Avalonia.Controls/Generators/ItemContainerInfo.cs
  55. 6
      src/Avalonia.Layout/LayoutContext.cs
  56. 31
      src/Avalonia.Native/DoubleClickHelper.cs
  57. 22
      src/Avalonia.Native/WindowImpl.cs
  58. 4
      src/Avalonia.Themes.Fluent/ApiCompatBaseline.txt
  59. 0
      src/Avalonia.Themes.Fluent/Controls/AutoCompleteBox.xaml
  60. 0
      src/Avalonia.Themes.Fluent/Controls/Button.xaml
  61. 0
      src/Avalonia.Themes.Fluent/Controls/ButtonSpinner.xaml
  62. 0
      src/Avalonia.Themes.Fluent/Controls/Calendar.xaml
  63. 0
      src/Avalonia.Themes.Fluent/Controls/CalendarButton.xaml
  64. 0
      src/Avalonia.Themes.Fluent/Controls/CalendarDatePicker.xaml
  65. 0
      src/Avalonia.Themes.Fluent/Controls/CalendarDayButton.xaml
  66. 0
      src/Avalonia.Themes.Fluent/Controls/CalendarItem.xaml
  67. 0
      src/Avalonia.Themes.Fluent/Controls/CaptionButtons.xaml
  68. 0
      src/Avalonia.Themes.Fluent/Controls/Carousel.xaml
  69. 0
      src/Avalonia.Themes.Fluent/Controls/CheckBox.xaml
  70. 0
      src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml
  71. 0
      src/Avalonia.Themes.Fluent/Controls/ComboBoxItem.xaml
  72. 0
      src/Avalonia.Themes.Fluent/Controls/Common.xaml
  73. 0
      src/Avalonia.Themes.Fluent/Controls/ContentControl.xaml
  74. 0
      src/Avalonia.Themes.Fluent/Controls/ContextMenu.xaml
  75. 0
      src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml
  76. 0
      src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml
  77. 0
      src/Avalonia.Themes.Fluent/Controls/EmbeddableControlRoot.xaml
  78. 0
      src/Avalonia.Themes.Fluent/Controls/Expander.xaml
  79. 62
      src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml
  80. 4
      src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml.cs
  81. 0
      src/Avalonia.Themes.Fluent/Controls/FocusAdorner.xaml
  82. 0
      src/Avalonia.Themes.Fluent/Controls/GridSplitter.xaml
  83. 0
      src/Avalonia.Themes.Fluent/Controls/ItemsControl.xaml
  84. 0
      src/Avalonia.Themes.Fluent/Controls/Label.xaml
  85. 0
      src/Avalonia.Themes.Fluent/Controls/ListBox.xaml
  86. 0
      src/Avalonia.Themes.Fluent/Controls/ListBoxItem.xaml
  87. 0
      src/Avalonia.Themes.Fluent/Controls/Menu.xaml
  88. 0
      src/Avalonia.Themes.Fluent/Controls/MenuItem.xaml
  89. 0
      src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml
  90. 0
      src/Avalonia.Themes.Fluent/Controls/NotificationCard.xaml
  91. 0
      src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml
  92. 0
      src/Avalonia.Themes.Fluent/Controls/OverlayPopupHost.xaml
  93. 0
      src/Avalonia.Themes.Fluent/Controls/PathIcon.xaml
  94. 0
      src/Avalonia.Themes.Fluent/Controls/PopupRoot.xaml
  95. 0
      src/Avalonia.Themes.Fluent/Controls/ProgressBar.xaml
  96. 0
      src/Avalonia.Themes.Fluent/Controls/RadioButton.xaml
  97. 0
      src/Avalonia.Themes.Fluent/Controls/RepeatButton.xaml
  98. 0
      src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml
  99. 0
      src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml
  100. 0
      src/Avalonia.Themes.Fluent/Controls/Separator.xaml

27
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}

3
build/EmbedXaml.props

@ -4,8 +4,9 @@
<Compile Update="**\*.xaml.cs">
<DependentUpon>%(Filename)</DependentUpon>
</Compile>
<None Remove="**\*.xaml"/>
<AvaloniaResource Include="**\*.xaml">
<SubType>Designer</SubType>
</AvaloniaResource>
</ItemGroup>
</Project>
</Project>

2
build/SharedVersion.props

@ -16,7 +16,7 @@
<PackageReleaseNotes>https://github.com/AvaloniaUI/Avalonia/releases</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\avalonia.snk</AssemblyOriginatorKeyFile>
<SignAssembly>false</SignAssembly>
<SignAssembly>true</SignAssembly>
<DefineConstants Condition="$(SignAssembly) == true">$(DefineConstants);SIGNED_BUILD</DefineConstants>
</PropertyGroup>

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();
}
}

3
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" />

4
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;

4
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;

12
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();

8
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; }

4
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;

4
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)
{

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();

4
samples/ControlCatalog/App.xaml.cs

@ -23,7 +23,7 @@ namespace ControlCatalog
{
new StyleInclude(new Uri("avares://ControlCatalog/Styles"))
{
Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/FluentDark.xaml")
Source = new Uri("avares://Avalonia.Themes.Fluent/FluentDark.xaml")
},
DataGridFluent
};
@ -32,7 +32,7 @@ namespace ControlCatalog
{
new StyleInclude(new Uri("avares://ControlCatalog/Styles"))
{
Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/FluentLight.xaml")
Source = new Uri("avares://Avalonia.Themes.Fluent/FluentLight.xaml")
},
DataGridFluent
};

2
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" />

2
samples/ControlCatalog/MainWindow.xaml.cs

@ -67,7 +67,7 @@ namespace ControlCatalog
if (Application.Current.Styles.Contains(App.FluentDark)
|| Application.Current.Styles.Contains(App.FluentLight))
{
var theme = new Avalonia.Themes.Fluent.FluentTheme();
var theme = new Avalonia.Themes.Fluent.Controls.FluentControls();
theme.TryGetResource("Button", out _);
}
else

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
{

2
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>

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
{

4
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;

4
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;

4
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;

14
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()
{

6
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;

27
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()}";
}

28
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; }
}
}

14
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()
{

10
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; }
}
}

4
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

16
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
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
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
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
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));
}
}

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" />

2
samples/RenderDemo/App.xaml

@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="RenderDemo.App">
<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Accents/FluentLight.xaml"/>
<FluentTheme/>
<StyleInclude Source="avares://RenderDemo/SideBar.xaml"/>
</Application.Styles>
</Application>

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();
}
}

2
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
{

3
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" />

4
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;

17
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()
{

2
samples/Sandbox/App.axaml

@ -3,6 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Sandbox.App">
<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Accents/FluentDark.xaml"/>
<FluentTheme Mode="Dark"/>
</Application.Styles>
</Application>

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);
}

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>

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)

4
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;

24
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()
{

3
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" />

2
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" />

4
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;

6
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>

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>

18
src/Avalonia.Base/Collections/AvaloniaList.cs

@ -63,6 +63,15 @@ namespace Avalonia.Collections
_inner = new List<T>();
}
/// <summary>
/// Initializes a new instance of the <see cref="AvaloniaList{T}"/>.
/// </summary>
/// <param name="capacity">Initial list capacity.</param>
public AvaloniaList(int capacity)
{
_inner = new List<T>(capacity);
}
/// <summary>
/// Initializes a new instance of the <see cref="AvaloniaList{T}"/> class.
/// </summary>
@ -175,6 +184,15 @@ namespace Avalonia.Collections
set { this[index] = (T)value; }
}
/// <summary>
/// Gets or sets the total number of elements the internal data structure can hold without resizing.
/// </summary>
public int Capacity
{
get => _inner.Capacity;
set => _inner.Capacity = value;
}
/// <summary>
/// Adds an item to the collection.
/// </summary>

60
src/Avalonia.Controls/DefinitionList.cs

@ -1,8 +1,9 @@
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using Avalonia.Collections;
#nullable enable
namespace Avalonia.Controls
{
public abstract class DefinitionList<T> : AvaloniaList<T> where T : DefinitionBase
@ -14,44 +15,65 @@ namespace Avalonia.Controls
}
internal bool IsDirty = true;
private Grid _parent;
private Grid? _parent;
internal Grid Parent
internal Grid? Parent
{
get => _parent;
set => SetParent(value);
}
private void SetParent(Grid value)
private void SetParent(Grid? value)
{
_parent = value;
foreach (var pair in this.Select((definitions, index) => (definitions, index)))
var idx = 0;
foreach (T definition in this)
{
pair.definitions.Parent = value;
pair.definitions.Index = pair.index;
definition.Parent = value;
definition.Index = idx++;
}
}
internal void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
foreach (var nI in this.Select((d, i) => (d, i)))
nI.d._parentIndex = nI.i;
var idx = 0;
foreach (var nD in e.NewItems?.Cast<DefinitionBase>()
?? Enumerable.Empty<DefinitionBase>())
foreach (T definition in this)
{
nD.Parent = this.Parent;
nD.OnEnterParentTree();
definition.Index = idx++;
}
UpdateDefinitionParent(e.NewItems, false);
UpdateDefinitionParent(e.OldItems, true);
IsDirty = true;
}
foreach (var oD in e.OldItems?.Cast<DefinitionBase>()
?? Enumerable.Empty<DefinitionBase>())
private void UpdateDefinitionParent(IList? items, bool wasRemoved)
{
if (items is null)
{
oD.OnExitParentTree();
return;
}
var count = items.Count;
IsDirty = true;
for (var i = 0; i < count; i++)
{
var definition = (DefinitionBase) items[i];
if (wasRemoved)
{
definition.OnExitParentTree();
}
else
{
definition.Parent = Parent;
definition.OnEnterParentTree();
}
}
}
}
}
}

4
src/Avalonia.Controls/Generators/ItemContainerInfo.cs

@ -37,6 +37,6 @@ namespace Avalonia.Controls.Generators
/// <summary>
/// Gets the index of the item in the <see cref="ItemsControl.Items"/> collection.
/// </summary>
public int Index { get; internal set; }
public int Index { get; set; }
}
}
}

6
src/Avalonia.Layout/LayoutContext.cs

@ -14,7 +14,11 @@ namespace Avalonia.Layout
/// <summary>
/// Gets or sets an object that represents the state of a layout.
/// </summary>
public object LayoutState { get; set; }
public object LayoutState
{
get => LayoutStateCore;
set => LayoutStateCore = value;
}
/// <summary>
/// Implements the behavior of <see cref="LayoutState"/> in a derived or custom LayoutContext.

31
src/Avalonia.Native/DoubleClickHelper.cs

@ -0,0 +1,31 @@
using Avalonia.Platform;
namespace Avalonia.Native
{
internal class DoubleClickHelper
{
private int _clickCount;
private Rect _lastClickRect;
private ulong _lastClickTime;
public bool IsDoubleClick(
ulong timestamp,
Point p)
{
var settings = AvaloniaLocator.Current.GetService<IPlatformSettings>();
var doubleClickTime = settings.DoubleClickTime.TotalMilliseconds;
if (!_lastClickRect.Contains(p) || timestamp - _lastClickTime > doubleClickTime)
{
_clickCount = 0;
}
++_clickCount;
_lastClickTime = timestamp;
_lastClickRect = new Rect(p, new Size())
.Inflate(new Thickness(settings.DoubleClickSize.Width / 2, settings.DoubleClickSize.Height / 2));
return _clickCount == 2;
}
}
}

22
src/Avalonia.Native/WindowImpl.cs

@ -1,4 +1,5 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Platform;
using Avalonia.Input;
@ -17,6 +18,8 @@ namespace Avalonia.Native
private readonly AvaloniaNativePlatformOpenGlInterface _glFeature;
IAvnWindow _native;
private double _extendTitleBarHeight = -1;
private DoubleClickHelper _doubleClickHelper;
internal WindowImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts,
AvaloniaNativePlatformOpenGlInterface glFeature) : base(opts, glFeature)
@ -24,6 +27,8 @@ namespace Avalonia.Native
_factory = factory;
_opts = opts;
_glFeature = glFeature;
_doubleClickHelper = new DoubleClickHelper();
using (var e = new WindowEvents(this))
{
var context = _opts.UseGpu ? glFeature?.MainContext : null;
@ -118,7 +123,22 @@ namespace Avalonia.Native
if(visual == null)
{
_native.BeginMoveDrag();
if (_doubleClickHelper.IsDoubleClick(e.Timestamp, e.Position))
{
// TOGGLE WINDOW STATE.
if (WindowState == WindowState.Maximized || WindowState == WindowState.FullScreen)
{
WindowState = WindowState.Normal;
}
else
{
WindowState = WindowState.Maximized;
}
}
else
{
_native.BeginMoveDrag();
}
}
}
}

4
src/Avalonia.Themes.Fluent/ApiCompatBaseline.txt

@ -0,0 +1,4 @@
Compat issues with assembly Avalonia.Themes.Fluent:
CannotRemoveBaseTypeOrInterface : Type 'Avalonia.Themes.Fluent.FluentTheme' does not inherit from base type 'Avalonia.Styling.Styles' in the implementation but it does in the contract.
MembersMustExist : Member 'public void Avalonia.Themes.Fluent.FluentTheme..ctor()' does not exist in the implementation but it does exist in the contract.
Total Issues: 2

0
src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml → src/Avalonia.Themes.Fluent/Controls/AutoCompleteBox.xaml

0
src/Avalonia.Themes.Fluent/Button.xaml → src/Avalonia.Themes.Fluent/Controls/Button.xaml

0
src/Avalonia.Themes.Fluent/ButtonSpinner.xaml → src/Avalonia.Themes.Fluent/Controls/ButtonSpinner.xaml

0
src/Avalonia.Themes.Fluent/Calendar.xaml → src/Avalonia.Themes.Fluent/Controls/Calendar.xaml

0
src/Avalonia.Themes.Fluent/CalendarButton.xaml → src/Avalonia.Themes.Fluent/Controls/CalendarButton.xaml

0
src/Avalonia.Themes.Fluent/CalendarDatePicker.xaml → src/Avalonia.Themes.Fluent/Controls/CalendarDatePicker.xaml

0
src/Avalonia.Themes.Fluent/CalendarDayButton.xaml → src/Avalonia.Themes.Fluent/Controls/CalendarDayButton.xaml

0
src/Avalonia.Themes.Fluent/CalendarItem.xaml → src/Avalonia.Themes.Fluent/Controls/CalendarItem.xaml

0
src/Avalonia.Themes.Fluent/CaptionButtons.xaml → src/Avalonia.Themes.Fluent/Controls/CaptionButtons.xaml

0
src/Avalonia.Themes.Fluent/Carousel.xaml → src/Avalonia.Themes.Fluent/Controls/Carousel.xaml

0
src/Avalonia.Themes.Fluent/CheckBox.xaml → src/Avalonia.Themes.Fluent/Controls/CheckBox.xaml

0
src/Avalonia.Themes.Fluent/ComboBox.xaml → src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml

0
src/Avalonia.Themes.Fluent/ComboBoxItem.xaml → src/Avalonia.Themes.Fluent/Controls/ComboBoxItem.xaml

0
src/Avalonia.Themes.Fluent/Common.xaml → src/Avalonia.Themes.Fluent/Controls/Common.xaml

0
src/Avalonia.Themes.Fluent/ContentControl.xaml → src/Avalonia.Themes.Fluent/Controls/ContentControl.xaml

0
src/Avalonia.Themes.Fluent/ContextMenu.xaml → src/Avalonia.Themes.Fluent/Controls/ContextMenu.xaml

0
src/Avalonia.Themes.Fluent/DataValidationErrors.xaml → src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml

0
src/Avalonia.Themes.Fluent/DatePicker.xaml → src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml

0
src/Avalonia.Themes.Fluent/EmbeddableControlRoot.xaml → src/Avalonia.Themes.Fluent/Controls/EmbeddableControlRoot.xaml

0
src/Avalonia.Themes.Fluent/Expander.xaml → src/Avalonia.Themes.Fluent/Controls/Expander.xaml

62
src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml

@ -0,0 +1,62 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Avalonia.Themes.Fluent.Controls.FluentControls">
<!-- Define ToolTip first so its styles can be overriden by other controls (e.g. TextBox) -->
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ToolTip.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/FocusAdorner.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Button.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CaptionButtons.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Carousel.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CheckBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ComboBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ComboBoxItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ContentControl.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Label.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/GridSplitter.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ItemsControl.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ListBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ListBoxItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Menu.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ContextMenu.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/MenuItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/OverlayPopupHost.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/PathIcon.xaml" />
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/PopupRoot.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ProgressBar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/RadioButton.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/RepeatButton.xaml" />
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Separator.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Slider.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ScrollBar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabStrip.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabStripItem.xaml"/>
<!-- TabControl needs to come after TabStrip as it redefines the inner TabStrip.ItemsPanel-->
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabControl.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TextBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ToggleButton.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Expander.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TitleBar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TreeView.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TreeViewItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/UserControl.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Window.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/EmbeddableControlRoot.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarButton.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarDayButton.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Calendar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarDatePicker.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ButtonSpinner.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/AutoCompleteBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/WindowNotificationManager.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/NotificationCard.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ToggleSwitch.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/SplitView.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/DatePicker.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TimePicker.xaml"/>
</Styles>

4
src/Avalonia.Themes.Fluent/FluentTheme.xaml.cs → src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml.cs

@ -1,12 +1,12 @@
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
namespace Avalonia.Themes.Fluent
namespace Avalonia.Themes.Fluent.Controls
{
/// <summary>
/// The default Avalonia theme.
/// </summary>
public class FluentTheme : Styles
public class FluentControls : Styles
{
}
}

0
src/Avalonia.Themes.Fluent/FocusAdorner.xaml → src/Avalonia.Themes.Fluent/Controls/FocusAdorner.xaml

0
src/Avalonia.Themes.Fluent/GridSplitter.xaml → src/Avalonia.Themes.Fluent/Controls/GridSplitter.xaml

0
src/Avalonia.Themes.Fluent/ItemsControl.xaml → src/Avalonia.Themes.Fluent/Controls/ItemsControl.xaml

0
src/Avalonia.Themes.Fluent/Label.xaml → src/Avalonia.Themes.Fluent/Controls/Label.xaml

0
src/Avalonia.Themes.Fluent/ListBox.xaml → src/Avalonia.Themes.Fluent/Controls/ListBox.xaml

0
src/Avalonia.Themes.Fluent/ListBoxItem.xaml → src/Avalonia.Themes.Fluent/Controls/ListBoxItem.xaml

0
src/Avalonia.Themes.Fluent/Menu.xaml → src/Avalonia.Themes.Fluent/Controls/Menu.xaml

0
src/Avalonia.Themes.Fluent/MenuItem.xaml → src/Avalonia.Themes.Fluent/Controls/MenuItem.xaml

0
src/Avalonia.Themes.Fluent/NativeMenuBar.xaml → src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml

0
src/Avalonia.Themes.Fluent/NotificationCard.xaml → src/Avalonia.Themes.Fluent/Controls/NotificationCard.xaml

0
src/Avalonia.Themes.Fluent/NumericUpDown.xaml → src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml

0
src/Avalonia.Themes.Fluent/OverlayPopupHost.xaml → src/Avalonia.Themes.Fluent/Controls/OverlayPopupHost.xaml

0
src/Avalonia.Themes.Fluent/PathIcon.xaml → src/Avalonia.Themes.Fluent/Controls/PathIcon.xaml

0
src/Avalonia.Themes.Fluent/PopupRoot.xaml → src/Avalonia.Themes.Fluent/Controls/PopupRoot.xaml

0
src/Avalonia.Themes.Fluent/ProgressBar.xaml → src/Avalonia.Themes.Fluent/Controls/ProgressBar.xaml

0
src/Avalonia.Themes.Fluent/RadioButton.xaml → src/Avalonia.Themes.Fluent/Controls/RadioButton.xaml

0
src/Avalonia.Themes.Fluent/RepeatButton.xaml → src/Avalonia.Themes.Fluent/Controls/RepeatButton.xaml

0
src/Avalonia.Themes.Fluent/ScrollBar.xaml → src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml

0
src/Avalonia.Themes.Fluent/ScrollViewer.xaml → src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml

0
src/Avalonia.Themes.Fluent/Separator.xaml → src/Avalonia.Themes.Fluent/Controls/Separator.xaml

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save