Added Edit_OnClick(), fixed issues MAGN4505

Issue:http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4505
@Benglin Please review it. Thanks
Hard casting will cause a crash, it will never be ```null```. If we are expecting possible types other than the one we need, then we should use dynamic casting, in which case it might return ```null``` when the type does not match up, as such:

```cs
var menuItem = sender as MenuItem;
if (menuItem != null)
{
    var element = menuItem.DataContext as CustomNodeSearchElement;
    if (element != null)
    {
        if (dynamoViewModel.OpenCommand.CanExecute(element.Path))
            dynamoViewModel.OpenCommand.Execute(element.Path);
    }
}
```