fix #451: InvalidOperationException when creating event handler for Slider.ValueChanged