samples: sync NotesApp with latest ACI API changes#606
Draft
surajkumar-08 wants to merge 9 commits into
Draft
Conversation
- Update namespace from Microsoft.Windows.AI.Search.Experimental.AppContentIndex to Microsoft.Windows.Search.AppContentIndex - Rename Remove -> RemoveContentItem, RemoveAll -> RemoveAllContentItems - Rename Subregion -> RegionOfInterest on image query matches - Update WinAppSDK from 2.0.0-experimental3 to 2.0.0-preview1 - Add IDisposable to SearchViewModel for proper cleanup - Remove stale commented-out internal project references from csproj - Fix README: correct solution filename, update SDK version reference - Clean up Package.appxmanifest identity for public sample Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rename SearchViewModel._currentSearchCancellation (was missing '_' prefix, inconsistent with _searchText convention) - Call SearchViewModel.Dispose() via SearchView.Unloaded to release CancellationTokenSource when the control is torn down - Dispose AppContentIndexer in MainWindow.Closed handler so IClosable resources are released on window close - Replace int.Parse with int.TryParse for image match ContentId to avoid FormatException on unexpected content IDs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
@abhmondal_microsoft can you please provide your review. |
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
Arvind2311
reviewed
Apr 15, 2026
Arvind2311
reviewed
Apr 15, 2026
…icrosoft#606 - Utils.cs: Document the reflection-based access of OCR Fragment / Subregion properties as a temporary workaround for the preview SDK. Adds TODO comments so developers copying this sample know the pattern is not recommended. - SearchViewModel.cs: Replace the bare _ = RefreshQuerySessionResultsAsync() discard with a SafeRefreshQuerySessionResultsAsync helper that observes and logs exceptions, so a query session failure can no longer silently stop search from working. - SettingsPage.xaml: Restore accessibility lost when SettingsCard / SettingsExpander were replaced with Border / Expander. Add AutomationProperties.Name to the card-style Borders and the controls within, and AutomationProperties.HeadingLevel to section / sub-section headers so Narrator and other UIA clients can navigate the page by landmark and heading. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update NotesApp sample to WinAppSDK 2.0.0-preview1 ACI API surface
Namespace & API renames
Microsoft.Windows.AI.Search.Experimental.AppContentIndextoMicrosoft.Windows.Search.AppContentIndexRemove→RemoveContentItem,RemoveAll→RemoveAllContentItemsRegionOfInterest(onAppManagedImageQueryMatch) instead ofSubregion(which remains onAppManagedOcrTextQueryMatchfor OCR matches)New API usage
GetIndexCapabilitiesOfCurrentSystem()before creating an indexAppContentIndexListenerevents (IndexCapabilitiesChanged,IndexStatisticsChanged,ContentItemStatusChanged) for live index monitoringIndexStatisticsChangedeventsGetIndexStatistics()on startupResource management & robustness
AppContentIndexerinMainWindow.ClosedhandlerIDisposabletoSearchViewModel; callDispose()viaSearchView.Unloadedto releaseCancellationTokenSourceint.Parsewithint.TryParsefor image matchContentIdto avoidFormatExceptionthrow new Exceptionwiththrow new InvalidOperationExceptionCleanup
Package.appxmanifestidentity for public sampleChecklist
Note that /azp run currently isn't working for this repo.