mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 07:26:09 +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> | ||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -23,12 +23,18 @@ namespace AideDeJeu.ViewModels | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public async Task ExecuteSearchCommandAsync(string searchText) |         public async Task ExecuteSearchCommandAsync(string searchText) | ||||||
|  |         { | ||||||
|  |             try | ||||||
|             { |             { | ||||||
|                 Main.IsLoading = true; |                 Main.IsLoading = true; | ||||||
|                 //await Task.Run(async () => await Store.PreloadAllItemsAsync()); |                 //await Task.Run(async () => await Store.PreloadAllItemsAsync()); | ||||||
|                 Items = await Task.Run(async () => await DeepSearchAllItemsAsync(searchText)); |                 Items = await Task.Run(async () => await DeepSearchAllItemsAsync(searchText)); | ||||||
|  |             } | ||||||
|  |             finally | ||||||
|  |             { | ||||||
|                 Main.IsLoading = false; |                 Main.IsLoading = false; | ||||||
|             } |             } | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         public IEnumerable<SearchedItem> _Items = null; |         public IEnumerable<SearchedItem> _Items = null; | ||||||
|         public IEnumerable<SearchedItem> Items |         public IEnumerable<SearchedItem> Items | ||||||
|  |  | ||||||
|  | @ -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; | ||||||
|  |                 Item item = null; | ||||||
|  |                 try | ||||||
|  |                 { | ||||||
|                     Main.IsBusy = true; |                     Main.IsBusy = true; | ||||||
|                     Main.IsLoading = true; |                     Main.IsLoading = true; | ||||||
|                 var item = await Task.Run(async () => await Store.GetItemFromDataAsync(file, anchor)); |                     item = await Task.Run(async () => await Store.GetItemFromDataAsync(file, anchor)); | ||||||
|  |                 } | ||||||
|  |                 finally | ||||||
|  |                 { | ||||||
|                     Main.IsBusy = false; |                     Main.IsBusy = false; | ||||||
|                     Main.IsLoading = 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
	
	 Yan Maniez
						Yan Maniez