Skip to content

Commit

Permalink
View for Guild Wars Party Search (#880)
Browse files Browse the repository at this point in the history
Closes #877
  • Loading branch information
AlexMacocian authored Nov 22, 2024
1 parent bd422a8 commit 817af65
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions Daybreak/Configuration/ProjectConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ public override void RegisterViews(IViewProducer viewProducer)
viewProducer.RegisterView<TeamBuildTemplateView>();
viewProducer.RegisterView<EventCalendarView>();
viewProducer.RegisterView<UpdateConfirmationView>();
viewProducer.RegisterView<GuildWarsPartySearchView>();
}

public override void RegisterStartupActions(IStartupActionProducer startupActionProducer)
Expand Down
7 changes: 7 additions & 0 deletions Daybreak/Controls/MenuList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
Cursor="Hand"
Clicked="CalendarButton_Clicked"
ToolTip="Show current and upcoming events"/>
<buttons:MenuButton Title="Guild Wars Party Search"
Foreground="{DynamicResource MahApps.Brushes.ThemeForeground}"
HighlightColor="{DynamicResource MahApps.Brushes.Accent}"
Height="30"
Cursor="Hand"
Clicked="GuildWarsPartySearchButton_Clicked"
ToolTip="Show party search broadcasts"/>
</local:ExpandableMenuSection.Children>
</local:ExpandableMenuSection>
<Grid>
Expand Down
5 changes: 5 additions & 0 deletions Daybreak/Controls/MenuList.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ private void CalendarButton_Clicked(object sender, EventArgs e)
this.viewManager.ShowView<EventCalendarView>();
}

private void GuildWarsPartySearchButton_Clicked(object sender, EventArgs e)
{
this.viewManager.ShowView<GuildWarsPartySearchView>();
}

private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
this.cancellationTokenSource = new CancellationTokenSource();
Expand Down
18 changes: 18 additions & 0 deletions Daybreak/Views/GuildWarsPartySearchView.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<UserControl x:Class="Daybreak.Views.GuildWarsPartySearchView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Daybreak.Views"
xmlns:controls="clr-namespace:Daybreak.Controls"
Loaded="UserControl_Loaded"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<controls:ChromiumBrowserWrapper Address="https://party.gwtoolbox.com/"
ControlsEnabled="False"
CanNavigate="True"
CanDownloadFiles="False"
CanDownloadBuild="False"/>
</Grid>
</UserControl>
24 changes: 24 additions & 0 deletions Daybreak/Views/GuildWarsPartySearchView.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Daybreak.Services.Menu;
using System.Core.Extensions;
using System.Windows.Controls;

namespace Daybreak.Views;
/// <summary>
/// Interaction logic for GuildWarsPartySearchView.xaml
/// </summary>
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();
}
}

0 comments on commit 817af65

Please sign in to comment.