@@ -50,6 +50,24 @@ namespace winrt::CelestiaWinUI::implementation
5050 auto browserItem = item.try_as <BrowserItemTab>();
5151 if (browserItem == nullptr ) return ;
5252 BrowserItemUserControl userControl{ appCore, renderer, browserItem, false };
53+ userControl.OpenURL ([weak_this{ get_weak () }](IInspectable const &, hstring const & url)
54+ {
55+ auto strong_this{ weak_this.get () };
56+ if (strong_this == nullptr ) return ;
57+ strong_this->openURLEvent (*strong_this, url);
58+ });
59+ userControl.GetInfo ([weak_this{ get_weak () }](IInspectable const &, CelestiaWinUI::InfoGetInfoArgs const & args)
60+ {
61+ auto strong_this{ weak_this.get () };
62+ if (strong_this == nullptr ) return ;
63+ strong_this->getInfoEvent (*strong_this, args);
64+ });
65+ userControl.ShowSubsystem ([weak_this{ get_weak () }](IInspectable const &, CelestiaWinUI::InfoShowSubsystemArgs const & args)
66+ {
67+ auto strong_this{ weak_this.get () };
68+ if (strong_this == nullptr ) return ;
69+ strong_this->showSubsystemEvent (*strong_this, args);
70+ });
5371
5472 BrowserItemListContainer ().Children ().Append (userControl);
5573 BrowserItemListContainer ().SetAlignTopWithPanel (userControl, true );
@@ -252,4 +270,34 @@ namespace winrt::CelestiaWinUI::implementation
252270 }
253271 Nav ().SelectedItem (rootItems.GetAt (0 ));
254272 }
273+
274+ event_token BrowserUserControl::OpenURL (EventHandler<hstring> const & handler)
275+ {
276+ return openURLEvent.add (handler);
277+ }
278+
279+ void BrowserUserControl::OpenURL (event_token const & token) noexcept
280+ {
281+ openURLEvent.remove (token);
282+ }
283+
284+ event_token BrowserUserControl::GetInfo (EventHandler<CelestiaWinUI::InfoGetInfoArgs> const & handler)
285+ {
286+ return getInfoEvent.add (handler);
287+ }
288+
289+ void BrowserUserControl::GetInfo (event_token const & token) noexcept
290+ {
291+ getInfoEvent.remove (token);
292+ }
293+
294+ event_token BrowserUserControl::ShowSubsystem (EventHandler<CelestiaWinUI::InfoShowSubsystemArgs> const & handler)
295+ {
296+ return showSubsystemEvent.add (handler);
297+ }
298+
299+ void BrowserUserControl::ShowSubsystem (event_token const & token) noexcept
300+ {
301+ showSubsystemEvent.remove (token);
302+ }
255303}
0 commit comments