Not true! It does work as you would expect. Your problem is: you handle
Checked
and do not handle
Unchecked
.
This is a complete solution (assuming you created a check box
checkBoxShowInTaskbar
in XAML):
public partial class MyWindow : Window {
public MyWindow() {
InitializeComponent();
checkBoxShowInTaskbar.Checked += (sender, eventArgs) =>
{ this.ShowInTaskbar = true; };
checkBoxShowInTaskbar.Unchecked += (sender, eventArgs) =>
{ this.ShowInTaskbar = false; };
}
}
The solution is tested; it works.
—SA