From 6d753d1f43832ad80466a0603806dc1071714c1c Mon Sep 17 00:00:00 2001 From: Qiutong Shen Date: Tue, 16 Jun 2026 15:04:24 +0800 Subject: [PATCH] chore: align sample deps - WindowsML stable 2.1.3, AppContentSearch namespace rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - WindowsML/Directory.Packages.props: bump to stable 2.1.3 - AppContentSearch: rename Microsoft.Windows.Search.* → Microsoft.WindowsAppSDK.Search.* (namespace change in latest experimental SDK) - AppContentSearch/Directory.Packages.props: bump to latest experimental Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../AppContentSearch/cs-winui/Directory.Packages.props | 2 +- Samples/AppContentSearch/cs-winui/MainWindow.xaml.cs | 4 ++-- .../cs-winui/Utils/AttachmentProcessor.cs | 6 +++--- Samples/AppContentSearch/cs-winui/Utils/Utils.cs | 10 +++++----- .../cs-winui/ViewModels/NoteViewModel.cs | 10 +++++----- Samples/WindowsML/Directory.Packages.props | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Samples/AppContentSearch/cs-winui/Directory.Packages.props b/Samples/AppContentSearch/cs-winui/Directory.Packages.props index 55cbcb83a..0288035e0 100644 --- a/Samples/AppContentSearch/cs-winui/Directory.Packages.props +++ b/Samples/AppContentSearch/cs-winui/Directory.Packages.props @@ -5,7 +5,7 @@ - + diff --git a/Samples/AppContentSearch/cs-winui/MainWindow.xaml.cs b/Samples/AppContentSearch/cs-winui/MainWindow.xaml.cs index b71f5465f..166c2ee2a 100644 --- a/Samples/AppContentSearch/cs-winui/MainWindow.xaml.cs +++ b/Samples/AppContentSearch/cs-winui/MainWindow.xaml.cs @@ -2,7 +2,7 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; -using Microsoft.Windows.AI.Search.Experimental.AppContentIndex; +using Microsoft.Windows.Search.AppContentIndex; using Notes.Controls; using Notes.Pages; using Notes.ViewModels; @@ -98,7 +98,7 @@ private async Task InitializeAppContentIndexerAsync() GetOrCreateIndexResult? getOrCreateResult = null; await Task.Run(() => { - getOrCreateResult = Microsoft.Windows.AI.Search.Experimental.AppContentIndex.AppContentIndexer.GetOrCreateIndex("NotesIndex"); + getOrCreateResult = Microsoft.Windows.Search.AppContentIndex.AppContentIndexer.GetOrCreateIndex("NotesIndex"); if (getOrCreateResult == null) { throw new Exception("GetOrCreateIndexResult is null"); diff --git a/Samples/AppContentSearch/cs-winui/Utils/AttachmentProcessor.cs b/Samples/AppContentSearch/cs-winui/Utils/AttachmentProcessor.cs index 8507720fd..2473d5289 100644 --- a/Samples/AppContentSearch/cs-winui/Utils/AttachmentProcessor.cs +++ b/Samples/AppContentSearch/cs-winui/Utils/AttachmentProcessor.cs @@ -1,6 +1,6 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. -using Microsoft.Windows.AI.Search.Experimental.AppContentIndex; +using Microsoft.Windows.Search.AppContentIndex; using Notes.Models; using System; using System.Collections.Generic; @@ -46,7 +46,7 @@ public async static Task RemoveAttachment(Attachment attachment) { await Task.Run(() => { - MainWindow.AppContentIndexer.Remove(attachment.Id.ToString()); + MainWindow.AppContentIndexer.RemoveContentItem(attachment.Id.ToString()); }); Debug.WriteLine($"Deleted image from index: {attachment.Filename}"); } diff --git a/Samples/AppContentSearch/cs-winui/Utils/Utils.cs b/Samples/AppContentSearch/cs-winui/Utils/Utils.cs index f295a47fa..b61b74569 100644 --- a/Samples/AppContentSearch/cs-winui/Utils/Utils.cs +++ b/Samples/AppContentSearch/cs-winui/Utils/Utils.cs @@ -1,6 +1,6 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. -using Microsoft.Windows.AI.Search.Experimental.AppContentIndex; +using Microsoft.Windows.Search.AppContentIndex; using Notes.ViewModels; using System; using System.Collections.Generic; @@ -149,7 +149,7 @@ await Task.Run(() => AppManagedImageQueryMatch? imageMatch = match as AppManagedImageQueryMatch; if (imageMatch != null) { - Debug.WriteLine($"Image match: {imageMatch.ContentId}, Subregion: {imageMatch.Subregion}"); + Debug.WriteLine($"Image match: {imageMatch.ContentId}, Subregion: {imageMatch.RegionOfInterest}"); var searchResult = new SearchResult { ContentType = ContentType.Image, @@ -187,9 +187,9 @@ await Task.Run(() => // Capture bounding box if present (Subregion is IReference) try { - if (imageMatch.Subregion != null) + if (imageMatch.RegionOfInterest != null) { - var rect = imageMatch.Subregion.Value; + var rect = imageMatch.RegionOfInterest.Value; searchResult.BoundingBox = rect; } } diff --git a/Samples/AppContentSearch/cs-winui/ViewModels/NoteViewModel.cs b/Samples/AppContentSearch/cs-winui/ViewModels/NoteViewModel.cs index 4a0e4caaf..8cde2e179 100644 --- a/Samples/AppContentSearch/cs-winui/ViewModels/NoteViewModel.cs +++ b/Samples/AppContentSearch/cs-winui/ViewModels/NoteViewModel.cs @@ -1,9 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. using CommunityToolkit.Mvvm.ComponentModel; using Microsoft.UI.Dispatching; using Microsoft.UI.Xaml; -using Microsoft.Windows.AI.Search.Experimental.AppContentIndex; +using Microsoft.Windows.Search.AppContentIndex; using Notes.Models; using System; using System.Collections.ObjectModel; @@ -220,7 +220,7 @@ public async Task RemoveNoteFromIndexAsync() { await Task.Run(() => { - MainWindow.AppContentIndexer.Remove(Note.Id.ToString()); + MainWindow.AppContentIndexer.RemoveContentItem(Note.Id.ToString()); }); Debug.WriteLine($"Deleted note from index: {Note.Filename}"); } @@ -247,7 +247,7 @@ public async static Task ManualDeleteIndex() { await Task.Run(() => { - MainWindow.AppContentIndexer.RemoveAll(); + MainWindow.AppContentIndexer.RemoveAllContentItems(); }); Debug.WriteLine($"Deleted Index"); } @@ -327,7 +327,7 @@ private async Task SaveContentToFileDeleteAndReIndex() await Task.Run(() => { - MainWindow.AppContentIndexer.Remove(Note.Id.ToString()); + MainWindow.AppContentIndexer.RemoveContentItem(Note.Id.ToString()); }); Debug.WriteLine($"Deleted note {Note.Title}"); diff --git a/Samples/WindowsML/Directory.Packages.props b/Samples/WindowsML/Directory.Packages.props index db1b3d0b3..07a2e40b0 100644 --- a/Samples/WindowsML/Directory.Packages.props +++ b/Samples/WindowsML/Directory.Packages.props @@ -5,7 +5,7 @@ - +