Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New DependencyPropertyHelper class #16315

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

carldebilly
Copy link
Member

GitHub Issue (If applicable): closes #

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@carldebilly carldebilly force-pushed the dev/cdb/dependency-property-helper branch from 572b18d to bad5a7c Compare April 16, 2024 03:31
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-16315/index.html

@carldebilly carldebilly force-pushed the dev/cdb/dependency-property-helper branch 2 times, most recently from f9ed627 to 761cfe1 Compare April 16, 2024 12:42
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-16315/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-16315/index.html

@carldebilly carldebilly force-pushed the dev/cdb/dependency-property-helper branch from 761cfe1 to e993d1e Compare April 16, 2024 15:21
@carldebilly carldebilly self-assigned this Apr 16, 2024
@carldebilly carldebilly marked this pull request as ready for review April 16, 2024 15:22
/// external projects.
/// </summary>
/// <remarks>
/// A small reflection is still required to access the class because those using it needs to know what they are doing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// A small reflection is still required to access the class because those using it needs to know what they are doing.
/// A small reflection is still required to access the class because those using it need to know what they are doing.

/// Get the default value of a <see cref="DependencyProperty"/> for a given type.
/// </summary>
/// <remarks>
/// This is the value defined in the metadata of the property, which _may_ be overriden
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// This is the value defined in the metadata of the property, which _may_ be overriden
/// This is the value defined in the metadata of the property, which _may_ be overridden

/// Get the default value of a <see cref="DependencyProperty"/> for a given type.
/// </summary>
/// <remarks>
/// This is the value defined in the metadata of the property, which _may_ be overriden
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// This is the value defined in the metadata of the property, which _may_ be overriden
/// This is the value defined in the metadata of the property, which _may_ be overridden

/// Get the default value of a <see cref="DependencyProperty"/> for the owner type.
/// </summary>
/// <remarks>
/// This is the value defined in the metadata of the property, which _may_ be overriden
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// This is the value defined in the metadata of the property, which _may_ be overriden
/// This is the value defined in the metadata of the property, which _may_ be overridden

/// <summary>
/// Try to get all the <see cref="DependencyProperty"/> defined for a given type.
/// </summary>
/// <returns>False means it's not a dependency object</returns>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <returns>False means it's not a dependency object</returns>
/// <returns>False means it's not a dependency object.</returns>

=> dependencyProperty.Name;

/// <summary>
/// Get the owner type of the property
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Get the owner type of the property
/// Get the owner type of the property.

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-16315/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-16315/index.html

@nventive-devops
Copy link
Contributor

The build 121247 found UI Test snapshots differences: android-28-net7: 17, android-28-net7-Snap: 48, ios: 79, ios-Snap: 263, skia-gtk-screenshots: 35, skia-linux-screenshots: 74, skia-windows-screenshots: 12, wasm: 52, wasm-automated-net7.0-UWP-Default-automated: 21, wasm-automated-net7.0-UWP-RuntimeTests-0: 0, wasm-automated-net7.0-UWP-RuntimeTests-1: 0, wasm-automated-net7.0-UWP-RuntimeTests-2: 0, wasm-automated-net7.0-WinUI-Benchmarks-automated: 0, wasm-automated-net7.0-WinUI-RuntimeTests-0: 0, wasm-automated-net7.0-WinUI-RuntimeTests-1: 0, wasm-automated-net7.0-WinUI-RuntimeTests-2: 0

