ADD : avancement Navigation from MenuPage ( nullexception with SelectedValue ToFix)

commands-19-09
Lou BRODA 1 year ago
parent 569d16e571
commit 844f9b97fb

@ -55,8 +55,7 @@
ButtonNumber="{Binding BibliothequeVM.Manager.NbBooks}"
ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding BibliothequeVM.Navigator.NavigationCommand}"
CommandParameter="tous/"/>
ButtonTappedCommand="{Binding BibliothequeVM.AllBooksNavigateCommand}"/>
<contentView:SeparatorCutStartView/>
@ -119,8 +118,7 @@
ButtonIcon="person_fill.png"
ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding BibliothequeVM.Navigator.NavigationCommand}"
CommandParameter="auteur/"/>
ButtonTappedCommand="{Binding BibliothequeVM.AllAuthorsNavigateCommand}"/>
<contentView:SeparatorCutStartView/>
@ -129,8 +127,7 @@
ButtonIcon="calendar.png"
ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding BibliothequeVM.Navigator.NavigationCommand}"
CommandParameter="date/"/>
ButtonTappedCommand="{Binding BibliothequeVM.AllDatesNavigateCommand}"/>
<contentView:SeparatorCutStartView/>
@ -139,8 +136,7 @@
ButtonIcon="sparkles.png"
ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding BibliothequeVM.Navigator.NavigationCommand}"
CommandParameter="note/"/>
ButtonTappedCommand="{Binding BibliothequeVM.AllRatingsNavigateCommand}"/>
<contentView:SeparatorEntireView/>
</VerticalStackLayout>

@ -23,12 +23,5 @@ public partial class FiltrageAuteurView : ContentPage
#region Methods
protected override void OnAppearing()
{
base.OnAppearing();
FiltrageAuteurVM.Manager.GetAllAuthorsCommand.Execute(null);
}
#endregion
}

@ -18,6 +18,7 @@
</Grid.RowDefinitions>
<view:HeaderPage HeaderTitle="Date de publication"
HeaderBackButtonText="Mes livres"
HeaderPlusButtonVisible="False"
HeaderSwitchButtonVisible="True"
ButtonPlusTappedCommand="{Binding FiltrageDateVM.Navigator.PopupHomePlusNavigationCommand}"
@ -37,9 +38,9 @@
<contentView:SeparatorEntireView/>
<CollectionView ItemsSource="{Binding FiltrageDateVM.Manager.AllPublishDates}"
SelectionMode="Single"
SelectedItem="{Binding FiltrageDateVM.Manager.SelectedDate}"
SelectionChangedCommand="{Binding FiltrageDateVM.Navigator.NavigationCommand}"
SelectionChangedCommandParameter="{Binding FiltrageDateVM.Manager.SelectedDate}">
SelectionChangedCommand="{Binding FiltrageDateVM.NavigateDatePageCommand}">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModel:PublishDateVM">
<VerticalStackLayout>

@ -23,12 +23,5 @@ public partial class FiltrageDateView : ContentPage
#region Methods
protected override void OnAppearing()
{
base.OnAppearing();
FiltrageDateVM.Manager.GetAllPublishDatesCommand.Execute(null);
}
#endregion
}

@ -38,8 +38,8 @@
<contentView:SeparatorEntireView/>
<CollectionView ItemsSource="{Binding FiltrageNoteVM.Manager.AllRatings}"
SelectionChangedCommand="{Binding FiltrageNoteVM.Navigator.NavigationCommand}"
SelectionChangedCommandParameter="/tous">
SelectionMode="Single"
SelectionChangedCommand="{Binding FiltrageNoteVM.NavigateRatingPageCommand}">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModel:RatingsVM">
<VerticalStackLayout>

@ -23,12 +23,5 @@ public partial class FiltrageNoteView : ContentPage
#region Methods
protected override void OnAppearing()
{
base.OnAppearing();
FiltrageNoteVM.Manager.GetAllRatingsCommand.Execute(null);
}
#endregion
}

