Category / Section
How can I hide or show the header of a Taskbar through code?
1 min read
The header of the TaskBar can be hidden or shown through code. The following example shows how to hide or show the header of the TaskBar.
[C#]
//set the header as visible using the header style
Setter ss = new Setter();
Style style = new Style();
ss.Property = TaskBar.VisibilityProperty;
ss.Value = Visibility.Visible;
style.Setters.Add(ss);
TaskBar.SetValue(TaskBar.HeaderStyleProperty, style);
//set the header to collpased using the header style
Setter ss = new Setter();
Style style = new Style();
ss.Property = TaskBar.VisibilityProperty;
ss.Value = Visibility.Collapsed;
style.Setters.Add(ss);
TaskBar.SetValue(TaskBar.HeaderStyleProperty, style);