1
votes

I have the following WPF window definition but the focus/lost focus events are not firing when I click away from the application, any ideas?

<Window x:Class="BevaClient.windowMain"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:l="clr-namespace:BevaClient"
    xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    Title="VPN Tool" Height="500" Width="370"
    Focusable="True"
    WindowStyle="None"
    ResizeMode="NoResize"
    Topmost="True"
    Style="{StaticResource defaultWindow}"
    Loaded="Window_Loaded"
    GotFocus="Window_GotFocus"
    LostFocus="Window_LostFocus">

I have tried setting topmost to false to see if this was the issue but it makes no difference.

Any advice on this issue would be very much appreciated.

Thanks,

David

1

1 Answers

1
votes

Hook to Activated and Deactivated events instead.