mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-30 15:06:06 +00:00
Test IsBusy
This commit is contained in:
parent
b242a90c17
commit
649c1acd14
7 changed files with 22 additions and 13 deletions
|
|
@ -102,8 +102,6 @@ namespace AideDeJeu.ViewModels
|
|||
|
||||
async Task LoadItemsAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
IsBusy = true;
|
||||
Main.IsLoading = true;
|
||||
try
|
||||
{
|
||||
if (Filter != null)
|
||||
|
|
@ -120,11 +118,6 @@ namespace AideDeJeu.ViewModels
|
|||
{
|
||||
Debug.WriteLine(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Main.IsLoading = false;
|
||||
IsBusy = false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ExecuteLoadItemsCommandAsync()
|
||||
|
|
|
|||
|
|
@ -71,7 +71,11 @@ namespace AideDeJeu.ViewModels
|
|||
var file = match.Groups["file"].Value;
|
||||
var anchor = match.Groups["anchor"].Value;
|
||||
var with = match.Groups["with"].Value;
|
||||
Main.IsBusy = true;
|
||||
Main.IsLoading = true;
|
||||
var item = await Main.GetItemFromDataAsync(file);
|
||||
Main.IsBusy = false;
|
||||
Main.IsLoading = false;
|
||||
if (item != null)
|
||||
{
|
||||
if (item is Items)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
xmlns:tools="clr-namespace:AideDeJeu.Tools"
|
||||
x:Class="AideDeJeu.Views.FilteredItemsPage"
|
||||
x:Name="This"
|
||||
Title="{Binding Title}">
|
||||
Title="{Binding Title}"
|
||||
IsBusy="{Binding Main.IsLoading}">
|
||||
<MasterDetailPage.ToolbarItems>
|
||||
<ToolbarItem Name="About" Text="À propos de..." Order="Secondary" Icon="wooden_sign.png" Command="{Binding Main.AboutCommand}" />
|
||||
</MasterDetailPage.ToolbarItems>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
xmlns:mdview="clr-namespace:Xam.Forms.Markdown"
|
||||
x:Class="AideDeJeu.Views.ItemDetailPage"
|
||||
Title="{Binding Title}"
|
||||
x:Name="This">
|
||||
x:Name="This"
|
||||
IsBusy="{Binding BindingContext.Main.IsLoading, Source={x:Reference This}}">
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
<tools:MonsterMarkdownTheme x:Key="MonsterMarkdownTheme" />
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
xmlns:mdview="clr-namespace:Xam.Forms.Markdown"
|
||||
x:Class="AideDeJeu.Views.ItemsPage"
|
||||
x:Name="This"
|
||||
Title="{Binding Title}">
|
||||
Title="{Binding Title}"
|
||||
IsBusy="{Binding Main.IsLoading}">
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
<tools:MonsterMarkdownTheme x:Key="MonsterMarkdownTheme" />
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<NavigationPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="AideDeJeu.Views.MainNavigationPage" IsBusy="{Binding Main.IsLoading}">
|
||||
x:Class="AideDeJeu.Views.MainNavigationPage" IsBusy="{Binding BindingContext.Main.IsLoading}">
|
||||
</NavigationPage>
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using AideDeJeu.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
|
@ -12,7 +13,15 @@ namespace AideDeJeu.Views
|
|||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class MainNavigationPage : NavigationPage
|
||||
{
|
||||
public MainNavigationPage ()
|
||||
public MainViewModel Main
|
||||
{
|
||||
get
|
||||
{
|
||||
return DependencyService.Get<MainViewModel>();
|
||||
}
|
||||
}
|
||||
|
||||
public MainNavigationPage ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue