Skip to content

Commit 83a0f0c

Browse files
authored
Update FindOnPage.md
1 parent 121afee commit 83a0f0c

1 file changed

Lines changed: 0 additions & 50 deletions

File tree

FindOnPage.md

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -549,56 +549,6 @@ namespace Microsoft.Web.WebView2.Core
549549
}
550550
```
551551

552-
### Handling Find Operation Events
553-
554-
```csharp
555-
namespace Microsoft.Web.WebView2.Core
556-
{
557-
558-
public interface ICoreWebView2FindMatchCountChangedEventHandler
559-
{
560-
void OnMatchCountChanged(ICoreWebView2Find sender, int newCount);
561-
}
562-
563-
public interface ICoreWebView2FindActiveMatchIndexChangedEventHandler
564-
{
565-
void OnActiveMatchIndexChanged(ICoreWebView2Find sender, int newIndex);
566-
}
567-
568-
public interface ICoreWebView2FindOperationCompletedHandler
569-
{
570-
void OnFindOperationCompleted(ICoreWebView2Find sender, bool isSuccess);
571-
}
572-
573-
// Subscribing to events:
574-
public class FindEventSubscriber
575-
{
576-
public void SubscribeToFindEvents(ICoreWebView2Find webViewFind)
577-
{
578-
webViewFind.MatchCountChanged += OnMatchCountChanged;
579-
webViewFind.ActiveMatchIndexChanged += OnActiveMatchIndexChanged;
580-
webViewFind.FindOperationCompleted += OnFindOperationCompleted;
581-
}
582-
583-
private void OnMatchCountChanged(ICoreWebView2Find sender, int newCount)
584-
{
585-
Console.WriteLine($"Match count changed. New count: {newCount}");
586-
}
587-
588-
private void OnActiveMatchIndexChanged(ICoreWebView2Find sender, int newIndex)
589-
{
590-
Console.WriteLine($"Active match index changed. New index: {newIndex}");
591-
}
592-
593-
private void OnFindOperationCompleted(ICoreWebView2Find sender, bool isSuccess)
594-
{
595-
var status = isSuccess ? "completed successfully" : "failed";
596-
Console.WriteLine($"Find operation {status}.");
597-
}
598-
}
599-
}
600-
```
601-
602552
These examples demonstrate how you might conceptualize and implement a Find API within the Microsoft WebView2 environment, focusing on async patterns for responsive UI interactions and event handling for dynamic UI updates based on the results of find operations. This design emphasizes asynchronous task-based APIs, event handling for UI updates, and modular API design for clear separation of concerns.
603553

604554
# Appendix

0 commit comments

Comments
 (0)