* Add failing tests for OneTime and null data context bindings
* Made OneTime bindings update on DataContext changes
Also allows null as a valid value for bindings without path
* Remove now obsolete test
* Ignore key modifiers on text editing if field is a password field.
It's not secure to rely on password field content when moving. It's should
give no information what so ever.
* Required changes
* Fix BiDi algorithm and tests
* More adjustments
* Add EastAsianWidth trie and class
* Start implementing Unicode v15.1 Standard Annex #14
* Update Unicode data to V15.1 and initial Unicode® Standard Annex #14 implementation
* Some adjustments
* More fixes
* 543 to go
* 273 to go
* Almost done
* Finish up line breaker
* Some adjustments
* Tokenizer returns a ReadOnly Span instead of a string.
* Returning the old property for no API break changes
---------
Co-authored-by: Meloman19 <23280622+Meloman19@users.noreply.github.com>
* Add failing test for TextBlock
* Fix TextBlock re-measure in infinite container
* Fix outdated test
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Added BuildTests projects
* Added VerifyXamlCompilation build target
* Use TargetsTriggerByCompilation for XAML compilation
* Add *.binlog to gitignore
* VerifyXamlCompilation target: set NuGetPackageRoot
* Ensure WpfHybrid build test uses two markup compilation passes
* Fail build tests restore immediately if AvaloniaVersion isn't set
* Fix "could not extract MVID" for up-to-date builds
* Run VerifyXamlCompilation on CI
* Add FSharp build test
* add unit tests to show that the EffectiveViewPortChanged event is not being raised when it should.
note: this tests are verified against UWP behavior.
* fix raising of EffectiveViewPortChanged event.
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Make sure we always cache the created glyph typeface before we try to find the nearest match
* Cleanup usings
* Add failing test
* Cache the matched glyph typeface for EmbeddedFontCollection
* fix: #17291 use CustomDateFormatString for parsing the text input
* fix: use CustomDateFormatString also for watermark
* fix: #17291 check also for SelectedDateFormat == Custom
* fix: 17453 don't lose text selection when contextmenu opens on another control
* fix: 17453 don't effect other callers and move the check to FocusChanged method
* 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
* fix accelerator behavior for menu items and labels
* add elements with matching accelerator to test cycling in sub menus
* Add AccessKeyHandler tests for accelerators with more than one match
* Implement accelerator behavior based on WPF handling
* Remove commented code
* Remove OnAccessKey override => handled by DefaultMenuInteractionHandler
* remove obsolete test
* handle OnAccessKeyPressed for selected tab item
* fix unit tests
* use AccessKeyEvent instead of AccessKeyPressedEvent in unit tests
* navigate menu with and without ALT key
* Revert formatting changes in Tests
* Fix AccessKeyHandler comments
* move private types to bottom
* Remove lock statements, optimize removal of AccessKeyRegistrations
* remove call to Dispatcher.UIThread.Post
* simplifiy AccessKeyHandler.SortByHierarchy
* remove unnecessary method AccessKeyHandler.GetTargetsForSender
* regenerate API suppression file
* revert unneeded changes in MenuPage.axaml
* correct formatting changes
* do not sort by hierarchy if too few targets
* make AccessKeyEventArgs internal
* make AccessKeyPressedEventArgs internal
---------
Co-authored-by: Hans Docsek <hans.docsek@gmail.com>
* 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.
* 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>
* 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
* 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
* Try to infer DataContext type from #named binding nodes
* Try to infer DataContext type from $parent binding nodes
* Use new syntax in the repo (Rider still marks it as an error)
* Add tests ensuring type casing still works
* Fix $parent regression
* Make new tests StringSyntax compatible
* removed duplicated code between Window.Show and Window.ShowDialog
* Handling different cases of window initial position and size + unit test
* positioning cursor on resize grip in WindowOrder_Modal_Dialog_Stays_InFront_Of_Parent_When_Clicking_Resize_Grip test
* Fix for flaky test
* displaying decimal digits of slider value to avoid some issues with rounding
---------
Co-authored-by: Herman Kirshin <herman.kirshin@jetbrains.com>
* 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>
* feat: Allow use of (Classes.`classname`) syntax on Style and ControlTheme Setter elements
* feat: Add Selector validation
* test: Check binding Classes in Setter
* 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.