public void SetMode(BaseTool mode) { CurrentTool?.DeInit(); CurrentTool = mode; CurrentTool?.Init(); if (CurrentTool?.ShowPanel == true) { Panel.Show(); } else { Panel.Hide(); } }