Skip to content

Commit

Permalink
Remove app style selector from demo app, since it broken anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
SKProCH committed Oct 9, 2023
1 parent ebd50c4 commit c9528e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.1" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.1" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.1" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ShowMeTheXaml.Avalonia.AvaloniaEdit\ShowMeTheXaml.Avalonia.AvaloniaEdit.csproj" />
Expand Down
27 changes: 7 additions & 20 deletions ShowMeTheXaml.Avalonia.Demo/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,13 @@
<vm:MainWindowViewModel />
</Design.DataContext>
<StackPanel>
<Grid RowDefinitions="Auto Auto *">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<ComboBox Name="StyleSelector"
SelectionChanged="StyleSelector_OnSelectionChanged"
Margin="4"
SelectedIndex="0">
<ComboBoxItem>AvaloniaEdit Style</ComboBoxItem>
<ComboBoxItem>Default Style</ComboBoxItem>
</ComboBox>
<ComboBox x:Name="ThemeSelector"
SelectionChanged="ThemeSelector_OnSelectionChanged"
Margin="4"
SelectedIndex="1">
<ComboBox.Items>
<models:CatalogTheme>Fluent</models:CatalogTheme>
<models:CatalogTheme>Simple</models:CatalogTheme>
</ComboBox.Items>
</ComboBox>
</StackPanel>
</Grid>
<ComboBox Name="StyleSelector" HorizontalAlignment="Center"
SelectionChanged="StyleSelector_OnSelectionChanged"
Margin="4"
SelectedIndex="0">
<ComboBoxItem>AvaloniaEdit Style</ComboBoxItem>
<ComboBoxItem>Default Style</ComboBoxItem>
</ComboBox>

<showMeTheXaml:XamlDisplay UniqueId="123" HorizontalAlignment="Center">
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center" />
Expand Down
18 changes: 0 additions & 18 deletions ShowMeTheXaml.Avalonia.Demo/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,5 @@ private void StyleSelector_OnSelectionChanged(object sender, SelectionChangedEve
: App.XamlDisplayDefaultStyles;
Application.Current!.Styles[1] = styleSource;
}

private void ThemeSelector_OnSelectionChanged(object sender, SelectionChangedEventArgs e) {
try {
var theme = (CatalogTheme)((ComboBox)sender).SelectedItem!;
if (theme == CatalogTheme.Fluent)
{
Application.Current!.Styles[0] = App.Fluent;
}
else if (theme == CatalogTheme.Simple)
{
Application.Current!.Styles[0] = App.Simple;
}
}
catch (Exception exception) {
Console.WriteLine(exception);
throw;
}
}
}
}

0 comments on commit c9528e4

Please sign in to comment.