I have created a borderless window in WPF. I have written a event to maximize the window but on maximizing, part of the window sometimes hides behind the task bar and after a moment appears on top of the task bar.
How can I ensure that the window remains on top of task bar every time ? Following is the way I have implemented:
private void OnMaximizedClicked(object sender, RoutedEventArgs e)
{
this.WindowState = this.WindowState != WindowState.Normal ? WindowState.Normal : WindowState.Maximized;
}
I have tried setting the TopMost property to true, but didn't help me either.