If you create app and show modal window inside, and then click outside modal, your window will 'flash'.
How can it be done with custom controls, not windows?
If you create app and show modal window inside, and then click outside modal, your window will 'flash'.
How can it be done with custom controls, not windows?
The custom window you are using doesn't show a Windows titlebar, hence you cannot see the flashing effect. To make your custom titlebar flash, you'll have to do some work.
I'm not sure this will actually work, but you need to detect the message windows is sending to the Window to make it flash. Look here to see how you can get notified of messages received by the window. This is the code from that page:
using System;
using System.Windows;
using System.Windows.Interop;
namespace WpfApplication1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
HwndSource source = PresentationSource.FromVisual(this) as HwndSource;
source.AddHook(WndProc);
}
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
// Write some debug messages to the console here to detect what message is sent to the window when you click behind an active modal dialog
return IntPtr.Zero;
}
}
}
Note my comment in the code.
If that works, you can from there trigger an animation in XAML to mimic the flashing effect.
For interest's sake, does the application flash in the taskbar?