protected override UserControl CreateStateControl(StateKeyLayout layout, StateShowHideContainer <UserControl> list, double left, double top, double width, double height, bool isVisible) { var control = CreateControl <StateKeytop>(layout, left, top, width, height, isVisible); control.StateName = layout.StateName; control.Vocal = layout.Vocal; control.TheKeytop.Click += (s, e) => Apply(list); return(control); }
void Apply(StateShowHideContainer <UserControl> list) { foreach (var control in list.HideList) { control.Visibility = Visibility.Collapsed; } foreach (var control in list.ShowList) { control.Visibility = Visibility.Visible; } }