mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 15:36:07 +00:00 
			
		
		
		
	Nettoyage + recablage filtre de recherche
This commit is contained in:
		
							parent
							
								
									d0701dc686
								
							
						
					
					
						commit
						383e19d144
					
				
					 5 changed files with 19 additions and 222 deletions
				
			
		|  | @ -1,6 +1,4 @@ | ||||||
| using System; | using Xamarin.Forms; | ||||||
| 
 |  | ||||||
| using Xamarin.Forms; |  | ||||||
| using Xamarin.Forms.Xaml; | using Xamarin.Forms.Xaml; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeu.Views | namespace AideDeJeu.Views | ||||||
|  |  | ||||||
|  | @ -27,14 +27,16 @@ | ||||||
|         <ToolbarItem Name="Speak" Text="Écouter / Arrêter" Order="Secondary" Icon="scroll_unfurled.png" Command="{Binding Main.Speech.SpeakItemCommand, Mode=OneTime}" CommandParameter="{Binding Item}" /> |         <ToolbarItem Name="Speak" Text="Écouter / Arrêter" Order="Secondary" Icon="scroll_unfurled.png" Command="{Binding Main.Speech.SpeakItemCommand, Mode=OneTime}" CommandParameter="{Binding Item}" /> | ||||||
|     </ContentPage.ToolbarItems> |     </ContentPage.ToolbarItems> | ||||||
|     <Grid> |     <Grid> | ||||||
|         <!--<ScrollView Orientation="Vertical" BackgroundColor="{StaticResource HDWhite}"> |         <Grid.RowDefinitions> | ||||||
|             <mdview:MarkdownView  |             <RowDefinition Height="auto" /> | ||||||
|                 Theme="{StaticResource MonsterMarkdownTheme}"  |             <RowDefinition Height="*" /> | ||||||
|                 Markdown="{Binding Item.Item.Markdown}"  |         </Grid.RowDefinitions> | ||||||
|                 NavigateToLinkCommand="{Binding Main.Navigator.NavigateToLinkCommand}" |         <SearchBar Grid.Column="0" Grid.Row="0" x:Name="SearchBar" IsVisible="{Binding Filter, Converter={StaticResource NullToFalseConverter}, Mode=OneWay}" HeightRequest="42" SearchCommand="{Binding SearchCommand}" SearchCommandParameter="{Binding Text, Source={x:Reference SearchBar}}"> | ||||||
|                 /> |             <SearchBar.Behaviors> | ||||||
|         </ScrollView>--> |                 <tools:TextChangedBehavior /> | ||||||
|         <ListView Grid.Column="0" Grid.Row="0" x:Name="ItemsListView" ItemsSource="{Binding Children}" VerticalOptions="FillAndExpand" HasUnevenRows="true" CachingStrategy="RecycleElement" SelectedItem="{Binding SelectedItem}" ItemTapped="ItemsListView_ItemTapped"> |             </SearchBar.Behaviors> | ||||||
|  |         </SearchBar> | ||||||
|  |         <ListView Grid.Column="0" Grid.Row="1" x:Name="ItemsListView" ItemsSource="{Binding Children}" VerticalOptions="FillAndExpand" HasUnevenRows="true" CachingStrategy="RecycleElement" SelectedItem="{Binding SelectedItem}" ItemTapped="ItemsListView_ItemTapped"> | ||||||
|             <ListView.Header> |             <ListView.Header> | ||||||
|                 <mdview:MarkdownView  |                 <mdview:MarkdownView  | ||||||
|                     Theme="{StaticResource MonsterMarkdownTheme}"  |                     Theme="{StaticResource MonsterMarkdownTheme}"  | ||||||
|  | @ -54,6 +56,7 @@ | ||||||
|             </ListView.ItemTemplate> |             </ListView.ItemTemplate> | ||||||
|         </ListView> |         </ListView> | ||||||
|         <ActivityIndicator  |         <ActivityIndicator  | ||||||
|  |             Grid.RowSpan="2" | ||||||
|             VerticalOptions="StartAndExpand" |             VerticalOptions="StartAndExpand" | ||||||
|             HorizontalOptions="End" |             HorizontalOptions="End" | ||||||
|             Color="{StaticResource HDRed}" |             Color="{StaticResource HDRed}" | ||||||
|  |  | ||||||
|  | @ -1,16 +1,4 @@ | ||||||
|  | using AideDeJeu.ViewModels.Library; | ||||||
| using AideDeJeu.ViewModels; |  | ||||||
| using AideDeJeu.ViewModels.Library; |  | ||||||
| using AideDeJeuLib; |  | ||||||
| using SkiaSharp; |  | ||||||
| using SkiaSharp.Views.Forms; |  | ||||||
| using System; |  | ||||||
| using System.Collections.Generic; |  | ||||||
| using System.ComponentModel; |  | ||||||
| using System.Linq; |  | ||||||
| using System.Runtime.CompilerServices; |  | ||||||
| using System.Text.RegularExpressions; |  | ||||||
| using System.Threading.Tasks; |  | ||||||
| using Xamarin.Forms; | using Xamarin.Forms; | ||||||
| using Xamarin.Forms.Xaml; | using Xamarin.Forms.Xaml; | ||||||
| 
 | 
 | ||||||
