-
Notifications
You must be signed in to change notification settings - Fork 646
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
Clean up App.xaml.cs #1628
base: main
Are you sure you want to change the base?
Clean up App.xaml.cs #1628
Conversation
/azp run |
/// executed, and as such is the logical equivalent of main() or WinMain(). | ||
/// </summary> | ||
public App() | ||
{ | ||
this.InitializeComponent(); | ||
|
||
#if WINUI_PRERELEASE |
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.
Not sure if this is related to using WinUI Gallery with (internal) builds of WASDK?
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 code I removed was UWP code that doesn't work on the WASDK.
|
||
public void EnableSound(bool withSpatial = false) | ||
{ | ||
ElementSoundPlayer.State = ElementSoundPlayerState.On; |
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.
This still works today in WinUI, right? There's a setting in Settings to turn this on/off
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 function is not being used and the setting works without it.
WinUIGallery/App.xaml.cs
Outdated
public Frame GetRootFrame() | ||
{ | ||
Frame rootFrame; | ||
NavigationRootPage rootPage = StartupWindow.Content as NavigationRootPage; | ||
var rootPage = StartupWindow.Content as NavigationRootPage; | ||
if (rootPage == null) |
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.
While we fix this, could we do this instead:
if (StaturWindow.Content is NavigationRootPage rootpage)
f2ad3b1
to
96beae3
Compare
Cleaned up the app.xaml.cs file.
Description
1.Removed UWP code from the file.
2.Added comments to the file.
3.Made the code cleaner.
4.Removed unused code.
Motivation and Context
UWP code should not be in a WinUI app.
How Has This Been Tested?
No testing needed.
Types of changes