Details
  • android-28-net7: 17 changed over 823

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25
    • Detereminate_ProgressRing_Validation75_[#FF0000_#008000_#008000_#008000]_Progress-Ring-Value-75
    • ImageStretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • When_InScrollViewer_after_scroll
    • TestManipulation_Result
    • UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • UpDownTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • When_InListView_after_scroll
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • When_Parent_PointerMoved_After_drag_on_non-scrolling_ScrollViewer
    • When_Parent_PointerMoved_After_drag_on_ScrollViewer_-_touch
    • Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • SelectionTest_UITests_Microsoft_UI_Xaml_Controls_RadioButtonsTests_RadioButtonsPage
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • When_SingleItem_UITests_Windows_UI_Xaml_Controls_SwipeControlTests_SwipeControl_Automated
  • android-28-net7-Snap: 48 changed over 1064

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Icons_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Icons
    • Gesture_Recognizer_Pointer_Events_test_bench_UITests_Shared_Windows_UI_Input_GestureRecognizer_PointersEvents
    • MediaPlayerElement_Using_flv_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Flv_Extension
    • MediaPlayerElement_Using_mkv_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mkv_Extension
    • MediaPlayerElement_Using_mov_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mov_Extension
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_ProgressRingHeightTest_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_ProgressRingHeightTest
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage
    • TextBox_Multiline_TextBox_In_ScrollViewer_Uno_UI_Samples_Content_UITests_TextBoxControl_Multiline_TextBox_In_ScrollViewer
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Basic_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Basic
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_FromMsAppData_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_FromMsAppData
    • MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • RatingControl_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage
    • TextBox_Input_InputScope_CurrencyAmount_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_InputScope_CurrencyAmount
    • TextBox_Input_InputScope_Email_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_InputScope_Email
    • TextBox_Input_InputScope_Number_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_InputScope_Number
    • ListView_HorizontalListView_Templates_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListView_Templates
    • MediaPlayerElement_MediaPlayerElement_Stretch_Fill_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Stretch_Fill
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
  • ios: 79 changed over 265

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Keyboard_Textbox_NoScrollViewer_Validation_5_-_Remove_Focus_on_numberTextBox
    • ListView_ObservableCollection_Creation_Count_Added
    • ListView_ObservableCollection_Creation_Count_Added_above
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-1
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-2
    • Button_NestedButtons_Validation_nVentive_Umbrella_Views_UI_Samples_Content_UITests_ButtonTestsControl_Nested_Buttons
    • ContentPresenter_Changing_ContentTemplate_Uno_UI_Samples_Content_UITests_ContentPresenter_ContentPresenter_Changing_ContentTemplate
    • Check_ListView_Swallows_Measure_after_scroll
    • Keyboard_Textbox_NoScrollViewer_Validation_2_-_Remove_Focus_on_placeholderTextTextBox
    • Keyboard_Textbox_NoScrollViewer_Validation_0_-_Remove_Focus_on_normalTextBox
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • TextBox_Foreground_Uno_UI_Samples_Content_UITests_TextBoxControl_TextBox_Foreground
    • ThreeStates_Checked
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • CheckBox_DoubleTapValidation_Uno_UI_Samples_Content_UITests_ButtonTestsControl_CheckBox_IsEnabled_Automated
    • Keyboard_Textbox_NoScrollViewer_Validation_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_Test_NoScrollViewer_Automated
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-3
    • StaticResource_CSharp_Validation_UITests_Shared_Resources_StaticResource_StaticResource_Simple
    • RadioButton_IsEnabled_Validation_UITests_Shared_Windows_UI_Xaml_Controls_RadioButtonTests_RadioButton_IsEnabled_Automated
    • StaticResource_XAML_Validation_UITests_Shared_Resources_StaticResource_StaticResource_Simple
  • ios-Snap: 263 changed over 1055

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Brushes_UITests_Windows_UI_Xaml_Media_GradientBrushTests_LinearGradientBrush_Change_Stops_UITests_Windows_UI_Xaml_Media_GradientBrushTests_LinearGradientBrush_Change_Stops
    • Buttons_Button_Events_UITests_Shared_Windows_UI_Xaml_Controls_Button_Button_Events
    • Buttons_RadioButton_IsEnabled_Automated_Uno_UI_Samples_Content_UITests_ButtonTestsControl_RadioButton_IsEnabled_Automated
    • Gesture_Recognizer_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_TransformationsTests_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_TransformationsTests
    • Gesture_Recognizer_UITests_Windows_UI_Input_GestureRecognizerTests_Manipulation_Inertia_UITests_Windows_UI_Input_GestureRecognizerTests_Manipulation_Inertia
    • Grid_Grid_Two_bottom_row_Auto_middle_col_auto_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_Two_bottom_row_Auto_middle_col_auto
    • ListView_ListViewDynamicOrientation_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewDynamicOrientation
    • ListView_ListView_Explicit_Items_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_Explicit_Items
    • ListView_ListView_Header_DataContextChanging_UITests_Shared_Windows_UI_Xaml_Controls_ListView_Header_DataContextChanging
    • ListView_ScrollIntoViewTest_SamplesApp_Windows_UI_Xaml_Controls_ListView_ScrollIntoViewTest
    • ListView_UITests_Windows_UI_Xaml_Controls_ListView_ListViewItem_IsEnabled_UITests_Windows_UI_Xaml_Controls_ListView_ListViewItem_IsEnabled
    • Scrolling_Hosted_ScrollViewer_UITests_Shared_Windows_UI_Xaml_Controls_ScrollViewerTests_Hosted_ScrollViewer
    • Scrolling_MUXControlsTestApp_ScrollViewBlankPage_MUXControlsTestApp_ScrollViewBlankPage
    • Scrolling_MUXControlsTestApp_ScrollViewBringIntoViewPage_MUXControlsTestApp_ScrollViewBringIntoViewPage
    • Scrolling_MUXControlsTestApp_ScrollViewDynamicPage_MUXControlsTestApp_ScrollViewDynamicPage
    • Scrolling_MUXControlsTestApp_ScrollViewKeyboardAndGamepadNavigationPage_MUXControlsTestApp_ScrollViewKeyboardAndGamepadNavigationPage
    • Brushes_GenericApp_Views_Content_UITests_ImageBrushTestControl_ImageBrush_UniformToFill_GenericApp_Views_Content_UITests_ImageBrushTestControl_ImageBrush_UniformToFill
    • Buttons_Buttons_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Buttons
    • Buttons_HyperlinkButton_IsEnabled_Automated_Uno_UI_Samples_Content_UITests_ButtonTestsControl_HyperlinkButton_IsEnabled_Automated
    • ColorPicker_WinUIColorPickerPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ColorPickerTests_WinUIColorPickerPage
  • skia-gtk-screenshots: 35 changed over 2188

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Native.png-dark
    • Native.png
    • EllipsemaskingEllipseSuperpositionPanel.png
    • Using .flv.png-dark
    • Using .flv.png
    • NavigationViewRS4Page.png-dark
    • BorderImageBrush.png
    • NavigationViewRS4Page.png
    • MediaPlayer.png-dark
    • MediaPlayer.png
    • Rectangle.png
    • ImageInStackPanel.png-dark
    • ImageInStackPanel.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Path_Geometries.png-dark
    • Path_Geometries.png
    • ProgressRingHeightTest.png-dark
    • ProgressRingHeightTest.png
    • Using .3gp.png-dark
  • skia-linux-screenshots: 74 changed over 2188

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BorderImageBrushRelativeTransform.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ImageBrushStretch.png-dark
    • ImageBrushStretch.png
    • Ellipse.png-dark
    • Ellipse.png
    • ImageBrush_SameWithDelay.png-dark
    • ImageBrush_SameWithDelay.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • ImageBrush_UniformToFill.png-dark
    • ImageBrush_UniformToFill.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ImageInStackPanel.png-dark
  • skia-windows-screenshots: 12 changed over 2188

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • FileOpenPickerTests.png-dark
    • FileOpenPickerTests.png
    • MediaPlayer.png-dark
    • MediaPlayer.png
    • ProgressRingHeightTest.png-dark
    • ProgressRingHeightTest.png
    • SwipeControlPage2.png-dark
    • SwipeControlPage2.png
    • WinUIProgressRingPage.png-dark
    • WinUIProgressRingPage.png
  • wasm: 52 changed over 1050

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Samples.RoutedEvents.RoutedEventsPage
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_Padding
    • SamplesApp.Samples.Windows_UI_Xaml_Controls.NavigationViewTests.NavigationView_BasicNavigation
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.HorizontalListViewGrouped
    • UITests.Shared.Windows_UI_Xaml_Controls.TextBoxTests.TextBox_Disabled
    • UITests.Windows_ApplicationModel.DataTransfer.DataTransferManagerTests
    • MUXControlsTestApp.NavigationViewItemTemplatePage
    • MUXControlsTestApp.NavigationViewStretchPage
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewWithinScollViewer
    • UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_With_ListViews_Count_Measure
    • UITests.Shared.Windows_UI_Xaml_Controls.TextBoxTests.TextBox_CharacterCasing
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Input.PointersTests.ScrollHandled
    • MUXControlsTestApp.NavigationViewCompactPaneLengthTestPage
    • MUXControlsTestApp.NavigationViewCustomThemeResourcesPage
    • MUXControlsTestApp.NavigationViewMenuItemStretchPage
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ColorPickerTests.WinUIColorPickerPage
    • Uno.UI.Samples.Content.UITests.CommandBar.CommandBar_Examples
    • UITests.Windows_UI_Xaml_Controls.Repeater.StackLayout_Simple
    • UITests.Microsoft_UI_Xaml_Controls.NavigationViewTests.NavigationViewBasicPage
  • wasm-automated-net7.0-UWP-Default-automated: 21 changed over 1957

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • Check_ListView_Swallows_Measure_after_scroll
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • Image_Image_Stretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • Default_UITests_Windows_UI_Xaml_DragAndDrop_DragDrop_TestPage_UITests_Windows_UI_Xaml_DragAndDrop_DragDrop_TestPage
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
    • MediaPlayerElement_Using_flv_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Flv_Extension
    • MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage
    • Pickers_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • When_Theme_Changed_No_Crash_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
  • wasm-automated-net7.0-UWP-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net7.0-UWP-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net7.0-UWP-RuntimeTests-2: 0 changed over 1

  • wasm-automated-net7.0-WinUI-Benchmarks-automated: 0 changed over 1

  • wasm-automated-net7.0-WinUI-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net7.0-WinUI-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net7.0-WinUI-RuntimeTests-2: 0 changed over 1

/// This is the property that defines the property, not the type that uses it.
/// It may also be overridden by a derived type.
/// </remarks>
public static Type GetPropertyOwnerType(DependencyProperty dependencyProperty)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the Property from all those methods, e.g. GetOwnerType here.

Comment on lines +10 to +12
/// <summary>
/// The goal of this class is to provide a set of helper methods to work with <see cref="DependencyProperty"/> from
/// external projects.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why we need this. Reflection (or even better, UnsafeAccessorAttribute) could still be used to access such implementation details without the need for a new class

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that mean it would be easier to make unintended breaking changes in Uno that would break the users? This adds a layer of indirection that could help maybe

Comment on lines +31 to +32
public static object? GetDefaultValue(DependencyProperty dependencyProperty, Type forType)
=> dependencyProperty.GetMetadata(forType)?.DefaultValue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both GetMetadata and DefaultValue are already available publicly I think?

Comment on lines +46 to +48
public static object? GetDefaultValue<T>(DependencyProperty dependencyProperty)
where T : DependencyObject
=> dependencyProperty.GetMetadata(typeof(T))?.DefaultValue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, both GetMetadata and DefaultValue are available publicly. It will be easier anyways to do the calls directly rather than using reflection or unsafe accessor

Comment on lines +65 to +66
public static object? GetDefaultValue(DependencyProperty dependencyProperty)
=> dependencyProperty.GetMetadata(dependencyProperty.OwnerType)?.DefaultValue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only part that's not publicly available here is OwnerType, which is easily accessible via reflection or unsafe accessor already.

Comment on lines +78 to +79
public static DependencyProperty? GetDependencyPropertyByName(Type ownerType, string propertyName)
=> DependencyProperty.GetProperty(ownerType, propertyName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. It's already easy to access via reflection. Actually, it will be easier to access it when it's on DependencyProperty when using unsafe accessor. Because currently unsafe accessor can't access something in a static class

@carldebilly carldebilly marked this pull request as draft April 22, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants