Remade to WPF. Need to find appropriate event