This commit is contained in:
Tobias Wohlleben 2025-01-22 15:12:32 +01:00
parent 750d840563
commit 81c8b4181c
8 changed files with 168 additions and 17 deletions

View File

@ -8,6 +8,7 @@
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Light" /> <ui:ThemesDictionary Theme="Light" />
<ui:ControlsDictionary /> <ui:ControlsDictionary />
<ResourceDictionary Source="/Resources/ButtonStyles.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>

View File

@ -0,0 +1,4 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/WebPathMapping/IgnoredPaths/=BUTTONSTYLES_002EXAML/@EntryIndexedValue">ButtonStyles.xaml</s:String>
<s:String x:Key="/Default/CodeInspection/WebPathMapping/PathsInCorrectCasing/=BUTTONSTYLES_002EXAML/@EntryIndexedValue">ButtonStyles.xaml</s:String></wpf:ResourceDictionary>

View File

@ -3,11 +3,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
mc:Ignorable="d" mc:Ignorable="d"
Title="PictureGalleryPage" Width="1600" Height="900" Title="PictureGalleryPage" Width="1600" Height="900"
Background="Black"> Background="Black">
<Grid> <Grid>
<WrapPanel VerticalAlignment="Stretch" x:Name="PicturesPanel" Orientation="Horizontal" /> <WrapPanel VerticalAlignment="Stretch" Background="Black" x:Name="PicturesPanel" Orientation="Horizontal" />
<ContentPresenter x:Name="RootContentDialogPresenter" Grid.Row="0" /> <ContentPresenter x:Name="RootContentDialogPresenter" Grid.Row="0" />
</Grid> </Grid>
</Page> </Page>

View File