|  | @ -20,7 +8,7 @@ namespace AideDeJeu.Views.Library | ||||||
|     [QueryProperty("Path", "path")] |     [QueryProperty("Path", "path")] | ||||||
|     public partial class ItemPage : ContentPage |     public partial class ItemPage : ContentPage | ||||||
|     { |     { | ||||||
|         public ItemViewModel Item |         public ItemViewModel BindingItem | ||||||
|         { |         { | ||||||
|             get |             get | ||||||
|             { |             { | ||||||
|  | @ -48,13 +36,13 @@ namespace AideDeJeu.Views.Library | ||||||
|         protected override void OnAppearing() |         protected override void OnAppearing() | ||||||
|         { |         { | ||||||
|             base.OnAppearing(); |             base.OnAppearing(); | ||||||
|             Item.Main.CurrentItem = Item; |             BindingItem.Main.CurrentItem = BindingItem; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         protected override void OnDisappearing() |         protected override void OnDisappearing() | ||||||
|         { |         { | ||||||
|             base.OnDisappearing(); |             base.OnDisappearing(); | ||||||
|             Item.Main.CurrentItem = null; |             BindingItem.Main.CurrentItem = null; | ||||||
|         } |         } | ||||||
|         private string _Path { get; set; } = null; //"index.md"; |         private string _Path { get; set; } = null; //"index.md"; | ||||||
|         public string Path |         public string Path | ||||||
|  | @ -68,7 +56,7 @@ namespace AideDeJeu.Views.Library | ||||||
|                 _Path = value; |                 _Path = value; | ||||||
|                 if (Path != null) |                 if (Path != null) | ||||||
|                 { |                 { | ||||||
|                     Item?.LoadPageAsync(Path); |                     BindingItem?.LoadPageAsync(Path); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -1,11 +1,4 @@ | ||||||
| using AideDeJeu.ViewModels; | using Xamarin.Forms; | ||||||
| using System; |  | ||||||
| using System.Collections.Generic; |  | ||||||
| using System.Linq; |  | ||||||
| using System.Text; |  | ||||||
| using System.Threading.Tasks; |  | ||||||
| 
 |  | ||||||
| using Xamarin.Forms; |  | ||||||
| using Xamarin.Forms.Xaml; | using Xamarin.Forms.Xaml; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeu.Views | namespace AideDeJeu.Views | ||||||
|  | @ -13,18 +6,9 @@ namespace AideDeJeu.Views | ||||||
| 	[XamlCompilation(XamlCompilationOptions.Compile)] | 	[XamlCompilation(XamlCompilationOptions.Compile)] | ||||||
| 	public partial class MainPage : ContentPage | 	public partial class MainPage : ContentPage | ||||||
| 	{ | 	{ | ||||||
|         //public MainViewModel Main |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return DependencyService.Get<MainViewModel>(); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         public MainPage () |         public MainPage () | ||||||
| 		{ | 		{ | ||||||
| 			InitializeComponent (); | 			InitializeComponent (); | ||||||
|             //BindingContext = this; |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | @ -1,14 +1,4 @@ | ||||||
| using AideDeJeu.ViewModels; | using Xamarin.Forms; | ||||||
| using System; |  | ||||||
| using System.Collections.Generic; |  | ||||||
| using System.ComponentModel; |  | ||||||
| using System.Diagnostics; |  | ||||||
| using System.Linq; |  | ||||||
| using System.Runtime.CompilerServices; |  | ||||||
| using System.Text; |  | ||||||
| using System.Threading.Tasks; |  | ||||||
| using System.Windows.Input; |  | ||||||
| using Xamarin.Forms; |  | ||||||
| using Xamarin.Forms.Xaml; | using Xamarin.Forms.Xaml; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeu.Views | namespace AideDeJeu.Views | ||||||
|  | @ -19,172 +9,6 @@ namespace AideDeJeu.Views | ||||||
|         public MainShell() |         public MainShell() | ||||||
|         { |         { | ||||||
|             InitializeComponent(); |             InitializeComponent(); | ||||||
|             //BindingContext = this; |  | ||||||
|         } |         } | ||||||
| 
 |  | ||||||
|         //public MainViewModel Main |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return DependencyService.Get<MainViewModel>(); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //public ICommand NavigateToItemCommand |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return new Command<string>(async (path) => await ExecuteNavigateToItemCommandAsync(path)); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
|         //private async Task ExecuteNavigateToItemCommandAsync(string path) |  | ||||||
|         //{ |  | ||||||
|         //    await Navigation.PushAsync(new Library.ItemPage(path), true); |  | ||||||
|         //    this.FlyoutIsPresented = false; |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //public ICommand NavigateToHomeCommand |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return new Command(async() => await ExecuteNavigateToHomeCommandAsync()); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
|         //private async Task ExecuteNavigateToHomeCommandAsync() |  | ||||||
|         //{ |  | ||||||
|         //    await Navigation.PushAsync(new MainPage(), true); |  | ||||||
|         //    this.FlyoutIsPresented = false; |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //public ICommand NavigateToPCCommand |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return new Command(async () => await ExecuteNavigateToPCCommandAsync()); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
|         //private async Task ExecuteNavigateToPCCommandAsync() |  | ||||||
|         //{ |  | ||||||
|         //    await Navigation.PushAsync(new PlayerCharacter.PlayerCharacterEditorPage(), true); |  | ||||||
|         //    this.FlyoutIsPresented = false; |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //public ICommand NavigateToDicesCommand |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return new Command(async () => await ExecuteNavigateToDicesCommandAsync()); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
|         //private async Task ExecuteNavigateToDicesCommandAsync() |  | ||||||
|         //{ |  | ||||||
|         //    await Navigation.PushAsync(new DicesPage(), true); |  | ||||||
|         //    this.FlyoutIsPresented = false; |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //public ICommand NavigateToBookmarksCommand |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return new Command(async () => await ExecuteNavigateToBookmarksCommandAsync()); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
|         //private async Task ExecuteNavigateToBookmarksCommandAsync() |  | ||||||
|         //{ |  | ||||||
|         //    await Navigation.PushAsync(new Library.BookmarksPage(), true); |  | ||||||
|         //    this.FlyoutIsPresented = false; |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //public ICommand NavigateToDeepSearchCommand |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return new Command(async () => await ExecuteNavigateToDeepSearchCommandAsync()); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
|         //private async Task ExecuteNavigateToDeepSearchCommandAsync() |  | ||||||
|         //{ |  | ||||||
|         //    await Navigation.PushAsync(new Library.DeepSearchPage(), true); |  | ||||||
|         //    this.FlyoutIsPresented = false; |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //public ICommand NavigateToAboutCommand |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return new Command(async () => await ExecuteNavigateToAboutCommandAsync()); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
|         //private async Task ExecuteNavigateToAboutCommandAsync() |  | ||||||
|         //{ |  | ||||||
|         //    await Navigation.PushAsync(new AboutPage(), true); |  | ||||||
|         //    this.FlyoutIsPresented = false; |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //private string _HeaderTitle = string.Empty; |  | ||||||
|         //public string HeaderTitle |  | ||||||
|         //{ |  | ||||||
|         //    get |  | ||||||
|         //    { |  | ||||||
|         //        return _HeaderTitle; |  | ||||||
|         //    } |  | ||||||
|         //    set |  | ||||||
|         //    { |  | ||||||
|         //        SetProperty(ref _HeaderTitle, value); |  | ||||||
|         //    } |  | ||||||
|         //} |  | ||||||
|         //protected override void OnNavigated(ShellNavigatedEventArgs args) |  | ||||||
|         //{ |  | ||||||
|         //    base.OnNavigated(args); |  | ||||||
|         //    Debug.WriteLine(this.CurrentItem?.CurrentItem?.CurrentItem); |  | ||||||
|         //    HeaderTitle = this.CurrentItem?.CurrentItem?.CurrentItem?.Route; |  | ||||||
|         //    var content = this.CurrentItem?.CurrentItem?.CurrentItem?.Content; |  | ||||||
|         //    Debug.WriteLine(content); |  | ||||||
| 
 |  | ||||||
|         //    this.CurrentItem.CurrentItem.CurrentItem.PropertyChanged += CurrentItem_PropertyChanged; |  | ||||||
|         //    this.CurrentItem.CurrentItem.CurrentItem.Appearing += CurrentItem_Appearing; |  | ||||||
|         //    this.CurrentItem.CurrentItem.CurrentItem.BindingContextChanged += CurrentItem_BindingContextChanged; |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //private void CurrentItem_BindingContextChanged(object sender, EventArgs e) |  | ||||||
|         //{ |  | ||||||
|         //    Debug.WriteLine(e.ToString()); |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //private void CurrentItem_Appearing(object sender, EventArgs e) |  | ||||||
|         //{ |  | ||||||
|         //    Debug.WriteLine(e.ToString()); |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //private void CurrentItem_PropertyChanged(object sender, PropertyChangedEventArgs e) |  | ||||||
|         //{ |  | ||||||
|         //    Debug.WriteLine(e.PropertyName); |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //protected bool SetProperty<T>(ref T backingStore, T value, |  | ||||||
|         //    [CallerMemberName]string propertyName = "", |  | ||||||
|         //    Action onChanged = null) |  | ||||||
|         //{ |  | ||||||
|         //    if (EqualityComparer<T>.Default.Equals(backingStore, value)) |  | ||||||
|         //        return false; |  | ||||||
| 
 |  | ||||||
|         //    backingStore = value; |  | ||||||
|         //    onChanged?.Invoke(); |  | ||||||
|         //    CallOnPropertyChanged(propertyName); |  | ||||||
|         //    return true; |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //#region INotifyPropertyChanged |  | ||||||
|         //public event PropertyChangedEventHandler PropertyChanged; |  | ||||||
|         //protected void CallOnPropertyChanged([CallerMemberName] string propertyName = "") |  | ||||||
|         //{ |  | ||||||
|         //    var changed = PropertyChanged; |  | ||||||
|         //    if (changed == null) |  | ||||||
|         //        return; |  | ||||||
| 
 |  | ||||||
|         //    changed.Invoke(this, new PropertyChangedEventArgs(propertyName)); |  | ||||||
|         //} |  | ||||||
|         //#endregion |  | ||||||
| 
 |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez