diff --git a/Magazyn_Client/Magazyn/App.xaml b/Magazyn_Client/Magazyn/App.xaml
index 7e77365..309f94e 100644
--- a/Magazyn_Client/Magazyn/App.xaml
+++ b/Magazyn_Client/Magazyn/App.xaml
@@ -6,11 +6,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/Magazyn_Client/Magazyn/MainWindow.xaml b/Magazyn_Client/Magazyn/MainWindow.xaml
index 8166ccd..e7d530a 100644
--- a/Magazyn_Client/Magazyn/MainWindow.xaml
+++ b/Magazyn_Client/Magazyn/MainWindow.xaml
@@ -1,23 +1,28 @@
-
-
+ Title="Magazyn Owoców" Height="400" MaxWidth="590" MinWidth="590" Width="590">
+
+
-
-
-
+
+
-
+
-
+
diff --git a/Magazyn_Client/Magazyn/MainWindow.xaml.cs b/Magazyn_Client/Magazyn/MainWindow.xaml.cs
index ff7ee50..aae5b5d 100644
--- a/Magazyn_Client/Magazyn/MainWindow.xaml.cs
+++ b/Magazyn_Client/Magazyn/MainWindow.xaml.cs
@@ -16,6 +16,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
namespace Magazyn
{
@@ -28,7 +29,6 @@ namespace Magazyn
public MainWindow()
{
InitializeComponent();
- loadingContent.IsIndeterminate = true;
client = new HttpClient();
RefreshListOfFruits();
}
@@ -52,16 +52,15 @@ namespace Magazyn
private void RefreshListOfFruits()
{
- loadingContent.Visibility = Visibility.Visible;
- loadingContent.IsIndeterminate = true;
- Task response = client.GetAsync("https://sysmag.herokuapp.com/api/get-all");
- while (response.IsCompleted != true)
- {
- loadingContent.IsIndeterminate = false;
- loadingContent.Visibility = Visibility.Hidden;
- }
- Fruit[] fruits = JsonConvert.DeserializeObject(response.Result.Content.ReadAsStringAsync().Result.ToString());
+ Task response = client.GetAsync("https://sysmag.herokuapp.com/api/get-all");
+ while (response.IsCompleted != true) ;
+
+ string responseString = response.Result.Content.ReadAsStringAsync().Result;
+
+ JObject replay = JObject.Parse(responseString);
+
+ Fruit[] fruits = JsonConvert.DeserializeObject(replay["content"].ToString());
UpdateListOfFruits(fruits);
}
diff --git a/Magazyn_Client/Magazyn/Views/FruitView.xaml b/Magazyn_Client/Magazyn/Views/FruitView.xaml
index 13e29f4..a9401d9 100644
--- a/Magazyn_Client/Magazyn/Views/FruitView.xaml
+++ b/Magazyn_Client/Magazyn/Views/FruitView.xaml
@@ -9,8 +9,8 @@
mc:Ignorable="d" Height="64" Width="520">
-
-
+
+
diff --git a/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs b/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs
index 932872d..47098aa 100644
--- a/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs
+++ b/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs
@@ -54,6 +54,7 @@ namespace Magazyn.Views
{
AmountWindow window = new AmountWindow(fruit, -1, fruit.Quantity);
window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
+ window.Owner = Application.Current.MainWindow;
window.ShowDialog();
}
@@ -61,6 +62,7 @@ namespace Magazyn.Views
{
AmountWindow window = new AmountWindow(fruit, 1, fruit.Quantity);
window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
+ window.Owner = Application.Current.MainWindow;
window.ShowDialog();
}
diff --git a/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml b/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml
index 3eb241e..dcdd3b1 100644
--- a/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml
+++ b/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml
@@ -1,11 +1,21 @@
+ Title="Magazyn" WindowStartupLocation="CenterOwner" Height="205" Width="220">