ADD : Changement Status Working + Navigation Status bug fixed

fix-bugs-22-10
Lou BRODA 1 year ago
parent bb53472775
commit c63ed977fa

@ -28,5 +28,7 @@
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
<key>NSCameraUsageDescription</key>
<string>This app uses camera for scanning barcodes</string>
</dict>
</plist>

@ -42,8 +42,10 @@
Grid.Column="1"/>
</Grid>
<CollectionView ItemsSource="{Binding FavorisVM.Manager.AllFavoriteBooks}"
SelectedItem="{Binding FavorisVM.Manager.SelectedBook}"
SelectionMode="Single"
SelectionChanged="OnSelectionChanged"
SelectionChangedCommand="{Binding FavorisVM.OnSelectionChangedCommand}"
SelectionChangedCommandParameter="{Binding FavorisVM.Manager.SelectedBook}"
Grid.Row="2">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModel:BookVM">

@ -24,10 +24,5 @@ public partial class FavorisView : ContentPage
#region Methods
void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
//App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView());
}
#endregion
}

@ -106,7 +106,7 @@ namespace LivreLand.ViewModel
private void ShowPicker()
{
Manager.GetAllStatusCommand.Execute(null);
Manager.SelectedStatus = this.Book.Status;
Manager.SelectedStatus = Book.Status;
IsPickerVisible = true;
}

@ -1,9 +1,11 @@
using PersonalMVVMToolkit;
using LivreLand.View;
using PersonalMVVMToolkit;
using System;
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 +18,8 @@ namespace LivreLand.ViewModel
public ManagerVM Manager { get; private set; }
public ICommand OnSelectionChangedCommand { get; private set; }
#endregion
#region Constructor
@ -24,6 +28,20 @@ namespace LivreLand.ViewModel
{
Navigator = navigatorVM;
Manager = managerVM;
OnSelectionChangedCommand = new RelayCommand<BookVM>((bookVM) => OnSelectionChanged(bookVM));
}
#endregion
#region Methods
private void OnSelectionChanged(BookVM bookVM)
{
if (bookVM != null)
{
var result = new DetailsLivreVM(Manager, Navigator, bookVM);
App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView(result));
}
}
#endregion

@ -52,6 +52,7 @@ namespace ViewModels
public Status Status
{
get => Model.Status;
set => SetProperty(Model.Status, value, status => Model.Status = status);
}
public int NbPages

@ -487,8 +487,8 @@ namespace ViewModels
book.Status = SelectedStatus;
await Model.UpdateBook(book);
var updatedBook = new BookVM(book);
bookVM = updatedBook;
OnPropertyChanged(nameof(bookVM));
SelectedBook.Status = updatedBook.Status;
OnPropertyChanged(nameof(SelectedBook));
}
private async Task UpdateToBeReadBook(BookVM bookVM)

Loading…
Cancel
Save