Tutorials Fenster fertig (ohne bilder)
@ -13,10 +13,10 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("AquaCare.Controller")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("AquaCare.Controller")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+11383fc75a9f1f764ac2f8fef2dd8f2da0c7e2b8")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f15ec9caf02f7612f79e2af762523e526c5e3015")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("AquaCare.Controller")]
|
[assembly: System.Reflection.AssemblyProductAttribute("AquaCare.Controller")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("AquaCare.Controller")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("AquaCare.Controller")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
||||||
// Generated by the MSBuild WriteCodeFragment class.
|
// Von der MSBuild WriteCodeFragment-Klasse generiert.
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
b26810a9701a80bd8d247c92ecf69824a86d42eff82b9218864ad2356c15c28a
|
4a1595911e8564a3ee44d1afa12534ecbbd538005c0e2dc8381ae13ac848a00b
|
||||||
|
|||||||
@ -13,10 +13,10 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("AquaCare.Model")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("AquaCare.Model")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+11383fc75a9f1f764ac2f8fef2dd8f2da0c7e2b8")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f15ec9caf02f7612f79e2af762523e526c5e3015")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("AquaCare.Model")]
|
[assembly: System.Reflection.AssemblyProductAttribute("AquaCare.Model")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("AquaCare.Model")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("AquaCare.Model")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
||||||
// Generated by the MSBuild WriteCodeFragment class.
|
// Von der MSBuild WriteCodeFragment-Klasse generiert.
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
1f8bedf408b8f59454ecc9fe6bdd5c389ea72f6f52e0c888b1f255e3586460ec
|
608884560f9ff9dcf53b06872b5959ce6fdcecbed088fdb17cc4e5a296ea6109
|
||||||
|
|||||||
@ -13,10 +13,10 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("AquaCare.Persistence")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("AquaCare.Persistence")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+11383fc75a9f1f764ac2f8fef2dd8f2da0c7e2b8")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f15ec9caf02f7612f79e2af762523e526c5e3015")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("AquaCare.Persistence")]
|
[assembly: System.Reflection.AssemblyProductAttribute("AquaCare.Persistence")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("AquaCare.Persistence")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("AquaCare.Persistence")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
||||||
// Generated by the MSBuild WriteCodeFragment class.
|
// Von der MSBuild WriteCodeFragment-Klasse generiert.
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
4b1690178df789d1c5fd4816cf36ec319f0ceb403af602830b6577406a3b49da
|
2be14979cabc9b5f0134f4360999b97b323362d004003e24c42ef7d64d8cf6ba
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 890 KiB After Width: | Height: | Size: 890 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
BIN
AquaCare.View/Ressourcen/BilderTutorials/Fische füttern/1.jpg
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
AquaCare.View/Ressourcen/BilderTutorials/Fische füttern/2.jpg
Normal file
|
After Width: | Height: | Size: 890 KiB |
BIN
AquaCare.View/Ressourcen/BilderTutorials/Fische füttern/3.jpg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
AquaCare.View/Ressourcen/BilderTutorials/Wasser wechseln/1.jpg
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
AquaCare.View/Ressourcen/BilderTutorials/Wasser wechseln/2.jpg
Normal file
|
After Width: | Height: | Size: 890 KiB |
BIN
AquaCare.View/Ressourcen/BilderTutorials/Wasser wechseln/3.jpg
Normal file
|
After Width: | Height: | Size: 34 KiB |
@ -11,9 +11,9 @@
|
|||||||
</Grid.Background>
|
</Grid.Background>
|
||||||
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/> <!-- Überschrift -->
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/> <!-- Buttons für Tutorials -->
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/> <!-- Tutorial-Inhalt -->
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Buttons für Tutorials -->
|
<!-- Buttons für Tutorials -->
|
||||||
@ -21,7 +21,7 @@
|
|||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="0,5,0,5">
|
Margin="0,5,0,0"> <!-- Unteres Margin reduziert -->
|
||||||
<Button Content="Fische füttern" Width="300" Height="50" Click="FischeFütternClick"/>
|
<Button Content="Fische füttern" Width="300" Height="50" Click="FischeFütternClick"/>
|
||||||
<Button Content="Wasser wechseln" Width="300" Height="50" Click="WasserWechselnClick"/>
|
<Button Content="Wasser wechseln" Width="300" Height="50" Click="WasserWechselnClick"/>
|
||||||
<Button Content="Filter reinigen" Width="300" Height="50" Click="FilterReinigenClick"/>
|
<Button Content="Filter reinigen" Width="300" Height="50" Click="FilterReinigenClick"/>
|
||||||
@ -35,21 +35,37 @@
|
|||||||
|
|
||||||
<!-- StackPanel für Tutorial-Inhalt -->
|
<!-- StackPanel für Tutorial-Inhalt -->
|
||||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" Spacing="5">
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" Spacing="5">
|
||||||
<!-- Bild -->
|
<!-- Container für Bild und initialen Text -->
|
||||||
<Image x:Name="tutorialImage" Height="500" Width="500" Stretch="Uniform"/>
|
<Grid Height="450" Width="500" Margin="0,0,0,0"> <!-- Höhe reduziert -->
|
||||||
|
<Image x:Name="tutorialImage"
|
||||||
|
Stretch="Uniform"
|
||||||
|
IsVisible="False"/>
|
||||||
|
<TextBlock x:Name="initialText"
|
||||||
|
Text="Wähle oben, was du nicht kannst!"
|
||||||
|
FontSize="30"
|
||||||
|
FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<!-- TextBlock für Bildindex -->
|
<!-- Bildindex-Text -->
|
||||||
<TextBlock x:Name="imageIndexTextBlock"
|
<TextBlock x:Name="imageIndexTextBlock"
|
||||||
Text="Bitte wählen Sie ein Tutorial aus"
|
Text=""
|
||||||
FontSize="24"
|
FontSize="18"
|
||||||
FontWeight="Bold"
|
HorizontalAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
Margin="0,2,0,2"/> <!-- Margins reduziert -->
|
||||||
Margin="0,10,0,10"/>
|
|
||||||
|
|
||||||
<!-- Navigation unter dem Bild -->
|
<!-- Navigation unter dem Bild -->
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="2" Margin="0,5,0,0">
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" Spacing="5">
|
||||||
<Button Content="Zurück" Click="PreviousImageClick" />
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="10">
|
||||||
<Button Content="Weiter" Click="NextImageClick" />
|
<Button Content="Zurück" Click="PreviousImageClick" />
|
||||||
|
<Button Content="Weiter" Click="NextImageClick" />
|
||||||
|
</StackPanel>
|
||||||
|
<Button Content="Schließen"
|
||||||
|
Click="CloseClick"
|
||||||
|
Width="200"
|
||||||
|
Margin="0,5,0,0"
|
||||||
|
HorizontalAlignment="Center"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@ -2,106 +2,100 @@ using Avalonia.Controls;
|
|||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Media.Imaging;
|
using Avalonia.Media.Imaging;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace AquaCare.View
|
namespace AquaCare.View
|
||||||
{
|
{
|
||||||
public partial class TutorialsWindow : Window
|
public partial class TutorialsWindow : Window
|
||||||
{
|
{
|
||||||
private List<string> _images;
|
private List<string> _images;
|
||||||
|
private TextBlock? _imageIndexTextBlock;
|
||||||
|
private TextBlock? _initialText;
|
||||||
private int _currentImageIndex;
|
private int _currentImageIndex;
|
||||||
private TextBlock _imageIndexTextBlock;
|
|
||||||
|
|
||||||
public TutorialsWindow()
|
public TutorialsWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_images = new List<string>();
|
_images = new List<string>();
|
||||||
_imageIndexTextBlock = this.Find<TextBlock>("imageIndexTextBlock");
|
|
||||||
InitializeTutorial();
|
_imageIndexTextBlock = this.Find<TextBlock>("imageIndexTextBlock")
|
||||||
|
?? throw new InvalidOperationException("imageIndexTextBlock not found");
|
||||||
|
_initialText = this.Find<TextBlock>("initialText")
|
||||||
|
?? throw new InvalidOperationException("initialText not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeTutorial()
|
private void LoadTutorialImages(string folderName)
|
||||||
{
|
{
|
||||||
|
if (_initialText == null || tutorialImage == null) return;
|
||||||
|
|
||||||
_images = new List<string>
|
_images = new List<string>
|
||||||
{
|
{
|
||||||
"Ressourcen/BilderTutorials/Beispiele/1.jpg",
|
$"Ressourcen/BilderTutorials/{folderName}/1.jpg",
|
||||||
"Ressourcen/BilderTutorials/Beispiele/2.jpg",
|
$"Ressourcen/BilderTutorials/{folderName}/2.jpg",
|
||||||
"Ressourcen/BilderTutorials/Beispiele/3.jpg"
|
$"Ressourcen/BilderTutorials/{folderName}/3.jpg"
|
||||||
};
|
};
|
||||||
_currentImageIndex = 0;
|
_currentImageIndex = 0;
|
||||||
|
_initialText.IsVisible = false;
|
||||||
|
tutorialImage.IsVisible = true;
|
||||||
UpdateTutorialContent();
|
UpdateTutorialContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateTutorialContent()
|
private void UpdateTutorialContent()
|
||||||
{
|
{
|
||||||
if (_images.Count > 0 && _currentImageIndex >= 0 && _currentImageIndex < _images.Count)
|
try
|
||||||
{
|
{
|
||||||
tutorialImage.Source = new Bitmap(_images[_currentImageIndex]);
|
if (_imageIndexTextBlock == null || _initialText == null || tutorialImage == null) return;
|
||||||
_imageIndexTextBlock.Text = $"Bild {_currentImageIndex + 1} von {_images.Count}";
|
|
||||||
|
if (_images.Count > 0 && _currentImageIndex >= 0 && _currentImageIndex < _images.Count)
|
||||||
|
{
|
||||||
|
string fullPath = $"avares://AquaCare.View/{_images[_currentImageIndex]}";
|
||||||
|
System.Diagnostics.Debug.WriteLine($"Lade Bild: {fullPath}"); // Debug-Ausgabe
|
||||||
|
|
||||||
|
var uri = new Uri(fullPath);
|
||||||
|
var asset = Avalonia.Platform.AssetLoader.Open(uri);
|
||||||
|
tutorialImage.Source = new Bitmap(asset);
|
||||||
|
|
||||||
|
_imageIndexTextBlock.Text = $"Bild {_currentImageIndex + 1} von {_images.Count}";
|
||||||
|
_initialText.IsVisible = false;
|
||||||
|
tutorialImage.IsVisible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (System.Exception ex)
|
||||||
|
{
|
||||||
|
System.Diagnostics.Debug.WriteLine($"Fehler beim Laden des Bildes: {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PreviousImageClick(object? sender, RoutedEventArgs e)
|
private void NavigateImages(bool forward)
|
||||||
{
|
{
|
||||||
if (_currentImageIndex > 0)
|
if (forward)
|
||||||
{
|
{
|
||||||
_currentImageIndex--;
|
_currentImageIndex = _currentImageIndex < _images.Count - 1 ? _currentImageIndex + 1 : 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Wenn wir beim ersten Bild sind, zum letzten springen
|
_currentImageIndex = _currentImageIndex > 0 ? _currentImageIndex - 1 : _images.Count - 1;
|
||||||
_currentImageIndex = _images.Count - 1;
|
|
||||||
}
|
}
|
||||||
UpdateTutorialContent();
|
UpdateTutorialContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NextImageClick(object? sender, RoutedEventArgs e)
|
// Event Handler
|
||||||
{
|
private void FischeFütternClick(object? sender, RoutedEventArgs e)
|
||||||
if (_currentImageIndex < _images.Count - 1)
|
=> LoadTutorialImages("Fische füttern");
|
||||||
{
|
|
||||||
_currentImageIndex++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Wenn wir beim letzten Bild sind, zurück zum ersten springen
|
|
||||||
_currentImageIndex = 0;
|
|
||||||
}
|
|
||||||
UpdateTutorialContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FischeFütternClick(object? sender, RoutedEventArgs e)
|
private void WasserWechselnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
=> LoadTutorialImages("Wasser wechseln");
|
||||||
_images = new List<string>
|
|
||||||
{
|
|
||||||
"Ressourcen/BilderTutorials/Beispiele/1.jpg",
|
|
||||||
"Ressourcen/BilderTutorials/Beispiele/2.jpg",
|
|
||||||
"Ressourcen/BilderTutorials/Beispiele/3.jpg"
|
|
||||||
};
|
|
||||||
_currentImageIndex = 0;
|
|
||||||
UpdateTutorialContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void WasserWechselnClick(object? sender, RoutedEventArgs e)
|
private void FilterReinigenClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
=> LoadTutorialImages("Filter reinigen");
|
||||||
_images = new List<string>
|
|
||||||
{
|
|
||||||
"Ressourcen/BilderTutorials/Beispiele/1.jpg",
|
|
||||||
"Ressourcen/BilderTutorials/Beispiele/2.jpg",
|
|
||||||
"Ressourcen/BilderTutorials/Beispiele/3.jpg"
|
|
||||||
};
|
|
||||||
_currentImageIndex = 0;
|
|
||||||
UpdateTutorialContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FilterReinigenClick(object? sender, RoutedEventArgs e)
|
private void NextImageClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
=> NavigateImages(true);
|
||||||
_images = new List<string>
|
|
||||||
{
|
private void PreviousImageClick(object? sender, RoutedEventArgs e)
|
||||||
"Ressourcen/BilderTutorials/Beispiele/1.jpg",
|
=> NavigateImages(false);
|
||||||
"Ressourcen/BilderTutorials/Beispiele/2.jpg",
|
|
||||||
"Ressourcen/BilderTutorials/Beispiele/3.jpg"
|
private void CloseClick(object? sender, RoutedEventArgs e)
|
||||||
};
|
=> Close();
|
||||||
_currentImageIndex = 0;
|
|
||||||
UpdateTutorialContent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,10 +13,10 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("AquaCare.View")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("AquaCare.View")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+11383fc75a9f1f764ac2f8fef2dd8f2da0c7e2b8")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f15ec9caf02f7612f79e2af762523e526c5e3015")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("AquaCare.View")]
|
[assembly: System.Reflection.AssemblyProductAttribute("AquaCare.View")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("AquaCare.View")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("AquaCare.View")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
||||||
// Generated by the MSBuild WriteCodeFragment class.
|
// Von der MSBuild WriteCodeFragment-Klasse generiert.
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
8a14db02d022de50302e5b23ec47b97276b170631ab2e0c8f66201348cd0502c
|
e30ebb268403392e58bc9de1b5c5f1a317f52bde0ea2d8405683bfbaf7f4e4a8
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
568de61c09a2d71f5b614d8e24749c223f330b05f9d54bd9ed27f337473a5bde
|
711c45fe3adfd872828a1b3d32c232c6b2f78f36b5d6719fd9e24857a1ff86c8
|
||||||
|
|||||||