mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-06 09:16:25 +08:00
@@ -192,8 +192,9 @@ public partial class ScreenSimulationPageViewModel : ObservableObject
|
||||
private string _keyWord = string.Empty;
|
||||
private string _station = string.Empty;
|
||||
private string _type = string.Empty;
|
||||
public List<string> StyleStations { get; private set; } = [.. StylesInfoDataSource.Instance.StylesInfo.Select(x=>x.Station).Distinct()];
|
||||
public List<string> StyleTypes { get; private set; } = [.. StylesInfoDataSource.Instance.StylesInfo.Select(x => x.Type).Distinct()];
|
||||
public List<string> StyleStations { get; private set; } = [.. new[] { "全部" }.Concat(StylesInfoDataSource.Instance.StylesInfo.Select(x => x.Station).Distinct())];
|
||||
public List<string> StyleTypes { get; private set; } = [.. new[] { "全部" }.Concat(StylesInfoDataSource.Instance.StylesInfo.Select(x => x.Type).Distinct())];
|
||||
|
||||
[RelayCommand]
|
||||
public void TextSearch(object s)
|
||||
{
|
||||
@@ -223,7 +224,7 @@ public partial class ScreenSimulationPageViewModel : ObservableObject
|
||||
}
|
||||
private void Search()
|
||||
{
|
||||
StyleCards = [.. StylesInfoDataSource.Instance.StylesInfo.Where(x =>(x.Station==_station||_station==string.Empty) && (x.Type==_type||_type==string.Empty) && x.Title.Contains(_keyWord))];
|
||||
StyleCards = [.. StylesInfoDataSource.Instance.StylesInfo.Where(x =>(x.Station==_station||_station==string.Empty||_station=="全部") && (x.Type==_type||_type==string.Empty||_type=="全部") && x.Title.Contains(_keyWord))];
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<TextBlock Opacity="0.7" VerticalAlignment="Center" FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
Text="" FontSize="12" Margin="0,0,8,0"/>
|
||||
<TextBlock Opacity="0.7" Style="{StaticResource BodyTextBlockStyle}" Text="车站:" VerticalAlignment="Center" Margin="0,0,8,0"/>
|
||||
<ComboBox MinWidth="128" ItemsSource="{Binding ViewModel.StyleStations}" x:Name="FilterStationComboBox" Margin="0,0,24,0">
|
||||
<ComboBox MinWidth="128" ItemsSource="{Binding ViewModel.StyleStations}" x:Name="FilterStationComboBox" Margin="0,0,24,0" SelectedIndex="0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<i:InvokeCommandAction Command="{Binding ViewModel.StationSearchCommand}"
|
||||
@@ -95,7 +95,7 @@
|
||||
<TextBlock Opacity="0.7" VerticalAlignment="Center" FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
Text="" FontSize="12" Margin="0,0,8,0"/>
|
||||
<TextBlock Opacity="0.7" Style="{StaticResource BodyTextBlockStyle}" Text="类别:" VerticalAlignment="Center" Margin="0,0,8,0"/>
|
||||
<ComboBox MinWidth="128" ItemsSource="{Binding ViewModel.StyleTypes}" x:Name="FilterTypeComboBox">
|
||||
<ComboBox MinWidth="128" ItemsSource="{Binding ViewModel.StyleTypes}" x:Name="FilterTypeComboBox" SelectedIndex="0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<i:InvokeCommandAction Command="{Binding ViewModel.TypeSearchCommand}"
|
||||
|
||||
Reference in New Issue
Block a user