diff --git a/Elwig/Windows/TestWindow.xaml b/Elwig/Windows/TestWindow.xaml
index 73f3a16..57e9680 100644
--- a/Elwig/Windows/TestWindow.xaml
+++ b/Elwig/Windows/TestWindow.xaml
@@ -13,5 +13,8 @@
ItemSelectionChanged="OnItemSelectionChanged"/>
+
+
+
diff --git a/Elwig/Windows/TestWindow.xaml.cs b/Elwig/Windows/TestWindow.xaml.cs
index db71df3..30164ef 100644
--- a/Elwig/Windows/TestWindow.xaml.cs
+++ b/Elwig/Windows/TestWindow.xaml.cs
@@ -1,3 +1,4 @@
+using System;
using System.Linq;
using System.Windows;
using Xceed.Wpf.Toolkit.Primitives;
@@ -13,5 +14,25 @@ namespace Elwig.Windows {
private void OnItemSelectionChanged(object sender, ItemSelectionChangedEventArgs e) {
MyText.Text = string.Join(", ", MyComboBox.SelectedItems.Cast());
}
+
+ private async void WeighingButton1_Click(object sender, RoutedEventArgs evt) {
+ try {
+ var res = await App.Scales[0].GetCurrentWeight();
+ Output.Text = res.ToString();
+ } catch (Exception e) {
+ MessageBox.Show($"Beim Wiegen ist ein Fehler aufgetreten:\n\n{e.Message}", "Waagenfehler",
+ MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
+
+ private async void WeighingButton2_Click(object sender, RoutedEventArgs evt) {
+ try {
+ var res = await App.Scales[0].Weigh();
+ Output.Text = res.ToString();
+ } catch (Exception e) {
+ MessageBox.Show($"Beim Wiegen ist ein Fehler aufgetreten:\n\n{e.Message}", "Waagenfehler",
+ MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
}
}