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