-
Notifications
You must be signed in to change notification settings - Fork 692
Child window exception fix #2007
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -61,9 +61,8 @@ private void SetWindowProperties() | |||||||||||||||||
this.SetTitleBar(titleBar); | ||||||||||||||||||
this.AppWindow.SetIcon("Assets/Tiles/GalleryIcon.ico"); | ||||||||||||||||||
this.AppWindow.TitleBar.PreferredHeightOption = TitleBarHeightOption.Tall; | ||||||||||||||||||
|
||||||||||||||||||
Win32WindowHelper win32WindowHelper = new Win32WindowHelper(this); | ||||||||||||||||||
win32WindowHelper.SetWindowMinMaxSize(new Win32WindowHelper.POINT() { x = 640, y = 500 }); | ||||||||||||||||||
(this.AppWindow.Presenter as OverlappedPresenter).PreferredMinimumWidth = 640; | ||||||||||||||||||
(this.AppWindow.Presenter as OverlappedPresenter).PreferredMinimumHeight = 500; | ||||||||||||||||||
Comment on lines
+64
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cast to OverlappedPresenter could fail if the presenter is not of that type, potentially causing a NullReferenceException. Consider adding a null check or type check before setting the properties.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
private void OnPaneDisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args) | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,7 @@ | ||||||||||||||||||||||||||||||||||||||||||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
// Licensed under the MIT License. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
using Microsoft.UI.Windowing; | ||||||||||||||||||||||||||||||||||||||||||
using Microsoft.UI.Xaml; | ||||||||||||||||||||||||||||||||||||||||||
using Microsoft.UI.Xaml.Controls; | ||||||||||||||||||||||||||||||||||||||||||
using Microsoft.UI.Xaml.Media; | ||||||||||||||||||||||||||||||||||||||||||
|
@@ -12,7 +13,6 @@ namespace WinUIGallery.SamplePages; | |||||||||||||||||||||||||||||||||||||||||
public sealed partial class TabViewWindowingSamplePage : Page | ||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||
private const string DataIdentifier = "MyTabItem"; | ||||||||||||||||||||||||||||||||||||||||||
private Win32WindowHelper win32WindowHelper; | ||||||||||||||||||||||||||||||||||||||||||
private Window tabTearOutWindow = null; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
public TabViewWindowingSamplePage() | ||||||||||||||||||||||||||||||||||||||||||
|
@@ -24,8 +24,8 @@ public TabViewWindowingSamplePage() | |||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
public void SetupWindowMinSize(Window window) | ||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||
win32WindowHelper = new Win32WindowHelper(window); | ||||||||||||||||||||||||||||||||||||||||||
win32WindowHelper.SetWindowMinMaxSize(new Win32WindowHelper.POINT() { x = 500, y = 300 }); | ||||||||||||||||||||||||||||||||||||||||||
(window.AppWindow.Presenter as OverlappedPresenter).PreferredMinimumWidth = 640; | ||||||||||||||||||||||||||||||||||||||||||
(window.AppWindow.Presenter as OverlappedPresenter).PreferredMinimumHeight = 500; | ||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+27
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cast to OverlappedPresenter could fail if the presenter is not of that type, potentially causing a NullReferenceException. Consider adding a null check or type check before setting the properties.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback
Comment on lines
+27
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cast to OverlappedPresenter could fail if the presenter is not of that type, potentially causing a NullReferenceException. Consider adding a null check or type check before setting the properties.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
private void TabViewWindowingSamplePage_Loaded(object sender, RoutedEventArgs e) | ||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cast to OverlappedPresenter could fail if the presenter is not of that type, potentially causing a NullReferenceException. Consider adding a null check or type check before setting the properties.
Copilot uses AI. Check for mistakes.