- add: filter implementation

This commit is contained in:
2025-03-14 19:42:55 +03:00
parent 7e1e7bb9ad
commit 2d71cf8f38
3 changed files with 65 additions and 4 deletions

View File

@@ -34,6 +34,28 @@
Padding="0" />
</StackPanel>
</ScrollViewer>
<Border Grid.Row="0"
Background="{StaticResource DefaultGrad}"
Margin="0,0,0,0" CornerRadius="20,20,0,0"
VerticalAlignment="Bottom"
IsVisible="{Binding IsFilterVisible}">
<StackPanel Orientation="Vertical" Spacing="2" Margin="15">
<StackPanel Orientation="Horizontal" Spacing="15">
<TextBlock Text="Roleplay:" VerticalAlignment="Center" Margin="0,0,15,0"/>
<CheckBox Click="Button_OnClick" Name="rp_none"><TextBlock Text="NonRP"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="rp_low"><TextBlock Text="LowRP"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="rp_med"><TextBlock Text="MediumRP"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="rp_high"><TextBlock Text="HardRP"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="ERPYes"><TextBlock Text="18+"/></CheckBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="15">
<TextBlock Text="Language:" VerticalAlignment="Center" Margin="0,0,4,0"/>
<CheckBox Click="Button_OnClick" Name="lang_ru"><TextBlock Text="RU"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="lang_en"><TextBlock Text="EN"/></CheckBox>
</StackPanel>
</StackPanel>
</Border>
<Border
Background="{StaticResource DefaultGrad}"

View File

@@ -1,4 +1,7 @@
using System;
using System.Collections.Generic;
using Avalonia.Controls;
using Avalonia.Interactivity;
using ServerListViewModel = Nebula.Launcher.ViewModels.Pages.ServerListViewModel;
namespace Nebula.Launcher.Views.Pages;
@@ -23,4 +26,11 @@ public partial class ServerListView : UserControl
var context = (ServerListViewModel?)DataContext;
context?.OnSearchChange?.Invoke();
}
private void Button_OnClick(object? sender, RoutedEventArgs e)
{
var send = sender as CheckBox;
var context = (ServerListViewModel?)DataContext;
context?.OnFilterChanged(send.Name, send.IsChecked.Value);
}
}