* fix: #17291 use CustomDateFormatString for parsing the text input
* fix: use CustomDateFormatString also for watermark
* fix: #17291 check also for SelectedDateFormat == Custom
* Always measure TextBlock with infinite width
* Make sure the constraint is always fulfilled
* Add some tests
* Adjust tests because we no longer retain the TextLayout in the arrange pass
* Add failing test for TemplateBinding inside custom control template
* Fix TemplateBinding XAML compilation error for custom IControlTemplate
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Fix InlineDictionary Behavior for Single Item Reassignment
Previous Behavior:
- When the `Set` method was called, it ignored the `overwrite` parameter if the dictionary contained only one item.
- This caused the `Set` method to behave like the `Add` method, leading to unexpected behavior in composition animations.
- Specifically, the second composition animation would not play because it could not replace the first animation. Instead, it was added after the first animation, preventing it from being executed.
Updated Behavior:
- The `InlineDictionary` now respects the `overwrite` parameter even when it contains only one item.
- This ensures that the second composition animation can overwrite the first one, allowing it to play correctly.
* Append unit test for InlineDictionary
* keep the `(TKey)_data` in a variable and reuse it below line 90 so we avoid a double cast
* Rename the test method
* Remove the unnecessary assignment code.
* Fix DataGrid native aot crash when sorting.
* Update DataGridSortDescription.cs
* add customType test
* does not crash when property type is not sortable.
* check `RuntimeFeature.IsDynamicCodeSupported` to fallback to reflection implemention
* Do not reset the selected range when the TextBox loses focus
Do not render selection highlight when the TextBox doesn't has focus
* Invalidate TextLayout when the focus is lost
* Make ClearSelectionAfterFocusLost optional
Make inactive selection highlight optional
* Make sure changes to ShowSelectionHighlight invalidate the visual and text layout
* Add failing focus tests for flyouts inside overlay popups
* Implement IKeyboardNavigationHandler on OverlayPopupHost
* Layout OverlayPopupHost content for focus to work
* Rework how TextBlock skips redundant measure and arrange calls
Add some tests
* Adjust tests
* Try this
* Make sure the TextBlock is arranged after it has been measured with a different availableSize
* Make it more clear that we are resetting and recreating the TextLayout
* Capture textLayout after inlines have been processed
* Set TimePickerPresenter.Time seconds component to zero when UseSeconds is false
* Remove unneeded PART_FirstSpace annotation from TimePickerPresenter
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Only check MainWindow visiblity in DoShutdown cancellation, when ShutdownMode == ShutdownMode.OnMainWindowClose
* Raise WindowClosedEvent event AFTER IsVisible/_shown properties were updated
* Add OnMainWindowClose cancellation tests
* Assert that Closing event was actually raised.
* Re-do fix by forcing window closing
* Forced .Shutdown() should also raise Window.Closed events, and not ignore them
* Always Return 0 bidi level for TextEndOfLine run
* Fix test unit
* Expand the unit test
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* ComboBox empty selection should not generate a TextBlock as SelectionBoxItem
Fixes: #16747
* Add test for ComboBox DisplayMemberBinding behavior without selection.
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* test: Check that `SplitButton.Click` is not fired when `SplitButton` is not in focused
* fix: `SplitButton.Click` is not fired when `SplitButton` is not in focused
* fix: Address review
* fix: Address review
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* test(SplitViewTests.cs): added failing test for issue #17176
* fix(SplitView.cs): added pane state pseudo class update in OnApplyTemplate
- fixed#17176
* test(SplitViewTests): added globalclock mock to failing test
* Show Avalonia context menu and toolip...
In native text box in integration test app. Only implemented for win32 right now.
This is to test the two popup behaviors required for native controls:
- The context menu needs focus to be transferred to Avalonia
- The ToolTip must not transfer focus to Avalonia
* Added Popup.TakesFocusFromNativeControl.
By default, if a popup is shown when a native control is focused, focus is transferred back to Avalonia in order for the popup to receive input. If this property is set to false, then the shown popup will not receive input until it receives an interaction which explicitly focuses the popup, such as a mouse click.
The effect of this property can be seen in the Embedding tag of the IntegrationTestApp: hovering over the native text box shows an Avalonia `ToolTip` which does not steal focus from the native text box. Right-clicking to open an Avalonia `ContextMenu` does steal focus so the menu items can be selected using the arrow keys.
Currently only implemented on a win32.
* Show tooltip and context menu on macOS.
* Implement TakeFocus on macOS.
* Add integration tests.
Only tested on win32 so far.
* Integration tests won't work on macOS.
As can be expected at this point, really.
* Update API diff.
* Fix HeadlessWindowImpl.Position does not persist new value
* Create unit-test for 17071 fix
* Fix CI errors
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Add failing test for #16746
* Always read the value from the target object.
The value must be read from the target object instead of using the value from the event because the value may have changed again between the time the event was raised and now: if that occurs in a two-way binding then we end up with a stack overflow.
* Added failing AutoCompleteBox test.
* Make sure that flags are reset if exits early.
Wrap everything in a `try`...`finally` block so that they get reset even on exception.
* Use scalable rasterization for visual brush
* Make ConfigureSceneBrushContentWithPicture less byzantine
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Enable VisualBrush to be used as Visual's OpacityMask
* Add missing test file
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Implement AvaloniaObject on ResourceProvider
* ColorPaletteResources and ColorPaletteResourcesCollection should inherit ResourceProvider
* Use ResourceProvider in tests too
* Adjust API diff
---------
Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
* Make sure wrapper and platform DrawingContext have the same transform after Flush
* Add some tests
* Update Avalonia.RenderTests.WpfCompare.csproj
* Remove comments
* Use test font
* Stop Selection.Clear() when selecting a range to enable multiple consecutive blocks to be selected.
* Reinstated Selection.Clear() when range is true and toggleModifier is false.
When range and toggleModifier are true, consecutive ranges are selected.
Added new unit test.
The typo causes the resources `implicitSharedInstance1` and `implicitSharedInstance2` are both always `AvaloniaProperty.UnsetValue`, where `Assert.Same` passes.
* Add CustomPopupPlacement API
* Add Placement="Custom" support for Flyout, ToolTip and ContextMenu controls as well
* Adjust some API changes
* Add Avalonia.Controls.Primitives.IPopupHost.ConfigurePosition breaking change
* Extract new types into separated files
* Fix build after merge conflict
* Adjust nupkg.xml
* Dispose property subscriptions after popup is closed, avoiding flickering
* Adjust API to be more future proof and add new parameters.
* Add new ContextRequestedEventArgs overload while I am on it
* test: Check that the button should not fire the click event on the space key when it is not active
* fix: Button should not fire the click event on the space key when it is not active
* fix: Address review
* Basic failing unit test for UWP/WinUI XYFocus search boundary scenario.
* Change IsAllowedXYNavigationMode to return false if keyDeviceType is null and modes == disabled.
* Add helper function to find the closest InputElement to the target element whose parent does not allow XYFocus rather than always searching from the TopLevel. This restricts focus searches within a specific subtree rather than allowing searches to bridge subtrees that share an XYFocus disabled parent.