mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-12-16 15:19:56 +00:00
IsEnabled variable sur la main page
This commit is contained in:
parent
e6a68d4788
commit
cbea03680d
6 changed files with 52 additions and 15 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
#pragma warning disable 1591
|
#pragma warning disable 1591
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// Ce code a été généré par un outil.
|
||||||
// Runtime Version:4.0.30319.42000
|
// Version du runtime :4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
|
||||||
// the code is regenerated.
|
// le code est régénéré.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,16 @@ namespace AideDeJeu.ViewModels
|
||||||
|
|
||||||
public async Task ExecuteSearchCommandAsync(string searchText)
|
public async Task ExecuteSearchCommandAsync(string searchText)
|
||||||
{
|
{
|
||||||
Main.IsLoading = true;
|
try
|
||||||
//await Task.Run(async () => await Store.PreloadAllItemsAsync());
|
{
|
||||||
Items = await Task.Run(async () => await DeepSearchAllItemsAsync(searchText));
|
Main.IsLoading = true;
|
||||||
Main.IsLoading = false;
|
//await Task.Run(async () => await Store.PreloadAllItemsAsync());
|
||||||
|
Items = await Task.Run(async () => await DeepSearchAllItemsAsync(searchText));
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Main.IsLoading = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<SearchedItem> _Items = null;
|
public IEnumerable<SearchedItem> _Items = null;
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,20 @@ namespace AideDeJeu.ViewModels
|
||||||
public bool IsLoading
|
public bool IsLoading
|
||||||
{
|
{
|
||||||
get => _isLoading;
|
get => _isLoading;
|
||||||
set => SetProperty(ref _isLoading, value);
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _isLoading, value);
|
||||||
|
OnPropertyChanged(nameof(IsEnabled));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsEnabled
|
||||||
|
{
|
||||||
|
get => !_isLoading;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
void AddAnchor(string source, Dictionary<string, Item> anchors, Item item)
|
void AddAnchor(string source, Dictionary<string, Item> anchors, Item item)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -157,11 +157,18 @@ namespace AideDeJeu.ViewModels
|
||||||
var file = match.Groups["file"].Value;
|
var file = match.Groups["file"].Value;
|
||||||
var anchor = match.Groups["anchor"].Value;
|
var anchor = match.Groups["anchor"].Value;
|
||||||
var with = match.Groups["with"].Value;
|
var with = match.Groups["with"].Value;
|
||||||
Main.IsBusy = true;
|
Item item = null;
|
||||||
Main.IsLoading = true;
|
try
|
||||||
var item = await Task.Run(async () => await Store.GetItemFromDataAsync(file, anchor));
|
{
|
||||||
Main.IsBusy = false;
|
Main.IsBusy = true;
|
||||||
Main.IsLoading = false;
|
Main.IsLoading = true;
|
||||||
|
item = await Task.Run(async () => await Store.GetItemFromDataAsync(file, anchor));
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Main.IsBusy = false;
|
||||||
|
Main.IsLoading = false;
|
||||||
|
}
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
var items = item; // as Items;
|
var items = item; // as Items;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
|
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
|
||||||
x:Class="AideDeJeu.Views.MainTabbedPage"
|
x:Class="AideDeJeu.Views.MainTabbedPage"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
|
IsEnabled="{Binding Main.IsEnabled}"
|
||||||
android:TabbedPage.ToolbarPlacement="Bottom"
|
android:TabbedPage.ToolbarPlacement="Bottom"
|
||||||
android:TabbedPage.IsSwipePagingEnabled="False"
|
android:TabbedPage.IsSwipePagingEnabled="False"
|
||||||
android:TabbedPage.BarItemColor="{StaticResource HDMidGrey}"
|
android:TabbedPage.BarItemColor="{StaticResource HDMidGrey}"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using AideDeJeu.ViewModels;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
@ -23,9 +24,19 @@ namespace AideDeJeu.Views
|
||||||
this.NavigationPage = value;
|
this.NavigationPage = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MainViewModel Main
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return DependencyService.Get<MainViewModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public MainTabbedPage ()
|
public MainTabbedPage ()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
BindingContext = this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue