C# Class Estro.TinyGest.Presentation.ViewModel.Locator

This class contains static references to all the view models in the application and provides an entry point for the bindings.

Use the mvvmlocatorproperty snippet to add ViewModels to this locator.

In Silverlight and WPF, place the MvvmViewModelLocator1 in the App.xaml resources:

<Application.Resources> <vm:MvvmViewModelLocator1 xmlns:vm="clr-namespace:Estro.TinyGest.Presentation.ViewModel" x:Key="Locator" /> </Application.Resources>

Then use:

DataContext="{Binding Source={StaticResource Locator}, Path=ViewModelName}"

You can also use Blend to do all this with the tool's support.

See http://www.galasoft.ch/mvvm/getstarted

In *WPF only* (and if databinding in Blend is not relevant), you can delete the ViewModelName property and bind to the ViewModelNameStatic property instead:

xmlns:vm="clr-namespace:Estro.TinyGest.Presentation.ViewModel" DataContext="{Binding Source={x:Static vm:MvvmViewModelLocator1.ViewModelNameStatic}}"
ファイルを表示 Open project: AugustoSansoni/TinyGest

Private Properties

Property Type Description

Public Methods

Method Description
Cleanup ( ) : void

Cleans up all the resources.

Locator ( ) : System.Diagnostics.CodeAnalysis

Initializes a new instance of the ViewModelLocator class.

Method Details

Cleanup() public static method

Cleans up all the resources.
public static Cleanup ( ) : void
return void

Locator() public method

Initializes a new instance of the ViewModelLocator class.
public Locator ( ) : System.Diagnostics.CodeAnalysis
return System.Diagnostics.CodeAnalysis