1
0
forked from s434786/DINO_SCRUM

Merge branch 'master' of s442333/DINO_SCRUM into master

This commit is contained in:
s1202077 2019-01-22 23:36:24 +00:00 committed by Gogs
commit 71a4d4e2ae
4 changed files with 51 additions and 3 deletions

View File

@ -13,5 +13,39 @@ namespace Magazyn
/// </summary> /// </summary>
public partial class App : Application 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] });
}
} }
} }

View File

@ -133,7 +133,9 @@
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Images\add.png" /> <Resource Include="Images\add.png" />

View File

@ -23,6 +23,7 @@
<Label Content="Lista owoców:" FontWeight="Bold" HorizontalAlignment="Left" Margin="10,4,0,0" VerticalAlignment="Top" Width="100"/> <Label Content="Lista owoców:" FontWeight="Bold" HorizontalAlignment="Left" Margin="10,4,0,0" VerticalAlignment="Top" Width="100"/>
<Button x:Name="prevButton" Content="Poprzednia" HorizontalAlignment="Left" Margin="10,0,0,52" VerticalAlignment="Bottom" Width="105" Click="prevButton_Click"/> <Button x:Name="prevButton" Content="Poprzednia" HorizontalAlignment="Left" Margin="10,0,0,52" VerticalAlignment="Bottom" Width="105" Click="prevButton_Click"/>
<Button x:Name="nextButton" Content="Następna" HorizontalAlignment="Right" Margin="0,0,10,52" VerticalAlignment="Bottom" Width="105" Click="nextButton_Click"/> <Button x:Name="nextButton" Content="Następna" HorizontalAlignment="Right" Margin="0,0,10,52" VerticalAlignment="Bottom" Width="105" Click="nextButton_Click"/>
<ComboBox SelectionChanged="themeCombo_SelectionChanged" x:Name="themeCombo" HorizontalAlignment="Left" Margin="10,0,0,10" VerticalAlignment="Bottom" Width="162"/>
</Grid> </Grid>

View File

@ -25,6 +25,7 @@ namespace Magazyn
{ {
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
public int size = 4; public int size = 4;
public int page = 0; public int page = 0;
@ -36,7 +37,11 @@ namespace Magazyn
public MainWindow() public MainWindow()
{ {
InitializeComponent(); 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(); client = new HttpClient();
} }
@ -152,6 +157,12 @@ namespace Magazyn
this.size = (int)(height / 90); this.size = (int)(height / 90);
RefreshListOfFruits(); RefreshListOfFruits();
} }
private void themeCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var app = App.Current as App;
app.ChangeTheme(themeCombo.SelectedIndex);
}
} }
} }