Skip to content

Commit 7ef5977

Browse files
committed
feat(WinUI): Better TitleBar
1 parent 52204a5 commit 7ef5977

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

org.nickvision.application.winui/Controls/TitleBar.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ namespace Nickvision.Application.WinUI.Controls
1313
Boolean IsActivated;
1414
Microsoft.UI.Xaml.Visibility SearchVisibility;
1515
Microsoft.UI.Windowing.AppWindow AppWindow;
16-
event Windows.Foundation.EventHandler<String> SearchChanged;
16+
event Windows.Foundation.TypedEventHandler<Microsoft.UI.Xaml.Controls.AutoSuggestBox, Microsoft.UI.Xaml.Controls.AutoSuggestBoxTextChangedEventArgs> SearchChanged;
1717
}
1818
}

org.nickvision.application.winui/Controls/TitleBar.xaml.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ namespace winrt::Nickvision::Application::WinUI::Controls::implementation
162162
SetDragRegion();
163163
}
164164

165-
winrt::event_token TitleBar::SearchChanged(const Windows::Foundation::EventHandler<winrt::hstring>& handler)
165+
winrt::event_token TitleBar::SearchChanged(const Windows::Foundation::TypedEventHandler<AutoSuggestBox, AutoSuggestBoxTextChangedEventArgs>& handler)
166166
{
167167
return m_searchChangedEvent.add(handler);
168168
}
@@ -220,7 +220,7 @@ namespace winrt::Nickvision::Application::WinUI::Controls::implementation
220220

221221
void TitleBar::OnSearchTextChanged(const AutoSuggestBox& sender, const AutoSuggestBoxTextChangedEventArgs& args)
222222
{
223-
m_searchChangedEvent(*this, sender.Text());
223+
m_searchChangedEvent(sender, args);
224224
}
225225

226226
void TitleBar::SetDragRegion()

org.nickvision.application.winui/Controls/TitleBar.xaml.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ namespace winrt::Nickvision::Application::WinUI::Controls::implementation
9696
* @brief Subscribes a handler to the search changed event.
9797
* @return The token for the newly subscribed handler.
9898
*/
99-
winrt::event_token SearchChanged(const Windows::Foundation::EventHandler<winrt::hstring>& handler);
99+
winrt::event_token SearchChanged(const Windows::Foundation::TypedEventHandler<Microsoft::UI::Xaml::Controls::AutoSuggestBox, Microsoft::UI::Xaml::Controls::AutoSuggestBoxTextChangedEventArgs>& handler);
100100
/**
101101
* @brief Unsubscribes a handler from the search changed event.
102102
* @param token The token of the handler to unsubscribe.
@@ -149,7 +149,7 @@ namespace winrt::Nickvision::Application::WinUI::Controls::implementation
149149
Microsoft::UI::Windowing::AppWindow m_appWindow;
150150
bool m_loaded;
151151
bool m_isActivated;
152-
winrt::event<Windows::Foundation::EventHandler<winrt::hstring>> m_searchChangedEvent;
152+
winrt::event<Windows::Foundation::TypedEventHandler<Microsoft::UI::Xaml::Controls::AutoSuggestBox, Microsoft::UI::Xaml::Controls::AutoSuggestBoxTextChangedEventArgs>> m_searchChangedEvent;
153153
winrt::event<Microsoft::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChangedEvent;
154154
};
155155
}

resources/po/application.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-06-21 09:56-0400\n"
11+
"POT-Creation-Date: 2025-06-21 10:04-0400\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"

0 commit comments

Comments
 (0)