System.Windows.Controls.ViewModelAttribute.GetViewModel C# (CSharp) Method

GetViewModel() public static method

Gets the view model instance attached to the specified control.
public static GetViewModel ( System.Windows.Controls.UserControl userControl ) : object
userControl System.Windows.Controls.UserControl The control to lookup.
return object
        public static object GetViewModel(UserControl userControl)
        {
            return userControl.GetValue(ViewModelProperty);
        }