* feat(NumericUpDown): Add InnerContent. It is positioned on the opposite side to ButtonSpinnerLocation
* fix: TextBox Nullability
* fix: Adress review
* fix: nits
* fix: missing update ControlCatalog
* Fixed relative mapping mode for brushes (skia only, pending radial)
* Implemented separate RadiusX/RadiusY with proper mapping modes for RadialGradientBrush
* tests for conic brush
* Added tests for geometry drawing
* Updated DrawingBrush test image since it now matches WPF
* Update obsolete property usage
* Fixed D2D, updated radial test with D2D results that actually match WPF ones
* Fixed RadiusX/Y for radial gradients with non-centered origin
* Updated obsolete property usage
* Code cleanup
* Typo
* ApiDiff suppression
* Removed files for skipped test
* More info in obsoletion warning
* clarify
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* Property support StaticWebAssets SDK when it's available
* Fix browser issue with dispatcher used before initialization
* Use RequestAnimationFrame instead of WebEmbeddableControlRoot hack
* Always include both types of assets by default, as I couldn't find a reliable way to detect project capabilities properly
* Remove "WasmRuntimeAssetsLocation" override, instead let users use default value set by .NET SDK
* Revert "Fix browser issue with dispatcher used before initialization"
This reverts commit fc43c7e3d5.
* Add AvaloniaAllowWebGl2 prop
* What
* Init
* Remove XY navigation cache as it's no use
* Use pooled collection for XY navigation
* Restructure code a bit, fix IScroller handling
* Init KeyboardNavigationTests_XY tests
* Simplify XYFocus.GetNextFocusableElement usage
* Minor fixes
* Add more tests
* Remove unused NuiKeyboardNavigationHandler
* Finalizing
* Fix tests
* Add TODO12
* Make XYFocusOptions a class
* Add TestServices.FocusableWindow and make KeyboardNavigationHandler lazy, as it can't be reused on multiple windows
* Fix KeyboardNavigationHandler events handling, when focus was not actually changed
* Add arrow key tests
* Replace XYFocusKeyboardNavigationMode with more flexible XYFocusNavigationModes, integrate with KeyDeviceType input types
* Make XY focus navigation less broken, when there is no starting focused control
* Several Android TV compatibility improvements
* Remap tizen Back button to Esc
* Introduce internal XYFocusHelpers
* Make ComboBox and AutoCompleteBox handle Key events only when it's needed
* Make TextBox handle Key events only when it's needed
* Ignore Alt+Down when XY navigation is enabled in CalendarDatePicker and SplitButton
* Rename IsAllowedXYNavigationMode
* Fix ButtonSpinner with XY navigation
* Implement a very simple focus engagement for GridSplitter and Slider
* Ability to configure font features
* Minor adjustments
---------
Co-authored-by: Herman Kirshin <herman.kirshin@jetbrains.com>
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Add BackgroundSizing enum
* Improve formatting in RoundedRect
* Add the BackgroundSizing property to relevant controls
* Add new GeometryBuilder helper
This is based on new ideas and APIs in both WinUI and WPF
* Support BackgroundSizing in BorderRenderHelper
This also removes the last remnants of dash array support in the internal APIs
* Remove old code in BorderRenderHelper moved to GeometryBuilder
* Move Rectangle shape geometry calculation into GeometryBuilder
* Add RadiusX/Y properties to RectangleGeometry
* Use RectangleGeometry directly in the Rectangle shape
Since RectangleGeometry now supports RadiusX/Y there is no longer a need to have a separate geometry creation path.
* Add WinUI-based CalculateRoundedCornersRectangle() method
* Simplify and use the WinUI-algorithm in BorderRenderHelper
* Update GeometryBuilder.DrawRoundedCornersRectangle() based on WinUI
* Remove obsolete WPF-based CalculateRoundedCornersRectangle method
* Update CalculateRoundedCornersRectangleAlternate
* Update GeometryBuilderTests
* Fix merge
* Remove unused dashed line properties in BorderRenderHelper
These were already removed in master but could not be merged directly because of the new backgroundSizing parameter.
* Optimize CalculateRoundedCornersRectangle
In the worse-case up to three Point structs were created during calculation for each keypoint. Now doubles are used during calculations so the Point is created once at the end.
* Adjust corner radius calculation within custom GeometryBuilder.CalculateRoundedCornersRectangle()
Corner radius is defined at the center of the border stroke rather than the outside edge.
* Simplify code in WinUI's algorithm for CalculateRoundedCornersRectangle()
* Remove extra BorderRenderHelper.RenderCore method
This method does not need to be separate from Render.
* Add more CalculateRoundedCornersRectangle tests and adjust method naming
* Remove custom CalculateRoundedCornersRectangle() algorithm and always use the WinUI one
* Remove some AggressiveInlining attributes
* Make parameters clear
* Pass RoundedRectKeypoints by ref
* Use GeometryCombineMode.Exclude to better calculate border geometries
* Update BorderPage.xaml to include BackgroundSizing API
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Update ncrunch config.
* WIP: Benchmarks
* Initial refactor of binding infrastructure.
- `ExpressionObserver` has been removed and its functionality merged with `BindingExpression`
- `BindingExpression` handles all types of `BindingMode` itself; doesn't require `BindingOperations.Apply` to set up a separate observable for `TwoWay/`OneWayToSource` bindings
- This allows us to fix some long-standing issues with `OneWayToSource` bindings
- Expression nodes have been refactored
- No longer split between `Avalonia.Base` and `Avalonia.Markup`
- Categorize them according to whether they use reflection or not
A few tests are failing around binding warnings: this is because the next step here is to fix binding warnings.
* Make default binding Source = UnsetProperty.
Null is a theoretically valid value for `Source`; setting it to null shouldn't mean "use the data context".
* Move logging to BindingExpression.
As `BindingExpression` now has enough information to decide when it's appropriate to log an error/warning or not.
Fixes#5762Fixes#9422
* Add compatibility hack for older compiled bindings.
Previously, `CompiledBindingPathBuilder` didn't have a `TemplatedParent` method and instead the XAML compiler rewrite templated parent bindings to be a `$self.TemplateParent` property binding. resulting in extraneous logs.
Add a constructor with an `apiVersion` to `CompiledBindingPathBuilder` which will be used by newer versions of the XAML compiler, and if a usage is detected using an `apiVersion` of 0, then upgrade `$self.TemplatedParent` to use a `TemplatedParentPathElement`.
* Log errors from property accessors.
* Don't log errors for named control bindings...
...on elements which aren't yet rooted.
* Log errors for failed conversions.
* Use consistent wording for binding warnings.
"Could not convert" instead of "Cannot convert".
* Log warnings for converter exceptions.
* Don't convert new TargetTypeConverters each time.
* Added failing test for implicit conversion.
* Support cast operators in compiled bindings.
A bit of a hack as we'd ideally not be using reflection when using compiled bindings.
* This shouldn't be a public API.
Should only be used for tests.
* Make enum/int conversion work.
* Check for SetValue equality after conversion.
And also use "identity equals" where value types and strings use `object.Equals` and reference types use `object.ReferenceEquals`.
* Added ConverterCulture back to bindings.
* Fix merge error.
Removed deleted files from csproj that were re-added due to indentation changes.
* Use BindingExpression directly in ValueStoe.
* Introduce BindingExpressionBase.
And `UntypedBindingExpressionBase`.
* Make TemplateBinding a BindingExpression.
* Make DynamicResource use a BindingExpression.
* WIP: Start exposing a BindingExpression API.
* Finish exposing a BindingExpression API.
* Fix OneTimeBinding.
* Remove unneeded classes/methods.
* Don't call obsolete API.
* Make BindingExpressionBase the public API.
This matches WPF's API.
* Added BindingExpressionBase.UpdateTarget.
* Initial implementation of UpdateSourceTrigger.
* Don't use weak references for values.
If they're boxed values, they can get collected.
* No need for virtual/generic methods here now.
* Reintroduce support for binding anchors.
Turns out these were needed by animations, just our animation system has no unit tests so I missed that fact earlier. Add a basic animation unit test that fails without anchor support, and add binding anchors back in. Currently a private API as I suspect this feature shouldn't be needed outside the framework.
* Include new property in clone.
And add real-life example of `UpdateSourceTrigger=LostFocus` to BindingDemo.
* Fix merge error.
* Updated BindingExpression tests.
- Make them run for both compiled and reflection bindings (found a bunch of tests that fail with compiled bindings)
- Make them not depend on converting the `BindingExpression` to an observable and instead test the end result of the binding on an `AvaloniaObject`
* Fix compiled binding indexer tests.
* Use data validation plugins in PropertyAccessorNode.
Added a warning suppression for now: we may need a separate `DataValidators` list for AOT-friendly plugins.
* Don't separate plugins by reflection.
`DataAnnotationsValidationPlugin` is public and so it can't be moved. No point in moving the others if this one will be in the wrong place.
* Remove unneeded methods.
* Make reflection binding tests use a string.
Convert the `System.Linq.Expression` to a string and then use this, as reflection bindings will always be instanced with a string path.
* Added TODO12 plan for IBinding2.
* Use more specific exception.
* Fix nits from code review.
* Make expression nodes sealed where possible.
* Unsubscribe on Stop, don't re-subscribe.
D'oh.
* Tweak ExpressionNode lists.
Saves a few K in benchmarks and it's a cleaner API.
* Add a pooled option in BindingExpressionGrammar.
Micro-optimization.
* Avoid allocations when enumerating binding plugins.
* Add IBinding2 support to observable bind overloads.
In the case of `TemplateBinding`, the `IObservable<object?>` bind overload is selected by C#. Add an explicit check for an `IBinding2` here to use the more performant code-path.
* Remove disposed binding from ImmediateBindingFrame.
* Added TemplateBinding benchmarks.
* Remove duplicate items.
Seems to have been caused by a merge error.
* Fix exception when closing color picker.
And add tests.
* Don't skip converter when binding to self.
* Don't pass UnsetValue to converters.
This follows WPF behavior.
* Log element name if present.
More useful than just logging the control hash code.
* Respect binding priority.
* Throw on mismatched binding priorities.
We don't want to respect the binding priority in this case as it breaks `TemplateBindings` when the default `LocalValue` priority is passed. Instead make sure that the priority parameter matches that of the expression.
This reverts commit a72765d705.
* Convert to target type in TemplateBinding.
* Short-circuit target type conversion for same types.
* Add initial metal support for iOS
* Make iOS backend compilable with TVOS and MacCatalyst
* Enable nullable and fix almost all warnings in iOS project
* Implement keyboard and remote (+touch) input on iOS and tvOS
* Disable Metal for now
* Fix warning
* Add tvOS target for Avalonia.iOS
* Include tvos workloads
* Don't use WebKit on tvOS samples
* Extend StandardRuntimePlatform with more apple platforms
* Handle mouse and stylus for iOS backend as well
* And IntermediatePoints
* Fix compatibility warnings
* Respect t.MaximumPossibleForce
* Make ControlCatalog.IOS work with both iOS and tvOS
* Exclude compiled files using csproj instead of #if directives
* Make Metal rendering actually usable
* No need for buffer.WaitUntilCompleted on iOS here
* Don't overwrite IsClipEnabled.
The user should be able to set this on an adorner themselves.
* Use correct clip bounds for adorners.
Only take the adorned visual's clip bounds into account if the adorner is clipped to these bounds.
* Disable clipping on GridSplitter adorner.
Fixes#10700
* Don't clip adorners in ControlCatalog.
Default setting is `true`, but this was being overridden in `AdornerLayer.AddVisualAdorner`. That was fixed by an earlier commit in this PR, so property needs to be set explicitly to false in ControlCatalog.
* add tv support to form factor
* Resolve comments and add chromium book
* Add some documentation
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Add an event so that users can detect when an Application icon is clicked.
* refactor to use Lifetime apis.
* use ActivationKind instead of reason to be consistent with other xaml platforms
* implement macos raise url events.
* add docs.
* add apis to programatically Activate and Deactivate the application.
This allows the dock icon to be kept in sync so its menu options there say "Hide" / "Show" correctly.
* fix api naming.
* Add Browser IActivatableApplicationLifetime impl
* Implement IActivatableApplicationLifetime on Android
* Add IActivatableApplicationLifetime iOS implementation
* Adjust android impl a little
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Update Avalonia.Controls.Platform.Dialogs apis
* Enable nullable on dialogs project
* Implement ManagedFileChooserOverwritePrompt with new styles, instead of hardcoding prompt creation
* Add BclMountedVolumeInfoProvider fallback
* Update samples page to include ShowOverwritePrompt
* ManagedStorageProvider with different window and popup implementations
* Extend ManagedFileDialogOptions
* Fix#8437 because I can
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* Make iOS safe area more consistent with Android
* Implement TopLevel.AutoSafeAreaPadding (enabled by default)
* Make SafeAreaDemo more representative
* Some fixes + add comments
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* implement Next action in android IME
* Handle UIReturnKeyType.Next on iOS
* Remove NavigationMethod.Directional (do we need focus adorner?)
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Introduce ErrorConverter and DisplayErrors attached properties
- the converter can be used to change the way a message is print
- we use DisplayErrors to get the converted error messages
* Adjust FluentTheme
* [WIP] Add a sample Page for DataValidationErrors
* use a private attached property to store recent errors
this approach gets rid of the need to DisplayErrors property
* Update samples with some additional details
* Reuse rich SetError logic in DataGrid as well
* Unify some code with OnErrorsOrConverterChanged
* Restore old behavior with null default value
* Add SetErrorConverter test
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Update SkiaSharp/HarfBuzzSharp and use proper native bits, make it configurable
* Run UiThreadRender jobs on each animation request in WASM
* Update ControlCatalog to match our current templates
* Add TaskContinuationOptions.ExecuteSynchronously in compositing engine where it's missed
* Log invalid rendering configuration
* Use setInterval isntead of Timer on WASM
* Minor fixes
* Implement BrowserDispatcherImpl and avoid possible memory leak
* Add integration test for access key indicators in macOS menu bar titles.
Tests for access key indicators displaying as plain underscores in macOS menu bar items.
* Exclude access key markers from native menu titles on macOS.
macOS does not support access key markers, so they just display as extra underscores.
* feat: add Content and ContentPresenter for ColorPicker
* feat: update according to https://github.com/AvaloniaUI/Avalonia/pull/13073 feedback.
* feat: add HorizontalContentAlignment and VerticalContentAlignment default value to simple theme.
* feat: update documentation wording.
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Add Fluent HeaderContentControl theme
* Fix file name, add content template
* Add simple theme for HeaderedContentControl
* Add sample page for HeaderedContentControl in the catalog
* Change the HeaderedContentControl to use a Grid instead of a stack panel for its layout
* Fix template part names
* Fix HeaderedContentControl typename
* Fix the template part type again
* Fix control template names
* Introduce IFilePickerFileTypes to have more control over file types in the native backend
* Update samples page for dialogs
* Rename to IAvnFilePickerFileTypes
* WIP
* Fix disabled popup
* Explicitly dispose AvnString and AvnStringArray + GetNSArrayOfStringsAndRelease
* Fix potential crash
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* implement tizen platform, resolve#6110
* Fix enum types of touch event
* Fix issue of touch tracking.
* #6110 fix ui thread lock
* #6110 send keypad from tizen window
* #6110 fix touch update
* #6110 add text editor for input fields
* #6110 Hide text field
* #6110 Fix issue of text selection and backspace
* #6110 support multi and single line for input
* #6110 temporary set multiline true by default.
* #6110 fix issue of build with latest version and make it compatible
* #6110 by pass double input when softkeyboard showing.
* #6110 adding support for clipboard.
* #6110 add permission helper to tizen platform
* #6110 Implementation of storage provider for tizen
* #6110 send text for key character from hard keyboard
* #6110 Complete the input implementation. soft and hard keyboard
* #6110 remove ElmSharp
* Update Permissions.cs
* #6110 remove open folder for tizen
* #6110 fix the issue of keyboard frezee for tizen
* #6110 add workload to build tizen
* #6110 try to setup tizen workloads for windows
* #6110 change tizen workload install to powershell
* #6110 skip api diff check when package not exists
* #6110 try to fix linux pipeline
* #6110 implement tizen native view
* #6110 add dev analyzer and trimming
* #6110 Migrate to GLES and remove framebuffer
* #6110 Temporary solution to make GL work
* #6110 WIP and add comments
* #6110 optimise gles rendering and timing.
* #6110 fix dependency issue of tizen HarfBuzzSharp
* #6110 patch a fix for clipboard issue
* #6110 Support tizen sdk for old proj type, WIP
* #6110 wip setup app
* #6110 support only net6 for tizen
* #6110 resolve comments
---------
Co-authored-by: Kangho Hur <rookiejava+github@gmail.com>
Co-authored-by: Max Katz <maxkatz6@outlook.com>