-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
162 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<Window x:Class="PalCalc.UI.View.PassivesSearchWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:PalCalc.UI.View" | ||
xmlns:util="clr-namespace:Wpf.Util" | ||
xmlns:mvm="clr-namespace:PalCalc.UI.ViewModel.Mapped" | ||
xmlns:itl="clr-namespace:PalCalc.UI.Localization" | ||
mc:Ignorable="d" | ||
DataContext="{Binding RelativeSource={RelativeSource Self}}" | ||
Title="{itl:LocalizedText Code=LC_TRAITS_SEARCH_TITLE}" | ||
Height="450" Width="800"> | ||
<Window.Resources> | ||
<mvm:RankColorConverter x:Key="RCC" /> | ||
</Window.Resources> | ||
<DockPanel> | ||
<DockPanel DockPanel.Dock="Top" Margin="10,10"> | ||
<TextBlock DockPanel.Dock="Left" Text="{itl:LocalizedText Code=LC_TRAITS_SEARCH_SEARCH}" Margin="0,2,8,0" /> | ||
|
||
<TextBox Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" /> | ||
</DockPanel> | ||
|
||
<ListView ItemsSource="{Binding DisplayedOptions}" util:GridViewSort.AutoSort="True"> | ||
<ListView.View> | ||
<GridView> | ||
<GridView.Columns> | ||
<GridViewColumn Header="{itl:LocalizedText Code=LC_TRAITS_SEARCH_NAME}" util:GridViewSort.PropertyName="Name" Width="Auto"> | ||
<GridViewColumn.CellTemplate> | ||
<DataTemplate DataType="{x:Type mvm:PassiveSkillViewModel}"> | ||
<StackPanel Orientation="Horizontal"> | ||
<Border Background="Black" | ||
CornerRadius="99" | ||
Padding="2" | ||
BorderThickness="0" | ||
Margin="0,0,8,0" | ||
VerticalAlignment="Center" | ||
> | ||
<Rectangle Width="15" | ||
Height="15" | ||
Fill="{Binding Rank, Converter={StaticResource RCC}}"> | ||
<Rectangle.OpacityMask> | ||
<ImageBrush ImageSource="{Binding RankIcon}" /> | ||
</Rectangle.OpacityMask> | ||
</Rectangle> | ||
</Border> | ||
|
||
<TextBlock Text="{Binding Name.Value}" VerticalAlignment="Center" /> | ||
</StackPanel> | ||
</DataTemplate> | ||
</GridViewColumn.CellTemplate> | ||
</GridViewColumn> | ||
|
||
<GridViewColumn Header="{itl:LocalizedText Code=LC_TRAITS_SEARCH_DESCRIPTION}" | ||
Width="500" | ||
util:GridViewSort.PropertyName="Description" | ||
> | ||
<GridViewColumn.CellTemplate> | ||
<DataTemplate DataType="{x:Type mvm:PassiveSkillViewModel}"> | ||
<TextBlock Text="{Binding Description.Value}" TextWrapping="Wrap" /> | ||
</DataTemplate> | ||
</GridViewColumn.CellTemplate> | ||
</GridViewColumn> | ||
</GridView.Columns> | ||
</GridView> | ||
</ListView.View> | ||
</ListView> | ||
</DockPanel> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using PalCalc.UI.ViewModel.Mapped; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace PalCalc.UI.View | ||
{ | ||
[ObservableObject] | ||
public partial class PassivesSearchWindow : Window | ||
{ | ||
[NotifyPropertyChangedFor(nameof(DisplayedOptions))] | ||
[ObservableProperty] | ||
private string searchText; | ||
|
||
public List<PassiveSkillViewModel> DisplayedOptions => | ||
PassiveSkillViewModel.All.Where(p => | ||
string.IsNullOrEmpty(SearchText) || | ||
p.Name.Value.Contains(SearchText, StringComparison.OrdinalIgnoreCase) || | ||
p.Description.Value.Contains(SearchText, StringComparison.OrdinalIgnoreCase) | ||
).ToList(); | ||
|
||
public PassivesSearchWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters