diff --git a/8.0/Apps/PointOfSale/README.md b/8.0/Apps/PointOfSale/README.md
index ef41a80..a9a224b 100644
--- a/8.0/Apps/PointOfSale/README.md
+++ b/8.0/Apps/PointOfSale/README.md
@@ -7,6 +7,7 @@ languages:
- xaml
products:
- dotnet-maui
+- dotnet-core
urlFragment: apps-pointofsale
---
@@ -30,4 +31,4 @@ This app demonstrates various techniques for building a desktop and mobile appli
* CommunityToolkit.Maui: https://github.com/CommunityToolkit/Maui
* SkiaSharp & Lottie: https://mono.github.io/SkiaSharp.Extended/api/ui-maui/#sklottieview
* MicroCharts: https://github.com/microcharts-dotnet/Microcharts
-* Ril.BlazorSignatureCanvas: https://github.com/ResourceWare/Ril.BlazorSignatureCanvas
+* Ril.BlazorSignatureCanvas: https://github.com/ResourceWare/Ril.BlazorSignatureCanvas
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale.sln b/8.0/Apps/PointOfSale/src/PointOfSale.sln
index 91d49c1..01e5a77 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale.sln
+++ b/8.0/Apps/PointOfSale/src/PointOfSale.sln
@@ -5,6 +5,8 @@ VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PointOfSale", "PointOfSale\PointOfSale.csproj", "{88F24BAD-E7CD-4D00-87F4-702FE9AA7077}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PointOfSale.API", "PointOfSale.API\PointOfSale.API.csproj", "{E093156C-2134-4AE3-8C14-96CE94725BBF}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -17,6 +19,10 @@ Global
{88F24BAD-E7CD-4D00-87F4-702FE9AA7077}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88F24BAD-E7CD-4D00-87F4-702FE9AA7077}.Release|Any CPU.Build.0 = Release|Any CPU
{88F24BAD-E7CD-4D00-87F4-702FE9AA7077}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {E093156C-2134-4AE3-8C14-96CE94725BBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E093156C-2134-4AE3-8C14-96CE94725BBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E093156C-2134-4AE3-8C14-96CE94725BBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E093156C-2134-4AE3-8C14-96CE94725BBF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/.vscode/launch.json b/8.0/Apps/PointOfSale/src/PointOfSale/.vscode/launch.json
deleted file mode 100644
index e015f08..0000000
--- a/8.0/Apps/PointOfSale/src/PointOfSale/.vscode/launch.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- // Use IntelliSense to learn about possible attributes.
- // Hover to view descriptions of existing attributes.
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
- "version": "0.2.0",
- "configurations": [
- {
- "name": "Debug",
- "type": "comet",
- "request": "launch",
- "preLaunchTask": "comet: Build"
- }
- ]
-}
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/AppShell.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/AppShell.xaml
index d30fd4e..49fba37 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/AppShell.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/AppShell.xaml
@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pages="clr-namespace:PointOfSale.Pages"
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
+ xmlns:b="clr-namespace:PointOfSale.Common.Behaviors"
xmlns:v="clr-namespace:PointOfSale.Pages.Views"
x:Class="PointOfSale.AppShell"
FlyoutWidth="104"
@@ -84,20 +85,18 @@
Margin="0,15,0,15"/>
-
+
@@ -113,6 +112,7 @@
@@ -128,6 +128,7 @@
@@ -143,6 +144,7 @@
@@ -158,13 +160,16 @@
-
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml
index 7a612df..c529bda 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml
@@ -4,5 +4,7 @@
xmlns:p="clr-namespace:PointOfSale.Pages.Handheld"
x:Class="PointOfSale.AppShellMobile"
Title="AppShellMobile">
+
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml.cs b/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml.cs
index 832ff02..7aca38d 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml.cs
@@ -18,5 +18,6 @@ public partial class AppShellMobile : Shell
Routing.RegisterRoute(nameof(PayPage), typeof(PayPage));
Routing.RegisterRoute(nameof(SignaturePage), typeof(SignaturePage));
Routing.RegisterRoute(nameof(ReceiptPage), typeof(ReceiptPage));
+ Routing.RegisterRoute(nameof(ScanPage), typeof(ScanPage));
}
}
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/GlobalUsings.cs b/8.0/Apps/PointOfSale/src/PointOfSale/GlobalUsings.cs
deleted file mode 100644
index f38cf4d..0000000
--- a/8.0/Apps/PointOfSale/src/PointOfSale/GlobalUsings.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-global using System.Collections.ObjectModel;
-global using System.Diagnostics;
-global using CommunityToolkit.Mvvm;
-global using CommunityToolkit.Mvvm.ComponentModel;
-global using CommunityToolkit.Mvvm.Input;
-global using PointOfSale.Models;
-global using CommunityToolkit.Mvvm.Messaging;
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/MauiProgram.cs b/8.0/Apps/PointOfSale/src/PointOfSale/MauiProgram.cs
index 1374da9..962d252 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/MauiProgram.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/MauiProgram.cs
@@ -1,7 +1,11 @@
using CommunityToolkit.Maui;
using Microsoft.Maui.LifecycleEvents;
using Microsoft.Maui.Platform;
+using MonkeyCache;
+using MonkeyCache.FileStore;
+using Plugin.Maui.KeyListener;
using SkiaSharp.Views.Maui.Controls.Hosting;
+using ZXing.Net.Maui;
#if WINDOWS
using Microsoft.UI;
@@ -22,8 +26,10 @@ public static class MauiProgram
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp()
+ .UseBarcodeReader()
.UseMauiCommunityToolkit()
.UseSkiaSharp()
+ .UseKeyListener()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
@@ -58,6 +64,8 @@ public static class MauiProgram
ModifyEntry();
+ Barrel.ApplicationId = "com.simplyprofound.pointofsale";
+
return builder.Build();
}
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Models/AppData.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Models/AppData.cs
index 04b841d..ab56ea9 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Models/AppData.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Models/AppData.cs
@@ -18,6 +18,7 @@ public static class AppData
new Item(){ Title = "Hot Tea", Price = 4.00, Quantity = 1, Category = ItemCategory.Beverages, Image = "tea.png"},
new Item(){ Title = "Coffee", Price = 4.00, Quantity = 1, Category = ItemCategory.Beverages, Image = "coffee.png"},
new Item(){ Title = "Milk", Price = 5.00, Quantity = 1, Category = ItemCategory.Beverages, Image = "milk.png"},
+ new Item(){ Title = "Juice", Price = 50.00, Quantity = 1, Category = ItemCategory.Beverages, Image = "juice.png"},
};
public static List Orders { get; set; } = GenerateOrders();
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsPage.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsPage.xaml
index c6953d7..a6f4aaa 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsPage.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsPage.xaml
@@ -11,14 +11,14 @@
-
-
+
+
-
+
@@ -38,9 +38,8 @@
-
-
-
+
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsViewModel.cs
index 330fcec..e343222 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsViewModel.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsViewModel.cs
@@ -27,10 +27,4 @@ public partial class OrderDetailsViewModel
Debug.WriteLine(ex.Message);
}
}
-
- [RelayCommand]
- async Task Add()
- {
- // await Shell.Current.GoToAsync($"{nameof(ScanPage)}");
- }
}
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersPage.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersPage.xaml
index 43262d5..e2aa77b 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersPage.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersPage.xaml
@@ -4,57 +4,148 @@
xmlns:models="clr-namespace:PointOfSale.Models"
xmlns:handheld="clr-namespace:PointOfSale.Pages.Handheld"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
+ xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
+ xmlns:ak="clr-namespace:AlohaKit.Animations;assembly=AlohaKit.Animations"
x:Class="PointOfSale.Pages.Handheld.OrdersPage"
Shell.NavBarIsVisible="False"
x:DataType="handheld:OrdersViewModel"
Title="OrdersPage">
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
+
+
+ one
+ one
+ one
+ one
+ one
+ one
+ one
+ one
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersPage.xaml.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersPage.xaml.cs
index f3ae461..ed18069 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersPage.xaml.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersPage.xaml.cs
@@ -1,9 +1,11 @@
-namespace PointOfSale.Pages.Handheld;
+
+
+namespace PointOfSale.Pages.Handheld;
public partial class OrdersPage : ContentPage
{
public OrdersPage()
{
InitializeComponent();
- }
+ }
}
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersViewModel.cs
index f9bd17b..7e605b0 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersViewModel.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersViewModel.cs
@@ -1,3 +1,8 @@
+using Microsoft.Extensions.Configuration;
+using System.Net.Http.Headers;
+using System.Reflection;
+
+
namespace PointOfSale.Pages.Handheld;
[INotifyPropertyChanged]
@@ -6,8 +11,38 @@ public partial class OrdersViewModel
[ObservableProperty]
private ObservableCollection _orders;
+ [ObservableProperty]
+ private string displayName;
+
+ [ObservableProperty]
+ private string displayEmail;
+
+ [ObservableProperty]
+ private ImageSource profilePhoto;
+
+ [ObservableProperty]
+ private string pageCurrentState = "Loading";
+
+ [RelayCommand]
+ public async Task LogOut()
+ {
+ var result = await App.Current.MainPage.DisplayAlert("", "Do you want to logout?", "Yes", "Ooops, no");
+ if (!result)
+ return;
+
+ await Shell.Current.GoToAsync("//login");
+ }
+
public OrdersViewModel()
{
_orders = new ObservableCollection(AppData.Orders);
+ DelayedLoad().ConfigureAwait(false);
+ }
+
+
+ private async Task DelayedLoad()
+ {
+ await Task.Delay(4000);
+ PageCurrentState = "Loaded";
}
}
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/PayPage.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/PayPage.xaml
old mode 100644
new mode 100755
index f1a3fa0..82472be
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/PayPage.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/PayPage.xaml
@@ -13,7 +13,7 @@
-
-
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ReceiptPage.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ReceiptPage.xaml
old mode 100644
new mode 100755
index 566622f..d710a15
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ReceiptPage.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ReceiptPage.xaml
@@ -22,14 +22,14 @@
-
-
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/SignaturePage.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/SignaturePage.xaml
old mode 100644
new mode 100755
index d89ea81..5d9d483
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/SignaturePage.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/SignaturePage.xaml
@@ -10,11 +10,11 @@
-
-
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipPage.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipPage.xaml
index 4c8743f..d759fa3 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipPage.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipPage.xaml
@@ -19,7 +19,7 @@
-
-
+
@@ -112,7 +112,8 @@
-
-
+
+
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipViewModel.cs
index c84c7bf..67325b2 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipViewModel.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipViewModel.cs
@@ -25,4 +25,10 @@ public partial class TipViewModel
};
await Shell.Current.GoToAsync($"{nameof(PayPage)}", navigationParameter);
}
+
+ [RelayCommand]
+ async Task Add()
+ {
+ await Shell.Current.GoToAsync($"{nameof(ScanPage)}");
+ }
}
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomePage.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomePage.xaml
index 6b98e66..30eef32 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomePage.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomePage.xaml
@@ -6,6 +6,7 @@
xmlns:pages="clr-namespace:PointOfSale.Pages"
xmlns:m="clr-namespace:PointOfSale.Models"
xmlns:l="clr-namespace:CustomLayouts"
+ xmlns:b="clr-namespace:PointOfSale.Common.Behaviors"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
x:DataType="pages:HomeViewModel"
x:Class="PointOfSale.Pages.HomePage"
@@ -19,24 +20,34 @@
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+ Margin="24,24,0,0"
+ x:Name="PageGrid">
+
@@ -47,34 +58,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+ Margin="0,-20,0,0"
+ Source="{Binding Image, FallbackValue=food_01.png}"
+ HorizontalOptions="Center"/>
-
@@ -122,9 +171,7 @@
/>
+ RadioButtonGroup.SelectedValue="{Binding Category}">
Noodles
@@ -140,6 +187,9 @@
+
+
+
@@ -168,6 +218,32 @@
Value="Transparent"/>
+
+
@@ -181,11 +257,26 @@
-
-
-
+
+
+
+
+
+
+
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomePage.xaml.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomePage.xaml.cs
index 7e7f313..6a1b655 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomePage.xaml.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomePage.xaml.cs
@@ -1,21 +1,29 @@
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Platform;
using PointOfSale.Messages;
+#if IOS || MACCATALYST
+using UIKit;
+#endif
namespace PointOfSale.Pages;
public partial class HomePage : ContentPage
{
-
-
public HomePage()
{
InitializeComponent();
+ }
- WeakReferenceMessenger.Default.Register(this, (r, m) =>
- {
+ protected override void OnNavigatedTo(NavigatedToEventArgs args)
+ {
+ base.OnNavigatedTo(args);
+
+ WeakReferenceMessenger.Default.Register(this, (r, m) =>
+ {
NavSubContent(m.Value);
- });
+ });
}
void MenuFlyoutItem_ParentChanged(System.Object sender, System.EventArgs e)
@@ -26,7 +34,7 @@ public partial class HomePage : ContentPage
- public void NavSubContent(bool show)
+ public async void NavSubContent(bool show)
{
var displayWidth = DeviceDisplay.Current.MainDisplayInfo.Width;
@@ -37,8 +45,12 @@ public partial class HomePage : ContentPage
Grid.SetRowSpan(addForm, 3);
// translate off screen right
addForm.TranslationX = displayWidth - addForm.X;
- addForm.TranslateTo(0, 0, 800, easing: Easing.CubicOut);
- }
+ _ = addForm.TranslateTo(0, 0, 800, easing: Easing.CubicOut);
+
+ _ = BlockScreen.FadeTo(0.8, 800, easing: Easing.CubicOut);
+ BlockScreen.InputTransparent = false;
+
+ }
else
{
// remove the product window
@@ -46,11 +58,91 @@ public partial class HomePage : ContentPage
var view = (AddProductView)PageGrid.Children.Where(v => v.GetType() == typeof(AddProductView)).SingleOrDefault();
var x = DeviceDisplay.Current.MainDisplayInfo.Width;
- view.TranslateTo(displayWidth - view.X, 0, 800, easing: Easing.CubicIn);
+ _ = view.TranslateTo(displayWidth - view.X, 0, 800, easing: Easing.CubicIn);
- if (view != null)
- PageGrid.Children.Remove(view);
+ _ = BlockScreen.FadeTo(0, 800, easing: Easing.CubicOut);
+ BlockScreen.InputTransparent = true;
+ await Task.Delay(800);
+ if (view != null){
+ PageGrid.Children.Remove(view);
+ }
}
}
+
+ void OnDragStarting(object sender, DragStartingEventArgs e)
+ {
+ WeakReferenceMessenger.Default.Send(new DragProductMessage(true));
+
+ Item item = (Item)(sender as Element).Parent.BindingContext;
+ e.Data.Properties.Add("Product", item);
+
+ var previewImage = string.Empty;
+ if(item.Title == "Soda") {
+ previewImage = "hunter.png";
+ } else if(item.Title == "Hot Tea") {
+ previewImage = "maddy.png";
+ } else if(item.Title == "Milk") {
+ previewImage = "sweeky.png";
+ } else if(item.Title == "Coffee") {
+ previewImage = "david.png";
+ } else if(item.Title == "Iced Tea") {
+ previewImage = "beth.png";
+ } else if(item.Title == "Juice") {
+ previewImage = "rachel.png";
+ } else {
+ return;
+ }
+
+ #if IOS || MACCATALYST
+ Func action = () =>
+ {
+ var image = UIImage.FromBundle(previewImage);
+ UIKit.UIImageView imageView = new UIKit.UIImageView(image);
+ imageView.ContentMode = UIKit.UIViewContentMode.Center;
+ imageView.Frame = new CoreGraphics.CGRect(0, 0, 250, 250);
+ return new UIKit.UIDragPreview(imageView);
+ };
+
+ e.PlatformArgs.SetPreviewProvider(action);
+ #endif
+ }
+
+ void OnDragOver(object sender, DragEventArgs e)
+ {
+ #if IOS || MACCATALYST
+ e.PlatformArgs.SetDropProposal(new UIKit.UIDropProposal(UIKit.UIDropOperation.Copy));
+ #endif
+ }
+
+ void OnDropCompleted(object sender, DropCompletedEventArgs e)
+ {
+ WeakReferenceMessenger.Default.Send(new DragProductMessage(false));
+ }
+
+ void OnDrop(object sender, DropEventArgs e)
+ {
+ Item product = (Item)e.Data.Properties["Product"];
+ Debug.WriteLine($"{product.Title}");
+ WeakReferenceMessenger.Default.Send(new AddToOrderMessage(product));
+ // Perform logic to take action based on retrieved value.
+ }
+
+ IDispatcherTimer timer;
+
+ void OnPointerPressed(object sender, PointerEventArgs e)
+ {
+ timer = Dispatcher.CreateTimer();
+ timer.Interval = TimeSpan.FromMilliseconds(2000);
+ timer.Tick += (s, e) =>
+ {
+ timer.Stop();
+ WeakReferenceMessenger.Default.Send(new AddProductMessage(true));
+ };
+ }
+
+ void OnPointerReleased(object sender, PointerEventArgs e)
+ {
+ timer.Stop();
+ }
}
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomeViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomeViewModel.cs
old mode 100644
new mode 100755
index 8659711..70e550f
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomeViewModel.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomeViewModel.cs
@@ -1,4 +1,6 @@
using System;
+using PointOfSale.Messages;
+
namespace PointOfSale.Pages;
[INotifyPropertyChanged]
@@ -35,6 +37,6 @@ public partial class HomeViewModel
[RelayCommand]
async Task AddProduct()
{
- MessagingCenter.Send(this, "action", "add");
+ WeakReferenceMessenger.Default.Send(new AddProductMessage(true));
}
}
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductView.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductView.xaml
index 5370c85..f55f772 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductView.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductView.xaml
@@ -17,8 +17,8 @@
-
-
+
+
@@ -96,7 +96,14 @@
-
+
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductView.xaml.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductView.xaml.cs
index 9fa8eeb..a2c382f 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductView.xaml.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductView.xaml.cs
@@ -1,9 +1,32 @@
-namespace PointOfSale.Pages;
+using System.Security.Cryptography;
+using Plugin.Maui.KeyListener;
+using PointOfSale.Messages;
-public partial class AddProductView
+namespace PointOfSale.Pages;
+
+public partial class AddProductView : ContentView, IDisposable
{
+ KeyboardBehavior kb = new KeyboardBehavior();
public AddProductView()
{
InitializeComponent();
+
+ this.Behaviors.Add(kb);
+
+ kb.KeyUp += Kb_KeyUp;
}
+
+ private void Kb_KeyUp(object sender, KeyPressedEventArgs e)
+ {
+ if(e.Keys == KeyboardKeys.Escape)
+ {
+ (this.BindingContext as AddProductViewModel).CancelCommand.Execute(null);
+ }
+ }
+
+ public void Dispose()
+ {
+ kb.KeyUp -= Kb_KeyUp;
+ this.Behaviors.Remove(kb);
+ }
}
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductViewModel.cs
old mode 100644
new mode 100755
index 9f9cf97..55beaf0
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductViewModel.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductViewModel.cs
@@ -1,4 +1,6 @@
using System;
+using PointOfSale.Messages;
+
namespace PointOfSale.Pages;
[INotifyPropertyChanged]
@@ -17,16 +19,22 @@ public partial class AddProductViewModel
ImageSource image;
[RelayCommand]
- async void Save()
+ void Save()
{
ItemCategory cat = (ItemCategory)Enum.Parse(typeof(ItemCategory), category);
item.Category = cat;
AppData.Items.Add(item);
- MessagingCenter.Send(this, "action", "done");
+ WeakReferenceMessenger.Default.Send(new AddProductMessage(false));
}
[RelayCommand]
+ void Cancel()
+ {
+ WeakReferenceMessenger.Default.Send(new AddProductMessage(false));
+ }
+
+ [RelayCommand]
async Task ChangeImage()
{
PickOptions options = new()
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartView.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartView.xaml
index 92fb8c2..16ee086 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartView.xaml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartView.xaml
@@ -12,19 +12,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
@@ -39,7 +84,7 @@
+ BindableLayout.ItemsSource="{Binding Items}">
@@ -53,7 +98,7 @@
-
+
@@ -92,8 +137,17 @@
-
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartView.xaml.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartView.xaml.cs
index 631029f..5ad76e9 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartView.xaml.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartView.xaml.cs
@@ -1,9 +1,19 @@
-namespace PointOfSale.Pages.Views;
+using PointOfSale.Messages;
+
+namespace PointOfSale.Pages.Views;
public partial class OrderCartView : ContentView
{
public OrderCartView()
{
InitializeComponent();
+
+ WeakReferenceMessenger.Default.Register(this, (r, m) =>
+ {
+ if(m.Value)
+ VisualStateManager.GoToState(this, "AcceptDrop");
+ else
+ VisualStateManager.GoToState(this, "Normal");
+ });
}
}
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartViewModel.cs
index 1a6c094..5051fc9 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartViewModel.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartViewModel.cs
@@ -1,20 +1,52 @@
using System;
namespace PointOfSale.Pages.Views;
-
-[INotifyPropertyChanged]
+
+[INotifyPropertyChanged]
public partial class OrderCartViewModel
{
[ObservableProperty]
Order order;
+ [ObservableProperty]
+ ObservableCollection- items;
+
+ int index = 0;
+
public OrderCartViewModel()
{
Order = AppData.Orders.First();
+ Items = new ObservableCollection
- (Order.Items);
+
+ WeakReferenceMessenger.Default.Register(this, (r, m) =>
+ {
+ AddToOrder(m.Value);
+ Items = new ObservableCollection
- (Order.Items);
+ OnPropertyChanged(nameof(Items));
+ });
+ }
+
+ private void AddToOrder(Item item)
+ {
+ //if item is in the order alread, increment the quantity
+ var existing = Order.Items.Where(x => x.Title == item.Title).SingleOrDefault();
+ if (existing != null)
+ {
+ existing.Quantity++;
+ }
+ else
+ {
+ Order.Items.Add(item);
+ }
}
[RelayCommand]
async Task PlaceOrder()
{
await App.Current.MainPage.DisplayAlert("Not Implemented", "Wouldn't it be cool tho?", "Okay");
+ if(index < (AppData.Orders.Count - 1))
+ index++;
+ else
+ index = 0;
+ Order = AppData.Orders[index];
}
}
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/AndroidManifest.xml b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/AndroidManifest.xml
index e9937ad..3a32a87 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/AndroidManifest.xml
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/AndroidManifest.xml
@@ -1,6 +1,24 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/MainActivity.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/MainActivity.cs
index 34c4b75..a42bd2f 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/MainActivity.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/MainActivity.cs
@@ -1,10 +1,17 @@
using Android.App;
+using Android.Content;
using Android.Content.PM;
using Android.OS;
+using Android.Runtime;
+using PointOfSale.Data;
namespace PointOfSale;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)]
public class MainActivity : MauiAppCompatActivity
{
+ protected override void OnCreate(Bundle savedInstanceState)
+ {
+ base.OnCreate(savedInstanceState);
+ }
}
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/MacCatalyst/AppDelegate.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/MacCatalyst/AppDelegate.cs
index 0fdcc41..4f84ccf 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/MacCatalyst/AppDelegate.cs
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/MacCatalyst/AppDelegate.cs
@@ -1,4 +1,5 @@
using Foundation;
+using UIKit;
namespace PointOfSale;
@@ -6,4 +7,14 @@ namespace PointOfSale;
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+
+ public override void BuildMenu(IUIMenuBuilder builder)
+ {
+ base.BuildMenu(builder);
+ var formatMenuIdentifier = UIMenuIdentifier.Format.GetConstant();
+ builder.RemoveMenu(formatMenuIdentifier);
+
+ var editIdentifier = UIMenuIdentifier.Edit.GetConstant();
+ builder.RemoveMenu(editIdentifier);
+ }
}
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/iOS/Info.plist b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/iOS/Info.plist
index d19a61e..c4b8def 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/iOS/Info.plist
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/iOS/Info.plist
@@ -30,5 +30,7 @@
Assets.xcassets/appicon.appiconset
NSCameraUsageDescription
Barcode Scanning
+ UIRequiresPersistentWiFi
+
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/PointOfSale.csproj b/8.0/Apps/PointOfSale/src/PointOfSale/PointOfSale.csproj
index aaacaa2..20291a6 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/PointOfSale.csproj
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/PointOfSale.csproj
@@ -2,28 +2,22 @@
net8.0-android;net8.0-ios;net8.0-maccatalyst
- $(TargetFrameworks);net8.0-windows10.0.19041.0
-
-
-
-
+ $(TargetFrameworks);net8.0-windows10.0.19041
Exe
PointOfSale
true
true
enable
true
+ false
Food
- net.dot.pointofsale
-
+ com.simplyprofound.pointofsale
+ 919dc1f9-17a9-48b3-81f8-0b8016bdfbf7
+
1
@@ -40,18 +34,29 @@
Food
+
-
+
+
dPOSDev
Apple Development: Created via API (2NJFZDD9ZM)
4
-
+
Automatic
iPhone Developer
+
+ false
+ Automatic
+ iPhone Developer
+ Platforms\iOS\Entitlements.plist
+
+
+ false
+
@@ -60,7 +65,7 @@
-
+
@@ -76,11 +81,19 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Shared/MainLayout.razor b/8.0/Apps/PointOfSale/src/PointOfSale/Shared/MainLayout.razor
index 8c8ab7d..11f4283 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Shared/MainLayout.razor
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Shared/MainLayout.razor
@@ -1,12 +1,12 @@
-@inherits LayoutComponentBase
-
-
-
-
-
-
+@inherits LayoutComponentBase
+
+
+
+
+
+
@code {
private SignatureCanvas signatureCanvas;
diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Shared/MainLayout.razor.css b/8.0/Apps/PointOfSale/src/PointOfSale/Shared/MainLayout.razor.css
index d45ce50..34ae748 100644
--- a/8.0/Apps/PointOfSale/src/PointOfSale/Shared/MainLayout.razor.css
+++ b/8.0/Apps/PointOfSale/src/PointOfSale/Shared/MainLayout.razor.css
@@ -4,6 +4,10 @@
flex-direction: column;
}
+.my-special-styling-class {
+ background-color: #0a58ca;
+}
+
main {
flex: 1;
}