diff --git a/src/CamBooth/CamBooth.App/Core/AppSettings/app.settings.dev.json b/src/CamBooth/CamBooth.App/Core/AppSettings/app.settings.dev.json
index 4341bb2..e77cb5e 100644
--- a/src/CamBooth/CamBooth.App/Core/AppSettings/app.settings.dev.json
+++ b/src/CamBooth/CamBooth.App/Core/AppSettings/app.settings.dev.json
@@ -2,9 +2,9 @@
"AppSettings": {
"AppName": "Meine Anwendung",
"Version": "1.0.0",
- "IsDebugMode": true,
+ "IsDebugMode": false,
"PictureLocation": "C:\\tmp\\cambooth",
- "DebugConsoleVisible": "true",
+ "DebugConsoleVisible": "false",
"PhotoCountdownSeconds": 2,
"FocusDelaySeconds": 1,
"FocusTimeoutMs": 1000,
diff --git a/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml b/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml
index e4695f0..9aeacbd 100644
--- a/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml
+++ b/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml
@@ -6,8 +6,8 @@
xmlns:liveView="clr-namespace:CamBooth.App.Features.LiveView"
mc:Ignorable="d"
Title="LiveViewPage" Width="1350" Height="900"
- Background="PaleVioletRed">
-
-
+ Background="Transparent">
+
+
\ No newline at end of file
diff --git a/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml.cs b/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml.cs
index 39c1d33..750a49e 100644
--- a/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml.cs
+++ b/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml.cs
@@ -1,4 +1,4 @@
-using System.IO;
+using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
@@ -33,11 +33,20 @@ public partial class LiveViewPage : Page
this.InitializeComponent();
this.SetImageAction = img => { this.bgbrush.ImageSource = img; };
- // Mirror the LiveView image horizontally
- ScaleTransform scaleTransform = new ScaleTransform(-1, 1, 0.5, 0.5);
- this.bgbrush.Transform = scaleTransform;
+ // Configure the image brush
+ this.bgbrush.Stretch = Stretch.UniformToFill;
+ this.bgbrush.AlignmentX = AlignmentX.Center;
+ this.bgbrush.AlignmentY = AlignmentY.Center;
this.LVCanvas.Background = this.bgbrush;
+
+ // Apply horizontal flip on the Canvas using RenderTransform
+ TransformGroup transformGroup = new();
+ transformGroup.Children.Add(new ScaleTransform { ScaleX = -1, ScaleY = 1 });
+ transformGroup.Children.Add(new TranslateTransform { X = 1, Y = 0 });
+ this.LVCanvas.RenderTransform = transformGroup;
+ this.LVCanvas.RenderTransformOrigin = new Point(0.5, 0.5);
+
cameraService.ConnectCamera();
cameraService._mainCamera.LiveViewUpdated += this.MainCamera_OnLiveViewUpdated;
}
diff --git a/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml b/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml
index 36d9557..83d12cf 100644
--- a/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml
+++ b/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml
@@ -16,7 +16,12 @@
Fill="#4CAF50"
Height="75"
HorizontalAlignment="Left"/>
- HIER EINE ANWEISUNG ANZEIGEN
+ Lächeln!
diff --git a/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml.cs b/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml.cs
index 01b364f..2107ba7 100644
--- a/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml.cs
+++ b/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml.cs
@@ -1,4 +1,4 @@
-using System.Windows;
+using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
@@ -22,6 +22,32 @@ public partial class TimerControlRectangleAnimation : UserControl
private Storyboard _progressBarAnimation;
+ private Random _random = new Random();
+
+ private List _photoInstructions = new List
+ {
+ "Lächeln! 😊",
+ "Hasenohren machen! 🐰",
+ "Zunge rausstrecken! 👅",
+ "Grimasse ziehen! 😝",
+ "Daumen hoch! 👍",
+ "Peace-Zeichen! ✌️",
+ "Lustig gucken! 🤪",
+ "Crazy Face! 🤯",
+ "Küsschen! 😘",
+ "Winken! 👋",
+ "Herz mit den Händen! ❤️",
+ "Verrückt sein! 🤪",
+ "Überrascht schauen! 😲",
+ "Cool bleiben! 😎",
+ "Lachen! 😄",
+ "Zähne zeigen! 😁",
+ "Schnute ziehen! 😗",
+ "Augen zukneifen! 😆",
+ "Arm hochstrecken! 🙌",
+ "Gruppe umarmen! 🤗"
+ };
+
public TimerControlRectangleAnimation()
{
@@ -66,6 +92,10 @@ public partial class TimerControlRectangleAnimation : UserControl
// TimerText.Text = TimeSpan.FromSeconds(_remainingTime).ToString(@"mm\:ss");
// StatusText.Text = "Timer läuft...";
+
+ // Show initial random instruction
+ ShowRandomInstruction();
+
_timer.Start();
StartProgressBarAnimation();
@@ -120,4 +150,13 @@ public partial class TimerControlRectangleAnimation : UserControl
{
_progressBarAnimation?.Stop();
}
+
+ private void ShowRandomInstruction()
+ {
+ if (_photoInstructions.Count > 0)
+ {
+ int randomIndex = _random.Next(_photoInstructions.Count);
+ InstructionText.Text = _photoInstructions[randomIndex];
+ }
+ }
}
\ No newline at end of file
diff --git a/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml b/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml
index b1c8a90..15cf199 100644
--- a/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml
+++ b/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml
@@ -9,7 +9,12 @@
Background="Black">
-
+
+
+
+
+
+
@@ -18,6 +23,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml.cs b/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml.cs
index 54ae4f3..0c1befb 100644
--- a/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml.cs
+++ b/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml.cs
@@ -1,4 +1,4 @@
-using System.Windows;
+using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
@@ -26,6 +26,10 @@ public partial class PictureGalleryPage : Page
private ContentDialog? _openContentDialog;
+ private int _currentPage = 1;
+ private int _itemsPerPage = 12;
+ private int _totalPages = 1;
+
public PictureGalleryPage(AppSettingsService appSettingsService, Logger logger, PictureGalleryService pictureGalleryService)
{
@@ -41,7 +45,10 @@ public partial class PictureGalleryPage : Page
{
try
{
- this.LoadPictures(12);
+ _currentPage = 1;
+ CalculateTotalPages();
+ LoadCurrentPage();
+ UpdatePagerControls();
}
catch (Exception e)
{
@@ -59,16 +66,20 @@ public partial class PictureGalleryPage : Page
}
- private void LoadPictures(int howManyPictures = 0)
+ private void LoadPictures(int startIndex, int count)
{
- int loop = 0;
-
this.Dispatcher.Invoke(
() =>
{
- do
+ // Clear existing items
+ this.PicturesPanel.Items.Clear();
+
+ int totalThumbnails = this._pictureGalleryService.ThumbnailsOrderedByNewestDescending.Count;
+ int endIndex = Math.Min(startIndex + count, totalThumbnails);
+
+ for (int i = startIndex; i < endIndex; i++)
{
- BitmapImage thumbnail = this._pictureGalleryService.ThumbnailsOrderedByNewestDescending[loop];
+ BitmapImage thumbnail = this._pictureGalleryService.ThumbnailsOrderedByNewestDescending[i];
TextBlock? textBlock = new();
Hyperlink? hyperlink = new();
@@ -85,9 +96,7 @@ public partial class PictureGalleryPage : Page
textBlock.Inlines.Add(hyperlink);
this.PicturesPanel.Items.Add(textBlock);
- loop++;
}
- while ((loop < howManyPictures || howManyPictures == 0) && loop < this._pictureGalleryService.ThumbnailsOrderedByNewestDescending.Count);
});
}
@@ -116,6 +125,20 @@ public partial class PictureGalleryPage : Page
this.Dispatcher.Invoke(CloseDialog);
}
+ public void RefreshGallery()
+ {
+ CalculateTotalPages();
+
+ // If current page is now beyond total pages, go to last page
+ if (_currentPage > _totalPages)
+ {
+ _currentPage = Math.Max(1, _totalPages);
+ }
+
+ LoadCurrentPage();
+ UpdatePagerControls();
+ }
+
public async Task ShowPhotoDialogAsync(string picturePath)
{
@@ -142,6 +165,19 @@ public partial class PictureGalleryPage : Page
contentDialog.SetCurrentValue(ContentDialog.CloseButtonTextProperty, "Schließen");
contentDialog.SetCurrentValue(ContentDialog.PrimaryButtonTextProperty, "Drucken");
+ // Apply gold color to Primary button (Drucken)
+ contentDialog.Loaded += (s, args) =>
+ {
+ // Find the Primary button and apply gold styling
+ if (contentDialog.Template?.FindName("PrimaryButton", contentDialog) is System.Windows.Controls.Button primaryButton)
+ {
+ primaryButton.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D4AF37"));
+ primaryButton.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#1F1A00"));
+ primaryButton.BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F6E7A1"));
+ primaryButton.BorderThickness = new Thickness(2);
+ }
+ };
+
contentDialog.Tag = picturePath;
contentDialog.ButtonClicked += this.ContentDialog_OnButtonClicked;
@@ -171,6 +207,75 @@ public partial class PictureGalleryPage : Page
string picturePath = Uri.UnescapeDataString(picturePathUri.AbsolutePath);
_ = this.ShowPhotoDialogAsync(picturePath);
}
+
+ private void CalculateTotalPages()
+ {
+ int totalItems = this._pictureGalleryService.ThumbnailsOrderedByNewestDescending.Count;
+ _totalPages = totalItems > 0 ? (int)Math.Ceiling((double)totalItems / _itemsPerPage) : 1;
+ }
+
+ private void LoadCurrentPage()
+ {
+ int startIndex = (_currentPage - 1) * _itemsPerPage;
+ LoadPictures(startIndex, _itemsPerPage);
+ }
+
+ private void UpdatePagerControls()
+ {
+ this.Dispatcher.Invoke(() =>
+ {
+ PageInfoText.Text = $"Seite {_currentPage} von {_totalPages}";
+
+ FirstPageButton.IsEnabled = _currentPage > 1;
+ PreviousPageButton.IsEnabled = _currentPage > 1;
+ NextPageButton.IsEnabled = _currentPage < _totalPages;
+ LastPageButton.IsEnabled = _currentPage < _totalPages;
+
+ // Visual feedback for disabled buttons
+ FirstPageButton.Opacity = FirstPageButton.IsEnabled ? 1.0 : 0.5;
+ PreviousPageButton.Opacity = PreviousPageButton.IsEnabled ? 1.0 : 0.5;
+ NextPageButton.Opacity = NextPageButton.IsEnabled ? 1.0 : 0.5;
+ LastPageButton.Opacity = LastPageButton.IsEnabled ? 1.0 : 0.5;
+ });
+ }
+
+ private void FirstPageButton_Click(object sender, RoutedEventArgs e)
+ {
+ _currentPage = 1;
+ LoadCurrentPage();
+ UpdatePagerControls();
+ GalleryScrollViewer.ScrollToTop();
+ }
+
+ private void PreviousPageButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (_currentPage > 1)
+ {
+ _currentPage--;
+ LoadCurrentPage();
+ UpdatePagerControls();
+ GalleryScrollViewer.ScrollToTop();
+ }
+ }
+
+ private void NextPageButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (_currentPage < _totalPages)
+ {
+ _currentPage++;
+ LoadCurrentPage();
+ UpdatePagerControls();
+ GalleryScrollViewer.ScrollToTop();
+ }
+ }
+
+ private void LastPageButton_Click(object sender, RoutedEventArgs e)
+ {
+ _currentPage = _totalPages;
+ LoadCurrentPage();
+ UpdatePagerControls();
+ GalleryScrollViewer.ScrollToTop();
+ }
}
diff --git a/src/CamBooth/CamBooth.App/MainWindow.xaml b/src/CamBooth/CamBooth.App/MainWindow.xaml
index 9014aa2..36db703 100644
--- a/src/CamBooth/CamBooth.App/MainWindow.xaml
+++ b/src/CamBooth/CamBooth.App/MainWindow.xaml
@@ -26,10 +26,10 @@
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ Background="Transparent"
+ Panel.ZIndex="1" />
@@ -53,11 +53,24 @@
Margin="24 24 24 12"/>
+
+
+
-
+ Height="52"
+ Background="#D4AF37"
+ Foreground="#1F1A00"
+ BorderBrush="#F6E7A1"
+ BorderThickness="2"
+ FontWeight="SemiBold" />
@@ -240,6 +258,9 @@
HorizontalAlignment="Center"
Background="LightGreen"
Panel.ZIndex="2" />
+
+
+
diff --git a/src/CamBooth/CamBooth.App/MainWindow.xaml.cs b/src/CamBooth/CamBooth.App/MainWindow.xaml.cs
index cae62e7..91f2574 100644
--- a/src/CamBooth/CamBooth.App/MainWindow.xaml.cs
+++ b/src/CamBooth/CamBooth.App/MainWindow.xaml.cs
@@ -1,7 +1,9 @@
-using System.ComponentModel;
+using System.ComponentModel;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
@@ -12,6 +14,8 @@ using CamBooth.App.Features.DebugConsole;
using CamBooth.App.Features.LiveView;
using CamBooth.App.Features.PictureGallery;
+using Wpf.Ui.Controls;
+
namespace CamBooth.App;
///
@@ -263,8 +267,28 @@ public partial class MainWindow : Window
this.Close();
}
- private void ShutdownWindows(object sender, RoutedEventArgs e)
+ private async void ShutdownWindows(object sender, RoutedEventArgs e)
{
+ // Show confirmation dialog
+ var confirmDialog = new ContentDialog(this.DialogPresenter);
+ confirmDialog.Title = "Sicherheitsabfrage";
+ confirmDialog.Content = "Möchtest du die Fotobox wirklich ausschalten?";
+ confirmDialog.PrimaryButtonText = "Ja, ausschalten";
+ confirmDialog.CloseButtonText = "Abbrechen";
+ confirmDialog.DefaultButton = ContentDialogButton.Close;
+ confirmDialog.PrimaryButtonAppearance = ControlAppearance.Danger;
+ confirmDialog.CloseButtonAppearance = ControlAppearance.Secondary;
+ confirmDialog.Background = new SolidColorBrush(Colors.White);
+ confirmDialog.Foreground = new SolidColorBrush(Colors.Black);
+
+ var result = await confirmDialog.ShowAsync();
+
+ // Only proceed with shutdown if user confirmed
+ if (result != ContentDialogResult.Primary)
+ {
+ return;
+ }
+
if (this._appSettings.IsShutdownEnabled)
{
try
diff --git a/src/CamBooth/CamBooth.App/ToDos.txt b/src/CamBooth/CamBooth.App/ToDos.txt
index 10fe566..d9fafef 100644
--- a/src/CamBooth/CamBooth.App/ToDos.txt
+++ b/src/CamBooth/CamBooth.App/ToDos.txt
@@ -5,4 +5,6 @@
- Kiosk Modus einrichten
- Energiesparmodus abschalten
- Starbildschirm mit freundlicher Begrüßung, kurzer Erklärung, und viel Spaß wünschen mit der FotoCam
-- Verschiedene Hinweise anzeigen beim Fotofrafieren (lächeln, Hasensohren, Zunge raus, Grimasse, usw.)
+- Verschiedene Hinweise anzeigen beim Fotografieren (lächeln, Hasensohren, Zunge raus, Grimasse, usw.)
+- Bild über QR Code runterladen
+- Windows updates deaktivieren
\ No newline at end of file
diff --git a/src/CamBooth/CamBooth.sln.DotSettings.user b/src/CamBooth/CamBooth.sln.DotSettings.user
index 2f94f74..97ab86f 100644
--- a/src/CamBooth/CamBooth.sln.DotSettings.user
+++ b/src/CamBooth/CamBooth.sln.DotSettings.user
@@ -7,6 +7,7 @@
True
True
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded