public void Execute(object parameter) { string type = (string)parameter; ToolType result; if (ToolType.TryParse(type, true, out result)) { _viewModel.GetTool(result); } if (result != ToolType.Bucket) { _viewModel.ResetTools(); } }