@ -35,12 +35,5 @@ public partial class TousView : ContentPage
}
}
protected override void OnAppearing()
{
base.OnAppearing();
TousVM.Manager.GetBooksFromCollectionCommand.Execute(null);
}
#endregion
}

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using ViewModels;
namespace LivreLand.ViewModel
@ -16,6 +17,14 @@ namespace LivreLand.ViewModel
public ManagerVM Manager { get; private set; }
public ICommand AllBooksNavigateCommand { get; private set; }
public ICommand AllAuthorsNavigateCommand { get; private set; }
public ICommand AllDatesNavigateCommand { get; private set; }
public ICommand AllRatingsNavigateCommand { get; private set; }
#endregion
#region Constructor
@ -24,6 +33,38 @@ namespace LivreLand.ViewModel
{
Navigator = navigatorVM;
Manager = managerVM;
AllBooksNavigateCommand = new RelayCommand(() => AllBooksNavigate());
AllAuthorsNavigateCommand = new RelayCommand(() => AllAuthorsNavigate());
AllDatesNavigateCommand = new RelayCommand(() => AllDatesNavigate());
AllRatingsNavigateCommand = new RelayCommand(() => AllRatingsNavigate());
}
#endregion
#region Methods
private void AllBooksNavigate()
{
Manager.GetBooksFromCollectionCommand.Execute(null);
Navigator.NavigationCommand.Execute("/tous");
}
private void AllAuthorsNavigate()
{
Manager.GetAllAuthorsCommand.Execute(null);
Navigator.NavigationCommand.Execute("/auteur");
}
private void AllDatesNavigate()
{
Manager.GetAllPublishDatesCommand.Execute(null);
Navigator.NavigationCommand.Execute("/date");
}
private void AllRatingsNavigate()
{
Manager.GetAllRatingsCommand.Execute(null);
Navigator.NavigationCommand.Execute("/note");
}
#endregion

@ -34,7 +34,7 @@ namespace LivreLand.ViewModel
#region Methods
private async Task NavigateAuthorPage()
private void NavigateAuthorPage()
{
Manager.GetBooksByAuthorCommand.Execute(null);
Navigator.NavigationCommand.Execute("/tous");

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using ViewModels;
namespace LivreLand.ViewModel
@ -16,6 +17,8 @@ namespace LivreLand.ViewModel
public ManagerVM Manager { get; private set; }
public ICommand NavigateDatePageCommand { get; private set; }
#endregion
#region Constructor
@ -24,6 +27,17 @@ namespace LivreLand.ViewModel
{
Navigator = navigatorVM;
Manager = managerVM;
NavigateDatePageCommand = new RelayCommand(() => NavigateDatePage());
}
#endregion
#region Methods
private void NavigateDatePage()
{
Manager.GetBooksByDateCommand.Execute(null);
Navigator.NavigationCommand.Execute("/tous");
}
#endregion

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using ViewModels;
namespace LivreLand.ViewModel
@ -16,6 +17,8 @@ namespace LivreLand.ViewModel
public ManagerVM Manager { get; private set; }
public ICommand NavigateRatingPageCommand { get; private set; }
#endregion
#region Constructor
@ -24,6 +27,17 @@ namespace LivreLand.ViewModel
{
Navigator = navigatorVM;
Manager = managerVM;
NavigateRatingPageCommand = new RelayCommand(() => NavigateRatingPage());
}
#endregion
#region Methods
private void NavigateRatingPage()
{
Manager.GetBooksByRatingCommand.Execute(null);
Navigator.NavigationCommand.Execute("/tous");
}
#endregion

@ -27,6 +27,8 @@ namespace ViewModels
private long nbBooks;
private AuthorVM selectedAuthor;
private PublishDateVM selectedDate;
private RatingsVM selectedRating;
private ContactVM selectedContact;
private string givenFirstName;
@ -105,9 +107,31 @@ namespace ViewModels
}
}
public PublishDateVM SelectedDate { get; private set; }
public PublishDateVM SelectedDate
{
get { return selectedDate; }
set
{
if (selectedDate != value)
{
selectedDate = value;
OnPropertyChanged(nameof(SelectedDate));
}
}
}
public RatingsVM SelectedRating { get; private set; }
public RatingsVM SelectedRating
{
get { return selectedRating; }
set
{
if (selectedRating != value)
{
selectedRating = value;
OnPropertyChanged(nameof(SelectedRating));
}
}
}
public Status SelectedStatus { get; set; }

Loading…
Cancel
Save