Location>code7788 >text

NET cross-platform UI framework Avalonia 11.1 re-released

Popularity:680 ℃/2024-07-23 10:44:40

This is a translation

Original address/blog/avalonia-11-1-a-quantum-leap-in-cross-platform-ui-development

github address /AvaloniaUI/Avalonia

 Steven Kirk.
Posted on July 22nd

We're excited to announce the release of Avalonia 11.1, a massive update to our favorite cross-platform UI framework. While technically a point release, the number and impact of improvements make it feel more like a major upgrade. This release represents countless hours of hard work by our team of professionals and community contributors and brings many new features, performance enhancements, and overall improvements. Let's dive into the most exciting aspects of this release that will enable you to create even more impressive cross-platform applications.

Enhanced cross-platform support

Avalonia has always prided itself on supporting the widest range of platforms, and version 11.1 takes it to the next level:

TV Support: Avalonia 11.1 significantly broadens its reach into the smart TV ecosystem with support for the Samsung Tizen and Apple TV platforms. This extension opens up exciting new possibilities for developers looking to bring their apps to the big screen. With Samsung Tizen support, you can now target Samsung Smart TVs and other Tizen-based devices to reach a growing market segment. At the same time, adding Apple TV support lets you create amazing UI experiences within the Apple ecosystem. These new features are especially exciting for developers looking to expand their apps into the living room or create unique TV-based experiences.

Browser improvements: Avalonia's browser support has been significantly enhanced. A new software renderer has been implemented, providing better performance and cross-browser compatibility. In addition, the framework now allows multiple instances of AvaloniaView to support more complex and dynamic web applications. These improvements greatly enhance the flexibility and performance of Avalonia applications running in Web browsers, making them a more viable option for Web-based projects.

Android and iOS Enhancements: Various improvements were made to the Android and iOS backends, including fixes for input processing, keyboard interaction, and general stability enhancements. These improvements ensure a smoother experience for developers and end users on mobile platforms.

 

performance optimization

Performance is one of our most important features, and Avalonia 11.1 offers significant improvements in this area:

Vulkan Backend: The major addition is the new Vulkan rendering backend. This modern, low-overhead graphics API can significantly improve performance, especially on platforms that support it natively. Vulkan provides more direct control over the GPU to better utilize the graphics hardware. It can improve rendering performance and potentially reduce power consumption, which is especially beneficial for mobile devices and high-performance desktop applications.

Rendering optimizations: A number of optimizations have been made to the rendering pipeline, including improvements to dirty rectangle handling, transform operations, and general drawing performance. These enhancements result in smoother animations, faster UI updates, and an overall more responsive feel to the application. The team put a lot of effort into reducing unnecessary redraws and optimizing the rendering process, which should be especially noticeable in complex UIs with many elements.

Resource Management: Better management of resources, including fonts and XAML resources, should reduce memory usage and shorten application startup times. The framework now employs more efficient caching mechanisms and delayed loading strategies to ensure that resources are loaded only when needed. This not only reduces initial load times, but also helps reduce the overall memory footprint of the application.

 

User interface and user experience improvements

Avalonia 11.1 introduces several features that will help developers create more beautiful and user-friendly interfaces:

HyperlinkButton Control: A new HyperlinkButton control has been added to make it easier to implement clickable links in your UI. With built-in styles and behaviors for hyperlinks, the control saves developers time and ensures consistency between applications.

Improved tooltip system: The tooltip system has been overhauled with new features such as tooltip links and the new BetweenShowDelay property. Tooltip links allow for the creation of more complex information hierarchies, where moving from one element to a related element keeps the related information visible. The BetweenShowDelay property allows for fine-grained control over tooltip timing, allowing for more complex tooltip behavior.

Enhanced ScrollViewer: Improvements to the ScrollViewer include better handling of mouse wheel scrolling capture, resulting in a smoother scrolling experience. The enhanced ScrollViewer now provides a more natural scrolling feel that adapts to different input methods, from touchpads to traditional mouse wheels. This will give your applications a more polished feel, especially those with long scrolling content.

 

Developer Productivity Features

Avalonia 11.1 includes several features designed to make developers' lives easier and more productive:

Improved Developer Tools: The built-in developer tools have been enhanced with features such as a focus follower and the ability to fix attributes. The focus follower allows developers to easily track which element has focus in real-time, which is useful for debugging complex input scenarios. The ability to fix attributes in the attribute inspector makes it easier to monitor specific values when interacting with your application.

XAML Improvements: Many improvements have been made to the XAML system, including better handling of generics, more efficient compilation bindings, and enhanced diagnostics for XAML-related problems. Improved generic support allows for more flexible and reusable component definitions. Compiled bindings now produce more optimized code for better runtime performance. Enhanced diagnostics provide clearer error messages and warnings to help developers find and fix problems early in the development cycle.

Enhanced Binding System: The data binding system has been improved with improved MultiBinding, better handling of ICommand bindings in style setters, and a more reactive PropertyChanged event. MultiBinding now handles null values more gracefully and provides better performance. Improvements to ICommand bindings in style setters make it easier to create interactive UI elements in a more declarative way. The more reactive PropertyChanged event ensures that your UI is more reliably synchronized with the data model.

New converter type: FuncValueConverter with parameter support is introduced to provide greater flexibility in data conversion scenarios. This new converter type allows for more concise and readable binding expressions, especially for simple conversions that do not require a full converter class. It is particularly useful for rapid prototyping or simple one-off conversions.

For example, Avalonia now has , which is implemented as follows:

 

Graphics and animation enhancements

Graphics functionality has been expanded in this release.

New Pixel Formats: Support for the Rgb32 and Bgr32 pixel formats has been added, providing more options for image processing and manipulation. These new formats allow for more efficient processing of certain types of images and can improve the performance of image-intensive applications. They also provide better compatibility with some external image libraries and file formats.

Improved Brush Handling: Enhancements to TileBrush and DrawingBrush provide more powerful and flexible options for creating complex graphic effects. TileBrush now offers greater control over tiling behavior, including improved handling of edge conditions. DrawingBrush has been optimized for performance and now supports more complex drawing operations. These improvements allow more complex visual effects to be created with less code and better performance.

Animation improvements: The animation system has been improved, including fixing the Animator class to handle progress values less than zero. This ensures that animations are smoother and more predictable, especially for complex sequences or when dealing with dynamically changing values. In addition, the overall performance of animations has been improved, allowing for more complex animations without affecting the responsiveness of the application.

 

Accessibility and internationalization

Avalonia is constantly improving its support for creating accessible applications:

Improved Screen Reader Support: The automation properties of various controls, including the DataGrid, have been enhanced to improve screen reader compatibility. This includes better labeling, more descriptive state changes, and improved navigation support. These enhancements make it easier for developers to create applications that can be used by the visually impaired without a lot of extra coding.

Better Input Method Editor (IME) support: IME processing has been improved, especially for the benefit of users of languages that require complex input methods. This includes better handling of synthesis events, improved cursor positioning, and more reliable text insertion. These enhancements make the Avalonia application easier to use for users of languages such as Chinese, Japanese and Korean.

Enhanced localization support: New APIs have been added to make it easier to localize built-in controls and messages. This includes an improved resource system for managing localized strings and better support for right-to-left languages. These features simplify the creation of applications for global audiences.

 

Enhancements for mobile devices

Recognizing the growing importance of mobile development, Avalonia 11.1 includes several improvements for mobile devices:

Text Selection Handle: Implement a text selection handle for touch input in the TextBox control to provide a more native feel on mobile devices. This feature mimics the behavior users expect on mobile platforms, making text selection and editing more intuitive and user-friendly.

Safe area handling: Improved handling of safe areas on mobile devices ensures that your UI adapts correctly to different device form factors and orientations. This is especially important for devices with notches or rounded corners, ensuring that your UI content is always visible and not obscured by device functionality.

Mobile Gesture Recognition: Enhancements to gesture recognition, especially for touch devices, provide a more responsive and intuitive user experience on mobile platforms. This includes improvements to pinch-to-zoom, swipe gestures, and multi-touch interactions. These enhancements enable developers to create more natural mobile interfaces without having to implement custom gesture recognizers.

 

 New Window Features

Several improvements have been made to window management, increasing the flexibility and control developers have over their application presentations:

Multi-Monitor DPI Scaling: Better handling of DPI scaling across multiple monitors ensures that your application looks sharp and sized correctly on all monitors. This is especially important in today's diverse computing environments, where users often have multiple monitors with different scaling factors. Avalonia can now handle these scenarios more gracefully, ensuring a consistent appearance across all screens.

Window Z-order API: A new API for getting the Z-order of windows gives developers greater control over window stacking and management. This is especially useful for applications that manage multiple windows or create custom window management behaviors. It allows for more complex MDI style interfaces or custom window management solutions.

Improved Window Resizing and Positioning: Various enhancements to window resizing, positioning and state management provide more reliable and consistent behavior across platforms. This includes better handling of maximized and minimized states, more accurate initial positioning, and improved resizing behavior. These improvements ensure that your applications behave predictably across operating systems and window managers.

 

 file system integration

Avalonia 11.1 has improved integration with the native file system, making it easier to create applications that work seamlessly with the host operating system:

Enhanced File Dialog: The file selector dialog has been improved to better support file type filtering and initial directory selection. These enhancements make it easier to create an intuitive file selection experience that meets the platform's expectations. Improved filtering options allow for finer control over the types of files the user can select.

File Activation Support: A new API for handling file activation events makes it easier to implement file association functionality in your applications. This allows your Avalonia applications to respond when a user opens a file from the operating system, providing a more integrated experience. It is particularly useful for document-centric applications or tools that deal with specific file types.

 

Build and deploy improvements

To improve the build and deployment process, a number of changes have been made to make it easier to create and distribute Avalonia applications:

NativeAOT Support: Improved support for NativeAOT compilation ensures that Avalonia applications can take full advantage of this performance-enhancing technology. NativeAOT reduces startup time and memory usage by pre-compiling applications into native code. This is especially beneficial for desktop applications where startup performance is critical.

Simplified resource handling: Changes to how assembly resources are handled should result in smaller application sizes and faster load times. The resource system is optimized to reduce duplication and improve loading efficiency. This can lead to a significant reduction in the size of large applications with many embedded resources.

Enhanced XAML Compilation: Improvements to the XAML compilation process provide better performance and more reliable error reporting. The compiler now generates more optimized code and provides clearer error messages when problems are detected. This helps identify problems earlier in the development process and improves runtime performance.

These build and deployment enhancements should result in smaller, faster applications.

 

 reach a verdict

Avalonia 11.1 represents a significant step forward for the framework. The breadth and depth of improvements reflects our team's commitment to delivering a top-notch cross-platform UI development experience. From extended platform support and performance optimizations to enhanced developer tools and improved accessibility, this release touches on nearly every aspect of the framework.

We encourage all Avalonia developers to upgrade to this new release and explore the wealth of new features and improvements it offers. Your feedback and contributions are invaluable in shaping the future of Avalonia, so please feel free to share your experiences and suggestions with the community.

We would like to send a huge thank you to the core team and all the contributors in the community who made this release possible. Your hard work, creativity, and dedication have made Avalonia such a powerful and beloved framework.

Have fun developing and we can't wait to see the amazing applications you create with Avalonia 11.1!