private void Reset() { if (_ruleAppDef != null) { _ruleAppDef.Dispose(); } if (_controlFactory != null) { _controlFactory.Dispose(); } elementHost1.Child = null; }