0

I've written an installer with a WPF UI. During the installation of a pre-requisite, the full screen WPF ui loses focus and task bar appears for some time. Currently below is how my window element looks.

<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" Width="1431" MinWidth="400" Height="588.9" MinHeight="300" ResizeMode="NoResize" WindowState="Maximized" ShowInTaskbar="False" Topmost="False" WindowStartupLocation="CenterOwner" WindowStyle="None" Background="#FF222222">

How can I avoid it from losing focus and showing the task bar? Any help would be much appreciated.

AnOldSoul
  • 4,017
  • 12
  • 57
  • 118
  • 1
    Set the `Topmost` property to true. –  Jun 29 '16 at 00:57
  • Tried it now. Still the same behavior. For few seconds the task bar pops up above the UI – AnOldSoul Jun 29 '16 at 02:21
  • Maybe the `WindowStartupLocation` or `ResizeMode` properties are affecting your borderless maximized window. –  Jun 29 '16 at 02:24
  • tried all 3 values for that property. Still no luck :( – AnOldSoul Jun 29 '16 at 02:29
  • Maybe just remove them altogether. –  Jun 29 '16 at 02:30
  • That didn't work as well. WPF is so frustrating! – AnOldSoul Jun 29 '16 at 02:33
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/115911/discussion-between-shad0wk-and-mayooran). –  Jun 29 '16 at 02:40
  • Few questions: What other thing is the installer doing, like running a batch file or anything that pops another window? There are 2 ways of showing the a WPF window, which one are you using? – tgpdyk Jun 29 '16 at 02:42
  • The installer checks for pre-requisites presence and installs them. Then it installs a windows service, writes to the registries and starts the service. Then it copies some files and folders. That's all. And I don't get the second question. Are you asking about the XAML contents? – AnOldSoul Jun 29 '16 at 02:55
  • No. You could MainView.Show or MainView.ShowDialog http://stackoverflow.com/questions/14835095/completely-modal-wpf-window – tgpdyk Jun 29 '16 at 04:18
  • @tgpdyk tried both. still no luck. same behavior – AnOldSoul Jun 30 '16 at 00:28

0 Answers0