From 817af651c464ebdb0a7a57f5d9df20b1a1b85728 Mon Sep 17 00:00:00 2001 From: Macocian Alexandru Victor Date: Fri, 22 Nov 2024 20:08:09 +0100 Subject: [PATCH] View for Guild Wars Party Search (#880) Closes #877 --- .../Configuration/ProjectConfiguration.cs | 1 + Daybreak/Controls/MenuList.xaml | 7 ++++++ Daybreak/Controls/MenuList.xaml.cs | 5 ++++ Daybreak/Views/GuildWarsPartySearchView.xaml | 18 ++++++++++++++ .../Views/GuildWarsPartySearchView.xaml.cs | 24 +++++++++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 Daybreak/Views/GuildWarsPartySearchView.xaml create mode 100644 Daybreak/Views/GuildWarsPartySearchView.xaml.cs diff --git a/Daybreak/Configuration/ProjectConfiguration.cs b/Daybreak/Configuration/ProjectConfiguration.cs index bda8e621..83c2860c 100644 --- a/Daybreak/Configuration/ProjectConfiguration.cs +++ b/Daybreak/Configuration/ProjectConfiguration.cs @@ -268,6 +268,7 @@ public override void RegisterViews(IViewProducer viewProducer) viewProducer.RegisterView(); viewProducer.RegisterView(); viewProducer.RegisterView(); + viewProducer.RegisterView(); } public override void RegisterStartupActions(IStartupActionProducer startupActionProducer) diff --git a/Daybreak/Controls/MenuList.xaml b/Daybreak/Controls/MenuList.xaml index d5d2649d..ac765d78 100644 --- a/Daybreak/Controls/MenuList.xaml +++ b/Daybreak/Controls/MenuList.xaml @@ -58,6 +58,13 @@ Cursor="Hand" Clicked="CalendarButton_Clicked" ToolTip="Show current and upcoming events"/> + diff --git a/Daybreak/Controls/MenuList.xaml.cs b/Daybreak/Controls/MenuList.xaml.cs index 50a0405b..48b44a21 100644 --- a/Daybreak/Controls/MenuList.xaml.cs +++ b/Daybreak/Controls/MenuList.xaml.cs @@ -169,6 +169,11 @@ private void CalendarButton_Clicked(object sender, EventArgs e) this.viewManager.ShowView(); } + private void GuildWarsPartySearchButton_Clicked(object sender, EventArgs e) + { + this.viewManager.ShowView(); + } + private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) { this.cancellationTokenSource = new CancellationTokenSource(); diff --git a/Daybreak/Views/GuildWarsPartySearchView.xaml b/Daybreak/Views/GuildWarsPartySearchView.xaml new file mode 100644 index 00000000..80187371 --- /dev/null +++ b/Daybreak/Views/GuildWarsPartySearchView.xaml @@ -0,0 +1,18 @@ + + + + + diff --git a/Daybreak/Views/GuildWarsPartySearchView.xaml.cs b/Daybreak/Views/GuildWarsPartySearchView.xaml.cs new file mode 100644 index 00000000..8e7c2f38 --- /dev/null +++ b/Daybreak/Views/GuildWarsPartySearchView.xaml.cs @@ -0,0 +1,24 @@ +using Daybreak.Services.Menu; +using System.Core.Extensions; +using System.Windows.Controls; + +namespace Daybreak.Views; +/// +/// Interaction logic for GuildWarsPartySearchView.xaml +/// +public partial class GuildWarsPartySearchView : UserControl +{ + private readonly IMenuService menuService; + + public GuildWarsPartySearchView( + IMenuService menuService) + { + this.menuService = menuService.ThrowIfNull(); + this.InitializeComponent(); + } + + private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) + { + this.menuService.CloseMenu(); + } +}