diff --git a/LivreLand/AppShell.xaml.cs b/LivreLand/AppShell.xaml.cs
index 3a9374d..83caf95 100644
--- a/LivreLand/AppShell.xaml.cs
+++ b/LivreLand/AppShell.xaml.cs
@@ -15,6 +15,7 @@ public partial class AppShell : Shell
Routing.RegisterRoute("library/date/", typeof(FiltrageDateView));
Routing.RegisterRoute("library/note/", typeof(FiltrageNoteView));
Routing.RegisterRoute("library/contacts/", typeof(ContactsView));
+ Routing.RegisterRoute("library/scan/", typeof(ScanView));
Routing.RegisterRoute("library/tous/details/", typeof(DetailsLivreView));
InitializeComponent();
}
diff --git a/LivreLand/LivreLand.csproj b/LivreLand/LivreLand.csproj
index 47c0609..8fac7be 100644
--- a/LivreLand/LivreLand.csproj
+++ b/LivreLand/LivreLand.csproj
@@ -53,6 +53,7 @@
+
@@ -137,6 +138,9 @@
MSBuild:Compile
+
+ MSBuild:Compile
+
MSBuild:Compile
diff --git a/LivreLand/MauiProgram.cs b/LivreLand/MauiProgram.cs
index 64b132b..5844d00 100644
--- a/LivreLand/MauiProgram.cs
+++ b/LivreLand/MauiProgram.cs
@@ -1,4 +1,5 @@
-using CommunityToolkit.Maui;
+using Camera.MAUI;
+using CommunityToolkit.Maui;
using LivreLand.View;
using LivreLand.View.ContentViews;
using LivreLand.ViewModel;
@@ -17,6 +18,7 @@ public static class MauiProgram
builder
.UseMauiApp()
.UseMauiCommunityToolkit()
+ .UseMauiCameraView()
.ConfigureFonts(fonts =>
{
fonts.AddFont("SF-Compact-Display-Black.otf", "SFCompactDisplayBlack");
@@ -35,6 +37,7 @@ public static class MauiProgram
.AddSingleton()
.AddSingleton()
.AddSingleton()
+ .AddSingleton()
.AddSingleton()
@@ -54,7 +57,8 @@ public static class MauiProgram
.AddSingleton()
.AddSingleton()
.AddSingleton()
- .AddSingleton();
+ .AddSingleton()
+ .AddSingleton();
#if DEBUG
builder.Logging.AddDebug();
diff --git a/LivreLand/Platforms/Android/AndroidManifest.xml b/LivreLand/Platforms/Android/AndroidManifest.xml
index e9937ad..f89971c 100644
--- a/LivreLand/Platforms/Android/AndroidManifest.xml
+++ b/LivreLand/Platforms/Android/AndroidManifest.xml
@@ -3,4 +3,5 @@
+
\ No newline at end of file
diff --git a/LivreLand/View/ContentViews/PopupHomePlusButtonView.xaml b/LivreLand/View/ContentViews/PopupHomePlusButtonView.xaml
index 8185e04..9b3b577 100644
--- a/LivreLand/View/ContentViews/PopupHomePlusButtonView.xaml
+++ b/LivreLand/View/ContentViews/PopupHomePlusButtonView.xaml
@@ -26,10 +26,6 @@
Margin="10,5,10,5">
-
-
-
@@ -52,6 +48,10 @@
+
+
+
diff --git a/LivreLand/View/DetailsLivreView.xaml b/LivreLand/View/DetailsLivreView.xaml
index acb7c94..c773df1 100644
--- a/LivreLand/View/DetailsLivreView.xaml
+++ b/LivreLand/View/DetailsLivreView.xaml
@@ -351,7 +351,8 @@
HorizontalOptions="Center"
VerticalOptions="Center">
-
diff --git a/LivreLand/View/ScanView.xaml b/LivreLand/View/ScanView.xaml
new file mode 100644
index 0000000..0ea1198
--- /dev/null
+++ b/LivreLand/View/ScanView.xaml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LivreLand/View/ScanView.xaml.cs b/LivreLand/View/ScanView.xaml.cs
new file mode 100644
index 0000000..cd8b3aa
--- /dev/null
+++ b/LivreLand/View/ScanView.xaml.cs
@@ -0,0 +1,23 @@
+using LivreLand.ViewModel;
+
+namespace LivreLand.View;
+
+public partial class ScanView : ContentPage
+{
+ #region Properties
+
+ public ScanVM ScanVM { get; set; }
+
+ #endregion
+
+ #region Constructor
+
+ public ScanView(ScanVM scanVM)
+ {
+ ScanVM = scanVM;
+ InitializeComponent();
+ BindingContext = this;
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/LivreLand/ViewModel/ScanVM.cs b/LivreLand/ViewModel/ScanVM.cs
new file mode 100644
index 0000000..7e43475
--- /dev/null
+++ b/LivreLand/ViewModel/ScanVM.cs
@@ -0,0 +1,129 @@
+using Camera.MAUI;
+using PersonalMVVMToolkit;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+using ViewModels;
+
+namespace LivreLand.ViewModel
+{
+ public class ScanVM : BaseViewModel
+ {
+ #region Fields
+
+ private CameraInfo camera = null;
+ private ObservableCollection cameras = new();
+ private int camerasCount;
+ private string barcodeText = "ISBN";
+
+ #endregion
+
+ #region Properties
+
+ public CameraInfo Camera
+ {
+ get => camera;
+ set
+ {
+ camera = value;
+ OnPropertyChanged(nameof(Camera));
+ AutoStartPreview = false;
+ OnPropertyChanged(nameof(AutoStartPreview));
+ AutoStartPreview = true;
+ OnPropertyChanged(nameof(AutoStartPreview));
+ }
+ }
+
+ public ObservableCollection Cameras
+ {
+ get => cameras;
+ set
+ {
+ if (cameras != value)
+ {
+ cameras = value;
+ OnPropertyChanged(nameof(Cameras));
+ }
+ }
+ }
+
+ public int CamerasCount
+ {
+ get => camerasCount = Cameras.Count();
+ set
+ {
+ if (value > 0)
+ {
+ Camera = Cameras.First();
+ }
+ }
+ }
+
+ public string BarcodeText
+ {
+ get => barcodeText;
+ set
+ {
+ if (barcodeText != value)
+ {
+ barcodeText = value;
+ OnPropertyChanged(nameof(BarcodeText));
+ }
+ }
+ }
+
+ public bool AutoStartPreview { get; set; } = false;
+
+ public bool AutoStartRecording { get; set; } = false;
+
+ public NavigatorVM Navigator { get; private set; }
+
+ public ManagerVM Manager { get; private set; }
+
+ public ICommand StartCameraCommand { get; private set; }
+
+ public ICommand BarcodeDetectCommand { get; private set; }
+
+ public ICommand StartRecordingCommand { get; private set; }
+
+ #endregion
+
+ #region Constructor
+
+ public ScanVM(NavigatorVM navigatorVM, ManagerVM managerVM)
+ {
+ Navigator = navigatorVM;
+ Manager = managerVM;
+ StartCameraCommand = new RelayCommand(() => StartCamera());
+ BarcodeDetectCommand = new RelayCommand(() => BarcodeDetect());
+ StartRecordingCommand = new RelayCommand(() => StartRecording());
+ }
+
+ #endregion
+
+ #region Methods
+
+ private async Task StartCamera()
+ {
+ AutoStartPreview = true;
+ OnPropertyChanged(nameof(AutoStartPreview));
+ }
+
+ private async Task BarcodeDetect()
+ {
+
+ }
+
+ private async Task StartRecording()
+ {
+ AutoStartRecording = true;
+ OnPropertyChanged(nameof(AutoStartRecording));
+ }
+
+ #endregion
+ }
+}
diff --git a/ViewModels/ManagerVM.cs b/ViewModels/ManagerVM.cs
index b3c87f7..e4cbda3 100644
--- a/ViewModels/ManagerVM.cs
+++ b/ViewModels/ManagerVM.cs
@@ -485,6 +485,9 @@ namespace ViewModels
var book = await Model.GetBookById(bookVM.Id);
book.Status = SelectedStatus;
await Model.UpdateBook(book);
+ var updatedBook = new BookVM(book);
+ bookVM = updatedBook;
+ OnPropertyChanged(nameof(bookVM));
}
private async Task UpdateToBeReadBook(BookVM bookVM)