private void Button_PreviewMouseUp(object sender, MouseButtonEventArgs e) { switch (ButtonFunction) { case buttonFunction.SetBitWhileKeyPressed: PLCConnection.WriteTag(ControlTag, false); break; case buttonFunction.InvertBit: break; case buttonFunction.SetBit: break; case buttonFunction.ResetBit: break; } }