C# 클래스 System.Windows.Controls.ViewModelAttribute

상속: System.Attribute
파일 보기 프로젝트 열기: nikhilk/silverlightfx

공개 메소드들

메소드 설명
CreateViewModel ( System.Windows.Controls.UserControl userControl ) : object

Creates a view model for the specified view. This uses the view model type specified using a ViewModelAttribute if one is specified, and falls back to convention. The convention locates a type in the same namespace/assembly as the view, with a type name formed by adding the 'Model' or 'ViewModel' suffix to the view's type name.

GetCurrentViewModel ( FrameworkElement element ) : object

Gets the model associated with the specified framework element. This will walk up the parent hierarchy to find a model if the specified element does not have a model.

GetViewModel ( System.Windows.Controls.UserControl userControl ) : object

Gets the view model instance attached to the specified control.

SetViewModel ( System.Windows.Controls.UserControl userControl, object value ) : void

Sets the view model instance attached to the specified control. The view model is also used as the DataContext assigned to the control.

ViewModelAttribute ( Type viewModelType ) : System

Initializes an instance of a ViewModelAttribute.

메소드 상세

CreateViewModel() 공개 정적인 메소드

Creates a view model for the specified view. This uses the view model type specified using a ViewModelAttribute if one is specified, and falls back to convention. The convention locates a type in the same namespace/assembly as the view, with a type name formed by adding the 'Model' or 'ViewModel' suffix to the view's type name.
public static CreateViewModel ( System.Windows.Controls.UserControl userControl ) : object
userControl System.Windows.Controls.UserControl The control for which the view model must be created.
리턴 object

GetCurrentViewModel() 공개 정적인 메소드

Gets the model associated with the specified framework element. This will walk up the parent hierarchy to find a model if the specified element does not have a model.
public static GetCurrentViewModel ( FrameworkElement element ) : object
element System.Windows.FrameworkElement The element to lookup.
리턴 object

GetViewModel() 공개 정적인 메소드

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.
리턴 object

SetViewModel() 공개 정적인 메소드

Sets the view model instance attached to the specified control. The view model is also used as the DataContext assigned to the control.
public static SetViewModel ( System.Windows.Controls.UserControl userControl, object value ) : void
userControl System.Windows.Controls.UserControl The control to associated the view model with.
value object The view model instance.
리턴 void

ViewModelAttribute() 공개 메소드

Initializes an instance of a ViewModelAttribute.
public ViewModelAttribute ( Type viewModelType ) : System
viewModelType System.Type The type of the associated view model.
리턴 System