I'm creating an installer which has WPF front end. When I launch a pre-requisite installation from my code, the installer loses focus. As a result the task bar is displayed. I do not want the task bar to be displayed at any stage when the UI is running. I tried to add hooks to the window activated and deactivated events but they do not work as well. Below is my code. Please advice.
<Window x:Class="CustomBA.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resources="clr-namespace:KubeCustomBA.Resources"
mc:Ignorable="d"
Title="Installer" Activated="window_Activated" Deactivated="Window_Deactivated" Width="1431" MinWidth="400" Height="588.9" MinHeight="300" ResizeMode="NoResize" WindowStyle="None" WindowState="Maximized" ShowInTaskbar="False" Topmost="False" WindowStartupLocation="CenterOwner" Background="#FF222222">
void window_Activated(object sender, EventArgs e)
{
this.Width = System.Windows.SystemParameters.PrimaryScreenWidth;
this.Height = System.Windows.SystemParameters.PrimaryScreenHeight;
this.Topmost = true;
this.Top = 0;
this.Left = 0;
}
private void Window_Deactivated(object sender, EventArgs e)
{
this.Topmost = true;
this.Activate();
}