diff --git a/Magazyn_Client/Magazyn/App.xaml.cs b/Magazyn_Client/Magazyn/App.xaml.cs
index 4461381..64ce2f8 100644
--- a/Magazyn_Client/Magazyn/App.xaml.cs
+++ b/Magazyn_Client/Magazyn/App.xaml.cs
@@ -13,5 +13,39 @@ namespace Magazyn
///
public partial class App : Application
{
+ public void ChangeTheme(int index)
+ {
+ Resources.MergedDictionaries.Clear();
+ Uri[] uris = new Uri[4];
+
+ uris[1] = new Uri("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml");
+
+ switch (index % 3) {
+ case 0:
+ uris[0] = new Uri("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml");
+ uris[2] = new Uri("pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml");
+ uris[3] = new Uri("pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Cyan.xaml");
+ break;
+
+ case 1:
+ uris[0] = new Uri("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml");
+ uris[2] = new Uri("pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Lime.xaml");
+ uris[3] = new Uri("pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Green.xaml");
+ break;
+
+ case 2:
+ uris[0] = new Uri("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml");
+ uris[2] = new Uri("pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepOrange.xaml");
+ uris[3] = new Uri("pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Orange.xaml");
+ break;
+ }
+
+ Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = uris[0] });
+ Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = uris[1] });
+ Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = uris[2] });
+ Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = uris[3] });
+
+ }
+
}
}
diff --git a/Magazyn_Client/Magazyn/Magazyn.csproj b/Magazyn_Client/Magazyn/Magazyn.csproj
index 5c4a801..939a4e8 100644
--- a/Magazyn_Client/Magazyn/Magazyn.csproj
+++ b/Magazyn_Client/Magazyn/Magazyn.csproj
@@ -133,7 +133,9 @@
-
+
+ Designer
+
diff --git a/Magazyn_Client/Magazyn/MainWindow.xaml b/Magazyn_Client/Magazyn/MainWindow.xaml
index aa7ac06..9849de2 100644
--- a/Magazyn_Client/Magazyn/MainWindow.xaml
+++ b/Magazyn_Client/Magazyn/MainWindow.xaml
@@ -23,6 +23,7 @@
+
diff --git a/Magazyn_Client/Magazyn/MainWindow.xaml.cs b/Magazyn_Client/Magazyn/MainWindow.xaml.cs
index fda40b9..5cc8b41 100644
--- a/Magazyn_Client/Magazyn/MainWindow.xaml.cs
+++ b/Magazyn_Client/Magazyn/MainWindow.xaml.cs
@@ -25,6 +25,7 @@ namespace Magazyn
{
public partial class MainWindow : Window
{
+
public int size = 4;
public int page = 0;
@@ -36,8 +37,12 @@ namespace Magazyn
public MainWindow()
{
InitializeComponent();
- this.Initialized += MainWindow_Initialized; ;
-
+ this.Initialized += MainWindow_Initialized;
+ themeCombo.Items.Add("Jasno/Niebieski");
+ themeCombo.Items.Add("Jasno/Zielony");
+ themeCombo.Items.Add("Ciemno/Pomarańczowy");
+ themeCombo.SelectedIndex = 0;
+
client = new HttpClient();
}
@@ -152,6 +157,12 @@ namespace Magazyn
this.size = (int)(height / 90);
RefreshListOfFruits();
}
+
+ private void themeCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ var app = App.Current as App;
+ app.ChangeTheme(themeCombo.SelectedIndex);
+ }
}
}