Breaking Changes

Wiesław Šoltés edited this page Oct 30, 2018 · 24 revisions

0.6 -> 0.7

Reactive UI

  • Projects that use ReactiveUI framework will need to migrate to Reactive UI 9.0.1 which Avalonia now uses.

TemplateBinding

  • Existing TemplateBindings which specify Path= will stop working, as the Path property was removed and replaced with Property. Simply remove the Path= qualifier or change it to Property= if the path was a simple property
  • Existing TemplateBindings which don't bind to a simple property on the templated parent will need to be changed to regular Bindings with RelativeSourceMode.TemplatedParent

See https://github.com/AvaloniaUI/Avalonia/pull/1695

StackPanel

  • The Gap property has been renamed to Spacing to be consistent with UWP and other XAML frameworks.

See https://github.com/AvaloniaUI/Avalonia/pull/1786

SelectingItemsControl

  • BugFix: For the replace operation in the SelectedItems collection, AddedItems and RemovedItems members of the SelectionChangedEventArgs class had their contents switched.

See https://github.com/AvaloniaUI/Avalonia/pull/1913

Window.OpenWindows

Was moved to Application.Windows: https://github.com/AvaloniaUI/Avalonia/pull/1662

Avalonia.Base

  • The DataValidatiorBase base class has been renamed to DataValidationBase.

See https://github.com/AvaloniaUI/Avalonia/pull/1858

Avalonia.Android

  • The AndroidKeyboardEventsHelper<TView>.ActivateAutoShowKeybord method has been renamed to AndroidKeyboardEventsHelper<TView>.ActivateAutoShowKeyboard.

See https://github.com/AvaloniaUI/Avalonia/pull/1859

Avalonia.iOS

  • The KeyboardEventsHelper<TView>.ActivateAutoShowKeybord method has been renamed to KeyboardEventsHelper<TView>.ActivateAutoShowKeyboard.

See https://github.com/AvaloniaUI/Avalonia/pull/1859

Avalonia.Gtk3

  • The UseGtk3 method parameters changed to Gtk3PlatformOptions.

See https://github.com/AvaloniaUI/Avalonia/pull/1935

Avalonia.MonoMac

We have removed Avalonia.MonoMac, please use Avalonia.Native instead.

https://github.com/AvaloniaUI/Avalonia/pull/1992/files

Avalonia.DotNetCoreRuntime

We have removed Avalonia.DotNetCoreRuntime, please use Avalonia.DesktopRuntime instead.

Themes

  • Renamed theme resource from ThemeBorderLightColor to ThemeBorderLowColor.
  • Renamed theme resource from ThemeControlLightColor to ThemeControlLowColor.
  • Renamed theme resource from ThemeForegroundLightColor to ThemeForegroundLowColor.
  • Renamed theme resource from ErrorLightColor to ErrorLowColor.
  • Renamed theme resource from ThemeBorderLightBrush to ThemeBorderLowBrush.
  • Renamed theme resource from ThemeControlLightBrush to ThemeControlLowBrush.
  • Renamed theme resource from ThemeForegroundLightBrush to ThemeForegroundLowBrush.
  • Renamed theme resource from ErrorLightBrush to ErrorLowBrush.
  • Renamed theme resource from ThemeBorderDarkColor to ThemeBorderHighColor.
  • Renamed theme resource from ThemeControlDarkColor to ThemeControlHighColor.
  • Renamed theme resource from ThemeControlHighlightDarkColor to ThemeControlHighlightHighColor.
  • Renamed theme resource from ThemeBorderDarkBrush to ThemeBorderHighBrush.
  • Renamed theme resource from ThemeControlDarkBrush to ThemeControlHighBrush.
  • Renamed theme resource from ThemeControlHighlightDarkBrush to ThemeControlHighlightHighBrush.

See https://github.com/AvaloniaUI/Avalonia/pull/2023

IBitmap

Changed both PixelHeight and PixelWidth into a PixelSize struct.

WriteableBitmap

The constructor now requires the size to be provided using PixelSize and also a DPI. Use 96 as a default.

See https://github.com/AvaloniaUI/Avalonia/pull/1889

0.5.1 -> 0.6

BuildAvaloniaApp and previewer.

You now need BuildAvaloniaApp static method in the class with your entry point (typically in Program.cs or App.xaml.cs) which should be called from Main:

        static void Main(string[] args)
        {
            BuildAvaloniaApp().Start<MainWindow>();
        }

        public static AppBuilder BuildAvaloniaApp()
            => AppBuilder.Configure<App>()
                .UsePlatformDetect()
.LogToDebug();

Previewer won't be able to work without it.

DataContextChanging and DataContextChanged

They were replaced by OnDataContextBeginUpdate and OnDataContextEndUpdate

Static and Type markup extensions

They were replaced by standard x:Static and x:Type, add xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" to the root of your XAML file.

StyleResource

StyleResource has been replaced by StaticResource and DynamicResource as in other XAML frameworks. StaticResource and DynamicResource in Avalonia search both Control.Resources and Style.Resources.

Mouse device

MouseDevice is no longer available from the global context, you need to obtain one from TopLevel (Window, Popup, etc). Call GetVisualRoot() in your control and cast it to IInputRoot.

var pos = (_control.GetVisualRoot() as IInputRoot)?.MouseDevice?.Position ?? default(Point);
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.