Converting to v26.1
Avalonia v12.0.0 Updates
The following breaking changes were necessary to support and/or align with changes in Avalonia v12.0.0:
- Renamed ThemeResourceKind.
EditWatermarkOpacitytoEditPlaceholderOpacity. - Renamed ThemeResourceKind.
EditWatermarkOpacityFocusedtoEditPlaceholderOpacityFocused. - Removed ControlThemeKind.
CaptionButtonsand correspondingControlThemesince the nativeCaptionButtonscontrol was removed. - Removed ControlThemeKind.
TitleBarand correspondingControlThemesince the nativeTitleBarcontrol was removed. - Any overrides for
OnGotFocuschanged event arguments fromGotFocusEventArgstoFocusChangedEventArgs. - Any overrides for
OnLostFocuschanged event arguments fromRoutedEventArgstoFocusChangedEventArgs.
Menu Factory Updates
Several minor updates were made to Menu Factory concepts in order to align functionality and capabilities with other Actipro platforms. Most of these changes only affect those who have implemented their own IMenuFactory implementations, but the default MenuItem.Name of some menu items have also changed. If any default menus are being customized and the MenuItem.Name was used to find existing menu items without using one of the available constants, verify that the correct menu name is still in use.
The following potentially breaking changes were made:
Shared Library
- The IMenuFactory.
CreateMenuFlyoutmethod has been renamed as CreateMenu. - The
MenuFactoryCreateMenuFlyoutOptionsclass has been renamed to MenuFactoryMenuOptions. - The
MenuFactoryCreateMenuItemOptionsclass has been renamed to MenuFactoryMenuItemOptions.- The
Nameproperty on this class has been renamed to Key.
- The
- The
MenuFactoryclass has been split into two classes:- A static MenuFactory class that stores a reference to the Current and Default factory instances.
- A generic MenuFactory<T,U,V> class where generic arguments are used to define the type of menu, menu item, and menu separator created by the factory.
- The old
MenuFactory.CreateMenuFlyoutvirtual method has been replaced by CreateMenu that is no longer virtual. Override CreateMenuCore to customize the menu. - The old
MenuFactory.CreateMenuFlyoutCorevirtual method has been replaced by CreateMenuItemCore. - The old
MenuFactory.CreateMenuSeparatorvirtual method has been replaced by CreateMenuSeparator that is no longer virtual. Override CreateMenuSeparatorCore to customize the menu separator.
- The MenuFactory.
CreateMenuFlyoutmethod has been renamed as MenuFactory<T,U,V>
Bars
- The Bars IMenuFactory implementation BarsMenuFactory has been moved from the
ActiproSoftware.UI.Avalonia.Controlsnamespace to theActiproSoftware.UI.Avalonia.Controls.Barsnamespace. - The base class for BarsMenuFactory has been changed to the new MenuFactory<T,U,V> class along with the necessary conversions required by the class.
- A ScreenTip is closed when a key is pressed. Previously, the ScreenTipService.CurrentScreenTip property would remain assigned until all key-related events had completed processing. Due to backend changes in Avalonia v12, the ScreenTipService.CurrentScreenTip property will only be populated in
KeyDownevents. Any logic reliant on CurrentScreenTip that currently resides in aKeyUpevent will need to be migrated to aKeyDownevent. This, for example, might impact any logic that might have been used to show contextual help for a ScreenTip when the F1 key was pressed.
Docking
The Docking MenuItemNames class has been renamed to CommandKeys and moved to the ActiproSoftware.Properties.Docking namespace. Additionally, some constants were renamed as follows:
CloseAllInContainerrenamed toCloseAll.CloseWindowrenamed toClose.FloatAllInContainerrenamed toFloatAll.MakeDockedWindowrenamed toDock.MakeDocumentWindowrenamed toMoveToMdi.MakeFloatingWindowrenamed toFloat.MoveToPrimaryMdiHostrenamed toMoveToPrimaryMdi.ToggleWindowAutoHideStaterenamed toAutoHide.
The value of each constant was updated to match new naming conventions as follows:
| Old Value | New Value | Related Constant |
|---|---|---|
"Activate1DockingMenuItem" (where "1" is a numerical position) |
"Docking.Activate.1" |
CommandKeys.Activate (prefix only) |
"CloseAllDocumentsDockingMenuItem" |
"Docking.CloseAllDocuments" |
CommandKeys.CloseAllDocuments |
"CloseAllInContainerDockingMenuItem" |
"Docking.CloseAll" |
CommandKeys.CloseAll |
"CloseOthersDockingMenuItem" |
"Docking.CloseOthers" |
CommandKeys.CloseOthers |
"CloseWindowDockingMenuItem" |
"Docking.Close" |
CommandKeys.Close |
"FloatAllInContainerDockingMenuItem" |
"Docking.FloatAll" |
CommandKeys.FloatAll |
"KeepTabOpenDockingMenuItem" |
"Docking.KeepTabOpen" |
CommandKeys.KeepTabOpen |
"MakeDockedWindowDockingMenuItem" |
"Docking.Dock" |
CommandKeys.Dock |
"MakeDocumentWindowDockingMenuItem" |
"Docking.MoveToMdi" |
CommandKeys.MoveToMdi |
"MakeFloatingWindowDockingMenuItem" |
"Docking.Float" |
CommandKeys.Float |
"MoveToNewHorizontalContainerDockingMenuItem" |
"Docking.MoveToNewHorizontalContainer" |
CommandKeys.MoveToNewHorizontalContainer |
"MoveToNewVerticalContainerDockingMenuItem" |
"Docking.MoveToNewVerticalContainer" |
CommandKeys.MoveToNewVerticalContainer |
"MoveToNextContainerDockingMenuItem" |
"Docking.MoveToNextContainer" |
CommandKeys.MoveToNextContainer |
"MoveToPreviousContainerDockingMenuItem" |
"Docking.MoveToPreviousContainer" |
CommandKeys.MoveToPreviousContainer |
"MoveToPrimaryMdiHostDockingMenuItem" |
"Docking.MoveToPrimaryMdi" |
CommandKeys.MoveToPrimaryMdi |
"PinTabDockingMenuItem" |
"Docking.PinTab" |
CommandKeys.PinTab |
"Select1DockingMenuItem" (where "1" is a numerical position) |
"Docking.SelectItem.1" |
CommandKeys.SelectItem (prefix only) |
"ToggleWindowAutoHideStateDockingMenuItem" |
"Docking.AutoHide" |
CommandKeys.AutoHide |