Added Edit_OnClick(), fixed issues MAGN4505

Issue:http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4505
@Benglin Please review it. Thanks
Yes, it will be ```null``` if ```menuItem.DataContext``` is ```null``` or a type that is not ```CustomNodeSearchElement```. I thought I already wrote the code for you in my original comment?