Skip to content

Callback for RegisterPropertyChangedCallback is fired when a child is added and it inherits a property whereas it's not in WinUI #15437

Description

@Youssef1313

Current behavior

			var sp = new StackPanel()
			{
				Background = new SolidColorBrush(Colors.Red),
				XYFocusKeyboardNavigation = Microsoft.UI.Xaml.Input.XYFocusKeyboardNavigationMode.Disabled,
				FlowDirection = FlowDirection.RightToLeft,
			};

			var tb = new TextBlock();
			tb.RegisterPropertyChangedCallback(UIElement.XYFocusKeyboardNavigationProperty, (_, _) =>
			{
				sp.Children.Clear();
				sp.Children.Add(new Border());
			});

			tb.RegisterPropertyChangedCallback(FrameworkElement.FlowDirectionProperty, (_, _) =>
			{
				sp.Children.Clear();
				sp.Children.Add(new Border());
			});

			sp.Children.Add(tb);

This test code fires both callbacks. On WinUI, none is fired.

Expected behavior

No response

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.has-repro-branchkind/bugSomething isn't workingproject/core-tools 🛠️Categorizes an issue or PR as relevant to core and tools

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions