Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
kolei committed May 6, 2024
1 parent 3afc136 commit e5c55c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions articles/wpf_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,9 @@ public partial class MainWindow : Window
private void ToggleView_Click(object sender, RoutedEventArgs e)
{
currentStyle = currentStyle == "StackStyle" ? "WrapStyle" : "StackStyle";
MyListBox.Style = (Style)this.FindResource(currentStyle);

var newStyle = (Style)TryFindResource(currentStyle)
if (newStyle != null)
catListBox.Style = newStyle;
}
```

Expand Down

0 comments on commit e5c55c5

Please sign in to comment.