-
Notifications
You must be signed in to change notification settings - Fork 320
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
Display packages from restore device #74
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
tools/SetupFlow/DevHome.SetupFlow.AppManagement/ViewModels/PackageViewModel.cs
Outdated
Show resolved
Hide resolved
tools/SetupFlow/DevHome.SetupFlow.AppManagement/ViewModels/PackageViewModel.cs
Show resolved
Hide resolved
tools/SetupFlow/DevHome.SetupFlow.AppManagement/ViewModels/PackageViewModel.cs
Show resolved
Hide resolved
tools/SetupFlow/DevHome.SetupFlow.AppManagement/Services/WinGetPackageDataSource.cs
Outdated
Show resolved
Hide resolved
tools/SetupFlow/DevHome.SetupFlow.AppManagement/Services/WinGetPackageDataSource.cs
Outdated
Show resolved
Hide resolved
tools/SetupFlow/DevHome.SetupFlow.AppManagement/ViewModels/PackageCatalogListViewModel.cs
Show resolved
Hide resolved
tools/SetupFlow/DevHome.SetupFlow.AppManagement/ViewModels/PackageViewModel.cs
Show resolved
Hide resolved
tools/SetupFlow/DevHome.SetupFlow.AppManagement/Views/AppManagementReviewView.xaml
Outdated
Show resolved
Hide resolved
tools/SetupFlow/DevHome.SetupFlow.AppManagement/Views/AppManagementView.xaml
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
// If theme is Default, use the Application.RequestedTheme value | ||
// https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.elementtheme?view=windows-app-sdk-1.2#fields | ||
return Theme == ElementTheme.Dark || | ||
(Theme == ElementTheme.Default && Application.Current.RequestedTheme == ApplicationTheme.Dark); |
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.
I think you want ActualTheme? what the app requested at launch might not be relevant (e.g. if the user changed the theme once the app was already running)
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.
I tried locally to change the theme while the application is still running. The value of get RequestedTheme
reflects the current system theme set by the user:
Example of switching the system them while the app is still running: Dark > Light > Dark
I used the suggested behavior from the ElementTheme, but let me know if I should try something else. ActualTheme
is not available at the app level, but I can possibly extract it from the MainWindow root element, however ActualTheme
is of type ElementTheme
with values Default/Dark/Light, hence I would still need a method to resolve Default
.
tools/SetupFlow/DevHome.SetupFlow.AppManagement/Models/WinGetPackage.cs
Outdated
Show resolved
Hide resolved
Func<T, string> packageIdFunc, | ||
Func<IWinGetPackage, T, Task> packageProcessorFunc = 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.
these are starting to be a little unwieldly... can these become delegates?
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.
also, is this an internal api or is this something extensions might interact with?
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.
Updated to use delegates 👍
This is internal and specific for loading packages from JSON and restore API. I don't expect other extensions or projects to depend on it
|
||
// Connect to composite catalog used for searching on a separate | ||
// (non-UI) thread to prevent lagging the UI. | ||
await Task.Run(async () => await _wpm.AllCatalogs.ConnectAsync()); |
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.
does the page navigation need to wait for these to complete, or can it be more "fire-and-forget" / show a shimmer animation or progress ring while this is happens (how long does it normally take?)
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.
Displaying shimmers happens in the line above. The events sequence on page navigation is:
- Display shimmers
- Connect to WinGet catalog
- Load packages to display and remove shimmers
- Connect to
AllCatalogs
composite catalog (this is for enabling the search experience)
how long does it normally take?
Connecting to a catalog takes a couple seconds, but that specific operation should not block the UI.
tools/SetupFlow/DevHome.SetupFlow.AppManagement/Services/WinGetPackageRestoreDataSource.cs
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
🚀 What was done?
🧪 Test