mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 22:45:44 +00:00
Pré filtrage fonctionnel, reste à analyser url
This commit is contained in:
parent
4ede047c62
commit
b2dbf641f7
3 changed files with 10 additions and 4 deletions
|
|
@ -43,7 +43,7 @@ namespace AideDeJeu.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual void FilterWith(string key, string val) { }
|
||||
}
|
||||
|
||||
public enum FilterKeys
|
||||
|
|
@ -177,7 +177,7 @@ namespace AideDeJeu.ViewModels
|
|||
var ecole = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.School).SelectedKey ?? "";
|
||||
var rituel = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Ritual).SelectedKey ?? "";
|
||||
var source = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Source).SelectedKey ?? "";
|
||||
token.ThrowIfCancellationRequested();
|
||||
//token.ThrowIfCancellationRequested();
|
||||
return items.Where(item =>
|
||||
{
|
||||
var spell = item as Spell;
|
||||
|
|
@ -211,7 +211,6 @@ namespace AideDeJeu.ViewModels
|
|||
|
||||
public class VFSpellFilterViewModel : SpellFilterViewModel
|
||||
{
|
||||
|
||||
public override List<KeyValuePair<string, string>> Classes { get; } = new List<KeyValuePair<string, string>>()
|
||||
{
|
||||
new KeyValuePair<string, string>("", "Toutes" ),
|
||||
|
|
@ -323,6 +322,12 @@ namespace AideDeJeu.ViewModels
|
|||
|
||||
public class HDSpellFilterViewModel : SpellFilterViewModel
|
||||
{
|
||||
public override void FilterWith(string key, string val)
|
||||
{
|
||||
var filter = Filters.FirstOrDefault(f => f.Key.ToString().ToLower() == key.ToLower());
|
||||
filter.Index = filter.KeyValues.FindIndex(kv => kv.Value.ToLower().Contains(val.ToLower()));
|
||||
}
|
||||
|
||||
public override List<KeyValuePair<string, string>> Classes { get; } = new List<KeyValuePair<string, string>>()
|
||||
{
|
||||
new KeyValuePair<string, string>("", "Toutes" ),
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ namespace AideDeJeu.ViewModels
|
|||
var filterViewModel = items.GetNewFilterViewModel();
|
||||
var itemsViewModel = new ItemsViewModel() { AllItems = items, Filter = filterViewModel };
|
||||
itemsViewModel.LoadItemsCommand.Execute(null);
|
||||
//filterViewModel.FilterWith("class", "magicien");
|
||||
if (filterViewModel == null)
|
||||
{
|
||||
await GotoItemsPageAsync(itemsViewModel);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<ViewCell.View>
|
||||
<StackLayout Margin="10,5,10,0" Padding="0" Spacing="0">
|
||||
<Label BindingContext="{Binding}" Text="{Binding Name}" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding KeyValues, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Index}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding KeyValues, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Index, Mode=TwoWay}" />
|
||||
</StackLayout>
|
||||
</ViewCell.View>
|
||||
</ViewCell>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue