MVVMbasics Logo

mobilemotion.eu Logo


Back to Class Reference home page


MVVMbasics.Attributes
Class MvvmNavigationTargetAttribute

System.Attribute
  extended by 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

MvvmNavigationTargetAttribute

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.

Parameters:

viewmodel - Type of the Viewmodel this View class should be bound to (must be a subclass of BaseViewmodel).


MvvmNavigationTargetAttribute

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.

Parameters:

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

GetViewmodel

public Type GetViewmodel()

Returns the type of the Viewmodel bound to this View class.

Returns:

Type of the Viewmodel bound to this View class.


HasPath

public bool HasPath()

Checks if a path to the XAML file representing this View class was specified.

Returns:

TRUE if a path was specified for this View class, FALSE otherwise


GetPath

public string GetPath()

Returns the path to the XAML file representing this View class, if specified.

Returns:

Path to the XAML file representing this View class.