@ -1,6 +1,7 @@
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Effects; using System.Windows.Media.Effects;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
@ -75,8 +76,8 @@ public partial class PictureGalleryPage : Page
Image? imageControl = new() Image? imageControl = new()
{ {
Source = thumbnail, Source = thumbnail,
Width = 388, Width = 392,
Margin = new Thickness(6) Margin = new Thickness(4)
}; };
hyperlink.Inlines.Add(new InlineUIContainer(imageControl)); hyperlink.Inlines.Add(new InlineUIContainer(imageControl));
@ -95,18 +96,20 @@ public partial class PictureGalleryPage : Page
Application.Current.Dispatcher.BeginInvoke( Application.Current.Dispatcher.BeginInvoke(
async () => async () =>
{ {
ContentDialog? contentDialog = new(this.RootContentDialogPresenter); ContentDialog contentDialog = new (this.RootContentDialogPresenter);
Image? imageToShow = new() Image imageToShow = new()
{ {
MaxHeight = 570, MaxHeight = 570,
Background = new SolidColorBrush(Colors.White),
VerticalAlignment = VerticalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,
Source = PictureGalleryService.CreateThumbnail(picturePathUri.AbsolutePath, 450, 300) Source = PictureGalleryService.CreateThumbnail(picturePathUri.AbsolutePath, 450, 300)
}; };
contentDialog.VerticalAlignment = VerticalAlignment.Top; contentDialog.VerticalAlignment = VerticalAlignment.Top;
contentDialog.PrimaryButtonAppearance = ControlAppearance.Caution; contentDialog.PrimaryButtonAppearance = ControlAppearance.Primary;
contentDialog.CloseButtonAppearance = ControlAppearance.Dark; contentDialog.CloseButtonAppearance = ControlAppearance.Light;
contentDialog.Background = new SolidColorBrush(Colors.White);
contentDialog.Foreground = new SolidColorBrush(Colors.White);
// contentDialog.SetCurrentValue(ContentDialog.TitleProperty, "Hello World"); // contentDialog.SetCurrentValue(ContentDialog.TitleProperty, "Hello World");
contentDialog.SetCurrentValue(ContentControl.ContentProperty, imageToShow); contentDialog.SetCurrentValue(ContentControl.ContentProperty, imageToShow);
contentDialog.SetCurrentValue(ContentDialog.CloseButtonTextProperty, "Schließen"); contentDialog.SetCurrentValue(ContentDialog.CloseButtonTextProperty, "Schließen");

View File

@ -45,14 +45,26 @@
Margin="0 0 0 0"> Margin="0 0 0 0">
<liveView:TimerControlRectangleAnimation x:Name="TimerControlRectangleAnimation" HorizontalAlignment="Center" VerticalAlignment="Center"/> <liveView:TimerControlRectangleAnimation x:Name="TimerControlRectangleAnimation" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Name="ButtonPanel" Background="#AA000000" Panel.ZIndex="2" <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Name="ButtonPanel" Background="Transparent" Panel.ZIndex="2"
Margin="0 0 0 0"> Margin="0 0 0 0">
<ui:Button Content="Start" Click="NavToLiveView" Width="200" Height="75" VerticalAlignment="Bottom" <ui:Button Content="Start" Click="NavToLiveView" Width="200" Height="75" VerticalAlignment="Bottom"
Margin="0 0 5 0" /> Margin="0 0 5 0" />
<ui:Button Content="Hide Debug" Click="SetVisibilityDebugConsole" Width="200" Height="75" <ui:Button Content="Hide Debug" Click="SetVisibilityDebugConsole" Width="200" Height="75"
VerticalAlignment="Bottom" Margin="0 0 5 0" /> VerticalAlignment="Bottom" Margin="0 0 5 0" />
<ui:Button Content="Take Photo" Click="StartTakePhotoProcess" Width="200" Height="75" VerticalAlignment="Bottom" <!-- <ui:Button Content="Take Photo" Click="StartTakePhotoProcess" Width="200" Height="75" VerticalAlignment="Bottom" -->
Margin="0 0 5 0" /> <!-- Margin="0 0 5 0" /> -->
<Button Width="160" Height="160"
Click="StartTakePhotoProcess"
Content="PUSH ME"
FontSize="64"
Foreground="White"
Margin="0 0 5 0"
Background="Red"
BorderBrush="Transparent"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource ModernRounded3DButtonStyle}"/>
<ui:Button Content="Pictures" Click="SetVisibilityPicturePanel" Width="200" Height="75" <ui:Button Content="Pictures" Click="SetVisibilityPicturePanel" Width="200" Height="75"
VerticalAlignment="Bottom" Margin="0 0 5 0" /> VerticalAlignment="Bottom" Margin="0 0 5 0" />
<ui:Button Content="Close" Appearance="Danger" Click="CloseApp" Width="200" Height="75" VerticalAlignment="Bottom" Margin="0 0 5 0" /> <ui:Button Content="Close" Appearance="Danger" Click="CloseApp" Width="200" Height="75" VerticalAlignment="Bottom" Margin="0 0 5 0" />

View File

@ -55,7 +55,6 @@ public partial class MainWindow : Window
try try
{ {
this._cameraService.TakePhoto(); this._cameraService.TakePhoto();
SwitchButtonAndTimerPanel();
} }
catch (Exception exception) catch (Exception exception)
{ {
@ -63,6 +62,10 @@ public partial class MainWindow : Window
System.Windows.MessageBox.Show("Sorry, da ging was schief!"); System.Windows.MessageBox.Show("Sorry, da ging was schief!");
this._logger.Info(exception.Message); this._logger.Info(exception.Message);
} }
finally
{
SwitchButtonAndTimerPanel();
}
} }
@ -117,8 +120,18 @@ public partial class MainWindow : Window
private void StartTakePhotoProcess(object sender, RoutedEventArgs e) private void StartTakePhotoProcess(object sender, RoutedEventArgs e)
{ {
TimerControlRectangleAnimation.StartTimer(5); try
SwitchButtonAndTimerPanel(); {
TimerControlRectangleAnimation.StartTimer(5);
}
catch (Exception exception)
{
this._logger.Error(exception.Message);
}
finally
{
SwitchButtonAndTimerPanel();
}
} }
private void SwitchButtonAndTimerPanel() private void SwitchButtonAndTimerPanel()

View File

@ -0,0 +1,115 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Runder Button Stil mit 3D-Effekt, Wellenbewegung und Schatten -->
<Style x:Key="ModernRounded3DButtonStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<!-- 3D Hintergrund -->
<Ellipse>
<Ellipse.Fill>
<LinearGradientBrush StartPoint="0.3,0" EndPoint="0.7,1">
<GradientStop Color="#FFB22222" Offset="0.0" /> <!-- Obere Kante -->
<GradientStop Color="#FF8B0000" Offset="1.0" /> <!-- Untere Kante -->
</LinearGradientBrush>
</Ellipse.Fill>
<Ellipse.Effect>
<DropShadowEffect Color="Black"
BlurRadius="20"
ShadowDepth="7"
Opacity="0.6" />
</Ellipse.Effect>
</Ellipse>
<!-- Glanzeffekt (Highlight) -->
<Ellipse>
<Ellipse.Fill>
<RadialGradientBrush GradientOrigin="0.5,0.3" Center="0.5,0.3" RadiusX="1" RadiusY="1">
<GradientStop Color="#90EEEEEE" Offset="0.0" />
<GradientStop Color="#00EEEEEE" Offset="1.0" />
</RadialGradientBrush>
</Ellipse.Fill>
<Ellipse.OpacityMask>
<RadialGradientBrush GradientOrigin="0.5,0.5">
<GradientStop Color="White" Offset="0.6" />
<GradientStop Color="Transparent" Offset="0.8" />
</RadialGradientBrush>
</Ellipse.OpacityMask>
<!-- Dynamische Größe -->
<Ellipse.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="0.6" />
</Ellipse.RenderTransform>
</Ellipse>
<!-- Content (Button-Text) -->
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
TextElement.FontSize="32"
TextElement.FontWeight="Bold"
/>
<!-- Wellenkreis -->
<Ellipse Name="RippleEffect"
Fill="White"
Opacity="0"
Width="0"
Height="0"
RenderTransformOrigin="0.5,0.5">
<Ellipse.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Ellipse.RenderTransform>
</Ellipse>
</Grid>
<ControlTemplate.Triggers>
<!-- Hover-Effekt -->
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Background" Value="#FF4500" />
<Setter TargetName="RippleEffect" Property="Opacity" Value="0.2" />
</Trigger>
<!-- Klick-Effekt mit Wellen -->
<Trigger Property="IsPressed" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<!-- Wellenbewegung -->
<DoubleAnimation Storyboard.TargetName="RippleEffect"
Storyboard.TargetProperty="Opacity"
From="0.3" To="0" Duration="0:0:0.5" />
<DoubleAnimation Storyboard.TargetName="RippleEffect"
Storyboard.TargetProperty="Width"
From="0" To="200" Duration="0:0:0.5" />
<DoubleAnimation Storyboard.TargetName="RippleEffect"
Storyboard.TargetProperty="Height"
From="0" To="200" Duration="0:0:0.5" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Setter Property="Background" Value="#D32F2F" />
</Trigger>
<!-- 3D Effekt beim Loslassen -->
<Trigger Property="IsPressed" Value="False">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<!-- Bewegung nach oben simulieren -->
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.(TranslateTransform.Y)"
To="-2"
Duration="0:0:0.2"
AutoReverse="True" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -7,6 +7,7 @@
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CDev_005CRepos_005CPrivat_005CCamBooth_005Cmisc_005CCanonBinaries_005CMlib_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CDev_005CRepos_005CPrivat_005CCamBooth_005Cmisc_005CCanonBinaries_005CMlib_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CDev_005CRepos_005CPrivat_005CCamBooth_005Cmisc_005CCanonBinaries_005CUcs32P_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CDev_005CRepos_005CPrivat_005CCamBooth_005Cmisc_005CCanonBinaries_005CUcs32P_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AApplication_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003Ftobia_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F6665f2e3e843578225e3796b83c5342a58c3f72bfef19eeee7aa90d157d4949_003FApplication_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AApplication_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003Ftobia_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F6665f2e3e843578225e3796b83c5342a58c3f72bfef19eeee7aa90d157d4949_003FApplication_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AContentPresenter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003Ftobia_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F606231aefeb19a0da9311c15b3798ade39bbe28dd28a8e719884133e2e2f67_003FContentPresenter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADispatcher_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003Ftobia_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F9ac32f819d6853e0a6eda168c52b7f38eef9ae75936fb85d96a15c39d115245_003FDispatcher_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADispatcher_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003Ftobia_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F9ac32f819d6853e0a6eda168c52b7f38eef9ae75936fb85d96a15c39d115245_003FDispatcher_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEventRoute_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003Ftobia_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F4bda76b5cc453e1edf5d5c754c4a8215edbd3d3e4f80706dcf4f52a4f68979_003FEventRoute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEventRoute_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003Ftobia_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F4bda76b5cc453e1edf5d5c754c4a8215edbd3d3e4f80706dcf4f52a4f68979_003FEventRoute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExceptionDispatchInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003Ftobia_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F793c644a163b4a9992123fa9cc1562efbf3908_003F4a_003Fd28af422_003FExceptionDispatchInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExceptionDispatchInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003Ftobia_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F793c644a163b4a9992123fa9cc1562efbf3908_003F4a_003Fd28af422_003FExceptionDispatchInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>