Files

38 lines
959 B
C#

using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Windows.System;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace HarmonyWinUI.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class Dashboard : Page
{
public Dashboard()
{
InitializeComponent();
}
private void SearchBox_KeyDown(object sender, KeyRoutedEventArgs e)
{
if (e.Key == VirtualKey.Enter)
{
string searchText = SearchBox.Text;
Search(searchText);
}
}
private void Search(string searchText)
{
// Implement your search logic here
// For example, you can navigate to a search results page or filter a list of items
System.Diagnostics.Debug.WriteLine($"Searching for: {searchText}");
Frame.Navigate(typeof(Search), searchText);
}
}
}