Converting to v25.2
New .NET Target
Updated the .NET target from .NET 6 to .NET 8 since the former is out of support.
Avalonia Dependency
Updated the minimum Avalonia dependency from v11.2.0 to v11.3.0.
ChromedTitleBar and WindowTitleBar
The ChromedTitleBar control's tight Window integration was limiting the ability to use the control in scenarios where integration with a Window was not desired. To improve usability, the control was split into a base ChromedTitleBar primitive control with all the core functionality and the derived WindowTitleBar control that is designed to integrate with a Window. ChromedTitleBar was also moved to the Primitives sub-namespace.
To enable more usage scenarios, the Maximize and Restore caption buttons are implemented as distinct controls instead of a single control that toggled between the two states. A new IsRestoreButtonAllowed property has been added to control availability of the Restore caption button that appears in the minimized or maximized window states.
In this release, the macOS operation system joins Windows in support for extending into the native title bar area. This capability is enabled by default. To restore the original functionality on macOS, set WindowTitleBar.CanConfigureWindowClientArea to false.
The following updates should be made for ChromedTitleBar:
- Replace ChromedTitleBar with WindowTitleBar everywhere that integration with the parent
Windowis desired. - If not integrating with the parent
Window, continue to use ChromedTitleBar with the updatedActiproSoftware.UI.Avalonia.Controls.Primitivesnamespace.
The following updates should be made for any custom types that derive from ChromedTitleBar:
- Derived types that integrate with
Windowshould be updated to derive fromWindowTitleBarinstead ofChromedTitleBar. - Derived types that do not integrate with
Windowshould continue to derive fromChromedTitleBarand remove theIsIntegratedWithParentWindowoverride that is no longer necessary. - The virtual
OnClose,OnMinimize,OnToggleMaximized, andOnToggleFullScreenmethods have be replaced with relatedICommandproperties (e.g., CloseCommand and MaximizeCommand). Any custom logic previously associated with method overrides should be encapsulated as anICommandand assigned to the corresponding property. The DelegateCommand<T> class is helpful in this regard.
Finally, the following updates may be necessary when using either ChromedTitleBar or WindowTitleBar.
- If IsMaximizeButtonAllowed is set to
false, the IsRestoreButtonAllowed typically should also be set tofalse. - The
AllowWindowDragOnPointerPressedproperty has been renamed as CanDrag. - A default context menu has been added that is displayed when right-clicking the title bar or left-clicking the Icon. If a context menu is not desired, set HasDefaultMenu to
false. - If the LeftContent property was used to add an icon, consider migrating to the new Icon property instead.
- The
Contentproperty of WindowTitleBar is, by default, bound to theTitleof the parentWindow. If the default title is not desired, explicitly set theContenttonull.
ChromedTitleBar Caption Buttons
ChromedTitleBar will now alter the appearance of its caption buttons based on the current platform: Windows, macOS, or Linux.
Bars MVVM Tag Property
To simplify storing user-defined data with Bars view models without the need to create custom derived classes, each view model has a new Tag property exposed using the IHasTag interface. The existing IBarGalleryItemViewModel interface was updated to also import the new IHasTag interface, so this is a breaking change for any user-defined types that implement IBarGalleryItemViewModel directly without deriving from BarGalleryItemViewModel<T>.
The following updates should be made to any class that implements IBarGalleryItemViewModel:
Theme Generator Updates
The ThemeGenerator.GetBrushResource method was updated to return IBrush instead of Brush.