Back to Class Reference home page
System.Attribute
MVVMbasics.Attributes.MvvmNavigationTargetAttribute
AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class MvvmNavigationTargetAttribute : Attribute
Attribute to be applied to View classes. Allows the binding of a given Viewmodel type to this View class.
Constructor Summary | |
---|---|
public |
MvvmNavigationTargetAttribute(Type viewmodel)
Constructor that allows to specify Viewmodel. The path to the XAML file representing this View class will be retrieved from the View's namespace. |
public |
MvvmNavigationTargetAttribute(Type viewmodel, string path)
Constructor that allows to specify Viewmodel and path. This constructor should be used, if the path of the XAML file representing this View class does not correspond to the View's namespace. |
Method Summary | |
---|---|
Type |
GetViewmodel()
Returns the type of the Viewmodel bound to this View class. |
bool |
HasPath()
Checks if a path to the XAML file representing this View class was specified. |
string |
GetPath()
Returns the path to the XAML file representing this View class, if specified. |
Constructor Detail |
---|
public MvvmNavigationTargetAttribute(Type viewmodel)
Constructor that allows to specify Viewmodel. The path to the XAML file representing this View class will be retrieved from the View's namespace.
viewmodel
- Type of the Viewmodel this View class should be bound to (must be a subclass of BaseViewmodel).
public MvvmNavigationTargetAttribute(Type viewmodel, string path)
Constructor that allows to specify Viewmodel and path. This constructor should be used, if the path of the XAML file representing this View class does not correspond to the View's namespace.
viewmodel
- Type of the Viewmodel this View class should be bound to (must be a subclass of BaseViewmodel).
path
- Path to the XAML file representing this View class.
Method Detail |
---|
public Type GetViewmodel()
Returns the type of the Viewmodel bound to this View class.
Type of the Viewmodel bound to this View class.
public bool HasPath()
Checks if a path to the XAML file representing this View class was specified.
TRUE if a path was specified for this View class, FALSE otherwise
public string GetPath()
Returns the path to the XAML file representing this View class, if specified.
Path to the XAML file representing this View class.