diff --git a/Documentation/build.md b/Documentation/build.md index 5f75290424..a7d68eb599 100644 --- a/Documentation/build.md +++ b/Documentation/build.md @@ -9,10 +9,24 @@ git clone https://github.com/AvaloniaUI/Avalonia.git git submodule update --init ``` +### Install the required version of the .NET Core SDK + +Go to https://dotnet.microsoft.com/download/visual-studio-sdks and install the latest version of the .NET Core SDK compatible with Avalonia UI. Make sure to download the SDK (not just the "runtime") package. The version compatible is indicated within the [global.json](https://github.com/AvaloniaUI/Avalonia/blob/master/global.json) file. Note that Avalonia UI does not always use the latest version and is hardcoded to use the last version known to be compatible (SDK releases may break the builds from time-to-time). + ### Open in Visual Studio -Open the `Avalonia.sln` solution in Visual Studio 2019 or newer. The free Visual Studio Community -edition works fine. Run the `Samples\ControlCatalog.Desktop` project to see the sample application. +Open the `Avalonia.sln` solution in Visual Studio 2019 or newer. The free Visual Studio Community edition works fine. Build and run the `Samples\ControlCatalog.Desktop` or `ControlCatalog.NetCore` project to see the sample application. + +### Troubleshooting + + * **Error CS0006: Avalonia.DesktopRuntime.dll could not be found** + + It is common for the first build to fail with the errors below (also discussed in [#4257](https://github.com/AvaloniaUI/Avalonia/issues/4257)). + ``` + >CSC : error CS0006: Metadata file 'C:\...\Avalonia\src\Avalonia.DesktopRuntime\bin\Debug\netcoreapp2.0\Avalonia.DesktopRuntime.dll' could not be found + >CSC : error CS0006: Metadata file 'C:\...\Avalonia\packages\Avalonia\bin\Debug\netcoreapp2.0\Avalonia.dll' could not be found + ``` + To correct this, right click on the `Avalonia.DesktopRuntime` project then press `Build` to build the project manually. Afterwards the solution should build normally and the ControlCatalog can be run. # Linux/macOS @@ -20,9 +34,9 @@ It's *not* possible to build the *whole* project on Linux/macOS. You can only bu MonoDevelop, Xamarin Studio and Visual Studio for Mac aren't capable of properly opening our solution. You can use Rider (at least 2017.2 EAP) or VSCode instead. They will fail to load most of platform specific projects, but you don't need them to run on .NET Core. -### Install the latest version of .NET Core +### Install the latest version of the .NET Core SDK -Go to https://www.microsoft.com/net/core and follow instructions for your OS. You need SDK (not just "runtime") package. +Go to https://www.microsoft.com/net/core and follow the instructions for your OS. Make sure to download the SDK (not just the "runtime") package. ### Additional requirements for macOS diff --git a/src/Avalonia.Animation/Animation.cs b/src/Avalonia.Animation/Animation.cs index 05142532e9..c42153ec4f 100644 --- a/src/Avalonia.Animation/Animation.cs +++ b/src/Avalonia.Animation/Animation.cs @@ -209,6 +209,17 @@ namespace Avalonia.Animation ( prop => typeof(decimal).IsAssignableFrom(prop.PropertyType), typeof(DecimalAnimator) ), }; + /// + /// Registers a that can handle + /// a value type that matches the specified condition. + /// + /// + /// The condition to which the + /// is to be activated and used. + /// + /// + /// The type of the animator to instantiate. + /// public static void RegisterAnimator(Func condition) where TAnimator : IAnimator { diff --git a/src/Avalonia.Animation/Animators/Animator`1.cs b/src/Avalonia.Animation/Animators/Animator`1.cs index 0660440e30..d784227620 100644 --- a/src/Avalonia.Animation/Animators/Animator`1.cs +++ b/src/Avalonia.Animation/Animators/Animator`1.cs @@ -104,6 +104,11 @@ namespace Avalonia.Animation.Animators throw new Exception("Index time is out of keyframe time range."); } + public virtual IDisposable BindAnimation(Animatable control, IObservable instance) + { + return control.Bind((AvaloniaProperty)Property, instance, BindingPriority.Animation); + } + /// /// Runs the KeyFrames Animation. /// @@ -116,7 +121,8 @@ namespace Avalonia.Animation.Animators clock ?? control.Clock ?? Clock.GlobalClock, onComplete, InterpolationHandler); - return control.Bind((AvaloniaProperty)Property, instance, BindingPriority.Animation); + + return BindAnimation(control, instance); } /// diff --git a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml index 998198cc1c..0c4f8249ce 100644 --- a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml +++ b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml @@ -163,6 +163,10 @@ + - - + x:Class="Avalonia.Diagnostics.Views.EventsPageView" + Margin="2"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +