@@ -163,7 +163,7 @@ async Task ConfigureAndExecuteFindWithDefaultUIAsync(string findTerm)
163
163
// you can change the SuppressDefaultDialog and ShouldHighlightAllMatches properties here.
164
164
165
165
// Start the find operation with the specified configuration.
166
- await webView.CoreWebView2.FindController .StartFindAsync(findConfiguration);
166
+ await webView.CoreWebView2.Find .StartFindAsync(findConfiguration);
167
167
168
168
// End user interaction is handled via UI.
169
169
}
@@ -198,11 +198,11 @@ async Task ConfigureAndExecuteFindWithCustomUIAsync(string findTerm)
198
198
};
199
199
200
200
// Specify that a custom UI will be used for the find operation.
201
- webView .CoreWebView2 .FindController .SuppressDefaultDialog = true ;
202
- webView .CoreWebView2 .FindController .ShouldHighlightAllMatches = true ;
201
+ webView .CoreWebView2 .Find .SuppressDefaultDialog = true ;
202
+ webView .CoreWebView2 .Find .ShouldHighlightAllMatches = true ;
203
203
204
204
// Start the find operation with the specified configuration.
205
- await webView .CoreWebView2 .FindController .StartFindAsync (findConfiguration );
205
+ await webView .CoreWebView2 .Find .StartFindAsync (findConfiguration );
206
206
// It's expected that the custom UI for navigating between matches (next, previous)
207
207
// and stopping the find operation will be managed by the developer's custom code.
208
208
}
@@ -259,17 +259,17 @@ within a WebView2 control using the `GetActiveMatchIndex` method.
259
259
//! [GetActiveMatchIndex]
260
260
public async Task<int> GetActiveMatchIndexAsync()
261
261
{
262
- var webViewFind = webView.CoreWebView2.FindController ; // Assuming webView is your WebView2 control
262
+ var webViewFind = webView.CoreWebView2.Find ; // Assuming webView is your WebView2 control
263
263
var activeMatchIndex = webViewFind.ActiveMatchIndex();
264
264
MessageBox.Show($"Active Match Index: {activeMatchIndex}", "Find Operation", MessageBoxButton.OK);
265
265
return activeMatchIndex;
266
266
}
267
267
268
268
void ActiveMatchIndexChangedSample()
269
269
{
270
- webView.CoreWebView2.FindController .ActiveMatchIndexChanged += (object sender, EventArgs args) =>
270
+ webView.CoreWebView2.Find .ActiveMatchIndexChanged += (object sender, EventArgs args) =>
271
271
{
272
- int activeMatchIndex = webView.CoreWebView2.FindController .ActiveMatchIndex;
272
+ int activeMatchIndex = webView.CoreWebView2.Find .ActiveMatchIndex;
273
273
// Update Custom UI based on the new active match index.
274
274
};
275
275
}
0 commit comments