wip
This commit is contained in:
parent
18371ee6d0
commit
6a1b1a9f9b
14
src/CamBooth/CamBooth.App/Core/GenericOverlayWindow.xaml
Normal file
14
src/CamBooth/CamBooth.App/Core/GenericOverlayWindow.xaml
Normal file
@ -0,0 +1,14 @@
|
||||
<Window x:Class="CamBooth.App.Core.GenericOverlayWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:CamBooth.App.Core"
|
||||
mc:Ignorable="d"
|
||||
Title="GenericOverlayWindow" Height="350" Width="600">
|
||||
<Grid>
|
||||
<TextBlock Name="TbHeader" FontSize="40" HorizontalAlignment="Center">Hoppla</TextBlock>
|
||||
<TextBlock Name="TbContent" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center">Sorry, da ging was schief!</TextBlock>
|
||||
<Button Click="ButtonBase_OnClick" Width="300" Height="100" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Bottom" Content="Schließen"></Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
17
src/CamBooth/CamBooth.App/Core/GenericOverlayWindow.xaml.cs
Normal file
17
src/CamBooth/CamBooth.App/Core/GenericOverlayWindow.xaml.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace CamBooth.App.Core;
|
||||
|
||||
public partial class GenericOverlayWindow : Window
|
||||
{
|
||||
public GenericOverlayWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
@ -27,6 +27,7 @@ public partial class LiveViewPage : Page
|
||||
|
||||
private ImageBrush bgbrush = new ImageBrush();
|
||||
|
||||
|
||||
public LiveViewPage(Logger logger, AppSettingsService appSettings, CameraService cameraService)
|
||||
{
|
||||
this._logger = logger;
|
||||
@ -63,19 +64,6 @@ public partial class LiveViewPage : Page
|
||||
}
|
||||
|
||||
|
||||
public void TakePhoto()
|
||||
{
|
||||
try
|
||||
{
|
||||
this._cameraService.TakePhoto();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Sorry, das hat leider nicht geklappt!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
this._cameraService.Dispose();
|
||||
|
||||
@ -13,10 +13,10 @@
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" /> <!-- Erste Zeile (Auto-Höhe) -->
|
||||
<RowDefinition Height="Auto" /> <!-- Zweite Zeile (flexibler Platz) -->
|
||||
<RowDefinition Height="Auto" /> <!-- Dritte Zeile (flexibler Platz) -->
|
||||
<RowDefinition Height="Auto" /> <!-- Dritte Zeile (Auto-Höhe) -->
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Inhalt der ersten Zeile -->
|
||||
@ -49,6 +49,11 @@
|
||||
VerticalAlignment="Bottom"
|
||||
Panel.ZIndex="1" />
|
||||
|
||||
<StackPanel x:Name="GenericPanelCtl"
|
||||
Panel.ZIndex="10"
|
||||
Grid.Row="0">
|
||||
</StackPanel>
|
||||
|
||||
<!-- Inhalt der dritten Zeile -->
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Margin="0 0 5 5">
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
using CamBooth.App.Core;
|
||||
using CamBooth.App.Core.AppSettings;
|
||||
using CamBooth.App.Core.Camera;
|
||||
using CamBooth.App.Core.Logging;
|
||||
@ -9,6 +10,10 @@ using CamBooth.App.DebugConsole;
|
||||
using CamBooth.App.LiveView;
|
||||
using CamBooth.App.PictureGallery;
|
||||
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
using MessageBox = Wpf.Ui.Controls.MessageBox;
|
||||
|
||||
namespace CamBooth.App;
|
||||
|
||||
/// <summary>
|
||||
@ -42,23 +47,13 @@ public partial class MainWindow : Window
|
||||
this._cameraService = cameraService;
|
||||
InitializeComponent();
|
||||
this.SetVisibilityDebugConsole(this._isDebugConsoleVisible);
|
||||
this.LoadPicturePanelAsync();
|
||||
this.SetVisibilityPicturePanel(this._isPicturePanelVisible);
|
||||
_ = this._pictureGalleryService.LoadThumbnailsToCache();
|
||||
CreateMessageBox();
|
||||
this.Closing += OnClosing;
|
||||
logger.Info("MainWindow initialized");
|
||||
}
|
||||
|
||||
|
||||
private async void LoadPicturePanelAsync()
|
||||
{
|
||||
//this.PictureGalleryPage.Visibility = Visibility.Hidden;
|
||||
//this.PictureGalleryPage.Navigate(new PictureGalleryPage(this._appSettings, this._logger));
|
||||
// this._pictureGalleryService.LoadThumbnailsToCache();
|
||||
await this._pictureGalleryService.LoadThumbnailsToCache();
|
||||
//this.DebugFrame.Navigate(new DebugConsolePage(this._logger));
|
||||
}
|
||||
|
||||
|
||||
private void SetVisibilityPicturePanel(bool visibility)
|
||||
{
|
||||
if (visibility)
|
||||
@ -110,7 +105,23 @@ public partial class MainWindow : Window
|
||||
|
||||
private void TakePhoto(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this._liveViewPage?.TakePhoto();
|
||||
try
|
||||
{
|
||||
this._cameraService.TakePhoto();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
this.CreateMessageBox();
|
||||
this._logger.Info(exception.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void CreateMessageBox()
|
||||
{
|
||||
// <ui:MessageBox Title="Hoppla" FontSize="40" Grid.Row="0" Name="MsgBoxCtl">
|
||||
//
|
||||
// </ui:MessageBox>
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user