Skip to content

fix!: Remove OnWindowCreated from WinUI tree - #12594

Merged
MartinZikmund merged 7 commits into
feature/5xfrom
dev/mazi/remove-onwindowcreated
Jun 20, 2023
Merged

MartinZikmund merged 7 commits into
feature/5xfrom
dev/mazi/remove-onwindowcreated

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Jun 9, 2023 •

Copy link
Copy Markdown
Member

GitHub Issue (If applicable): closes #

Replaces #12196

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

Copilot Summary

🤖 Generated by Copilot at 034838f

This pull request refactors the Window and Application classes to support the WinAppSDK platform and avoid code duplication. It separates the platform-specific logic for UWP and WinAppSDK using partial classes and conditional compilation symbols. It also removes or excludes some code that is no longer needed or relevant for the WinAppSDK platform.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/remove-onwindowcreated branch from 43c976f to 034838f Compare June 16, 2023 13:12
@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Jun 17, 2023
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 83049 found UI Test snapshots differences: android-28-net7: 0, android-28-net7-Snap: 66, ios: 35, ios-Snap: 80, skia-gtk-screenshots: 18, skia-wpf-screenshots: 12, wasm: 35, wasm-automated-net7.0-UWP-Benchmarks: 0, wasm-automated-net7.0-UWP-Default: 36, wasm-automated-net7.0-UWP-RuntimeTests: 0, wasm-automated-net7.0-WinUI-RuntimeTests: 0

Details
  • android-28-net7: 0 changed over 1

  • android-28-net7-Snap: 66 changed over 1036

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats
    • Grid_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_DynamicRowColumn_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_DynamicRowColumn
    • Grid_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_in_Canvas_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_in_Canvas
    • Grid_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_Margin_And_Padding_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_Margin_And_Padding
    • Scrolling_UITests_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_Add_Remove_UITests_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_Add_Remove
    • 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
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_FromStream_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_FromStream
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressBar_WinUIProgressBarSimple_UITests_Microsoft_UI_Xaml_Controls_ProgressBar_WinUIProgressBarSimple
    • Brushes_UITests_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_Formats_UITests_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_Formats
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize
    • ListView_ListView_Infinite_Breadth_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_Infinite_Breadth
    • PagerControl_UITests_Microsoft_UI_Xaml_Controls_PagerControlTests_PagerControlPage_UITests_Microsoft_UI_Xaml_Controls_PagerControlTests_PagerControlPage
    • PullToRefresh_UITests_Microsoft_UI_Xaml_Controls_RefreshContainerTests_RefreshContainerScrollTop_UITests_Microsoft_UI_Xaml_Controls_RefreshContainerTests_RefreshContainerScrollTop
    • SwipeControl_MUXControlsTestApp_SwipeControlPage2_MUXControlsTestApp_SwipeControlPage2
    • Transform_Basics_UITests_Shared_Windows_UI_Xaml_Media_Transform_Basics
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
    • Automation_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name
    • Gesture_Recognizer_UITests_Windows_UI_Input_GestureRecognizerTests_Manipulation_WithNestedElement_UITests_Windows_UI_Input_GestureRecognizerTests_Manipulation_WithNestedElement
    • GridView_Uno_UI_Samples_Content_UITests_GridView_GridView_Inside_ScrollViewer_Uno_UI_Samples_Content_UITests_GridView_GridView_Inside_ScrollViewer
  • ios: 35 changed over 270

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • ListView_ObservableCollection_Creation_Count_Added
    • Flyout_ShowAt_Window_Content_UITests_Windows_UI_Xaml_Controls_FlyoutTests_Flyout_ShowAt_Window_Content
    • ListView_ChangingText_Validation_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Changing_Text
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-1
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-2
    • FocusManager_FocusDirection_Down_Validation_Uno_UI_Samples_Content_UITests_FocusTests_FocusManager_FocusDirection
    • Keyboard_Textbox_NoScrollViewer_Validation_1_-_Remove_Focus_on_filledTextBox
    • ListView_SelectedItem_Both_Selection_Changed
    • ListView_ObservableCollection_Creation_Count_Added_above
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • TextBox_Readonly_Uno_UI_Samples_UITests_TextBoxControl_TextBox_IsReadOnly
    • Keyboard_Textbox_NoScrollViewer_Validation_0_-_Remove_Focus_on_normalTextBox
    • ListView_ObservableCollection_Creation_Count_Scrolled2
    • ListView_SelectedItem_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_SelectedItem
    • ContentPresenter_Template_Uno_UI_Samples_Content_UITests_ContentPresenter_ContentPresenter_Template
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • TextBox_RoundedCorners_UITests_Shared_Windows_UI_Xaml_Controls_TextBoxTests_TextBox_RoundedCorners
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ListView_ObservableCollection_Creation_Count_Scrolled1
  • ios-Snap: 80 changed over 1027

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AutoSuggestBox_UITests_Windows_UI_Xaml_Controls_AutoSuggestBoxTests_AutoSuggestBox_Description_UITests_Windows_UI_Xaml_Controls_AutoSuggestBoxTests_AutoSuggestBox_Description
    • Border_NonUniformThicknessandRadius_Uno_UI_Samples_UITests_BorderTestsControl_NonUniformThicknessandRadius
    • Buttons_Custom_Button_With_ContentTemplate_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Custom_Button_With_ContentTemplate
    • Brushes_UITests_Windows_UI_Xaml_Media_GradientBrushTests_LinearGradientBrush_Change_Stops_UITests_Windows_UI_Xaml_Media_GradientBrushTests_LinearGradientBrush_Change_Stops
    • ComboBox_ComboBox_ItemsSource_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ComboBox_ComboBox_ItemsSource
    • ComboBox_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_DropDownPlacement_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_DropDownPlacement
    • ComboBox_ComboBox_NativePopup_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ComboBox_ComboBox_NativePopup
    • Default_UITests_Toolkit_ElevatedView_CornerRadius_UITests_Toolkit_ElevatedView_CornerRadius
    • Gesture_Recognizer_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_TransformationsHoverSibling_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_TransformationsHoverSibling
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats
    • LoopingSelector_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Items_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Items
    • Path_StretchUniformAutoSize_SamplesApp_Windows_UI_Xaml_Shapes_PathTestsControl_StretchUniformAutoSize
    • NumberBox_UITests_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBox_Header_UITests_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBox_Header
    • Path_Path_With_DashStrokeArray_SamplesApp_Windows_UI_Xaml_Shapes_PathTestsControl_Path_With_DashStrokeArray
    • PullToRefresh_UITests_Microsoft_UI_Xaml_Controls_RefreshContainerTests_RefreshContainerNavigation_UITests_Microsoft_UI_Xaml_Controls_RefreshContainerTests_RefreshContainerNavigation
    • TextBox_Input_Multiline_AutoHeight_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_Multiline_AutoHeight
    • UIElement_TransformToVisual_Transform_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_Transform
    • AutoSuggestBox_UITests_Windows_UI_Xaml_Controls_AutoSuggestBoxTests_AutoSuggestBox_Icons_UITests_Windows_UI_Xaml_Controls_AutoSuggestBoxTests_AutoSuggestBox_Icons
    • ComboBox_ComboBox_ItemDataContext_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_ItemDataContext
    • Grid_Grid_Auto_Center_Cell_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_Auto_Center_Cell
  • skia-gtk-screenshots: 18 changed over 1105

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Progress-ProgressRingHeightTest.png
    • Progress-WindowsProgressRing_GH1220.png
    • MUX-TabViewPage.png
    • Brushes-BorderImageBrush.png
    • ListView-ListViewSelectedItems.png
    • MUX-WinUIProgressRingPage.png
    • MUX-WinUIProgressRing_CustomSources.png
    • Progress-WinUIProgressRing_Features.png
    • Progress-WinUIProgressRingPage.png
    • Progress-WinUIProgressRing_CustomSources.png
    • MUX-NavigationViewRS4Page.png
    • PipsPager-PipsPagerExamples.png
    • Automation-AutomationProperties_Name.png
    • Brushes-ImageBrushChangingCornerRadius.png
    • Image-Image_Stretch.png
    • Pickers-CalendarView_Theming.png
    • WinUI-PipsPagerExamples.png
    • Transform-TransformToVisual_Translate2d.png
  • skia-wpf-screenshots: 12 changed over 1105

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MUX-WinUIProgressRingPage.png
    • MUX-WinUIProgressRing_CustomSources.png
    • Pickers-CalendarView_Theming.png
    • Progress-WinUIProgressRing_Features.png
    • Progress-ProgressRingHeightTest.png
    • Progress-WindowsProgressRing_GH1220.png
    • Transform-TransformToVisual_Translate2d.png
    • PipsPager-PipsPagerExamples.png
    • Progress-WinUIProgressRingPage.png
    • Progress-WinUIProgressRing_CustomSources.png
    • Automation-AutomationProperties_Name.png
    • WinUI-PipsPagerExamples.png
  • wasm: 35 changed over 1033

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Uno_Web.Http.CookieManagerTests
    • MUXControlsTestApp.PipsPagerExamples
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewHeaderImage
    • UITests.Microsoft_UI_Xaml_Controls.NavigationViewTests.NavigationViewBasicPage
    • UITests.Shared.Windows_Devices.Midi.MidiDeviceEnumerationTests
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRing_CustomSources
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRing_Features
    • SamplesApp.Samples.Windows_UI_Xaml_Controls.NavigationViewTests.NavigationView_BasicNavigation
    • MUXControlsTestApp.NavigationViewMenuItemStretchPage
    • MUXControlsTestApp.PaneLayoutTestPage
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.ProgressRingHeightTest
    • UITests.Windows_UI_Xaml_Controls.ProgressRing.WindowsProgressRing_GH1220
    • SamplesApp.Samples.Microsoft_UI_Xaml_Controls.NavigationViewTests.FluentStyle.FluentStyle_NavigationViewSample
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • initial_state
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Stretch_Fill
    • UITests.Windows_UI_ViewManagement.ApplicationViewSizing
    • MUXControlsTestApp.NavigationViewRS4Page
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
  • wasm-automated-net7.0-UWP-Benchmarks: 0 changed over 1

  • wasm-automated-net7.0-UWP-Default: 36 changed over 1915

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ListView_Weird_Measure_During_Arrange_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_Weird_Measure
    • Brushes_Uno_UI_Samples_UITests_ImageBrushTestControl_Ellipse_Uno_UI_Samples_UITests_ImageBrushTestControl_Ellipse
    • 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
    • ColorPicker_WinUIColorPickerPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ColorPickerTests_WinUIColorPickerPage
    • Automation_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name
    • MediaPlayerElement_Using_mov_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mov_Extension
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_CustomSources_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_CustomSources
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
    • 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
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • MediaPlayerElement_Using_avi_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Avi_Extension
    • MediaPlayerElement_Using_flv_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Flv_Extension
    • SubMenuTest_UITests_Shared_Microsoft_UI_Xaml_Controls_RadioMenuFlyoutItemTests_RadioMenuFlyoutItemPage
    • SwipeControl_MUXControlsTestApp_SwipeControlPage2_MUXControlsTestApp_SwipeControlPage2
    • LoopingSelector_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Short_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Short
  • wasm-automated-net7.0-UWP-RuntimeTests: 0 changed over 1

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

Comment thread src/Uno.UI/UI/Xaml/Window.WinAppSdk.cs Resolved
Comment thread src/Uno.UI/UI/Xaml/Window.Uwp.cs Resolved
@MartinZikmund
MartinZikmund merged commit 850f542 into feature/5x Jun 20, 2023
@MartinZikmund
MartinZikmund deleted the dev/mazi/remove-onwindowcreated branch June 20, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants