Overview Q & A Rating & Review
Windows Store MVVM Template A bare bones starter template for Windows Store 8.1 Projects that Utilizes the Model View View Model Pattern
You can download the template from the
Visual Studio Extension Gallery You can fork or contribute to the template on
github.com/KyleMit/WindowsStoreMvvmTemplate You can leave comments and read more on my blogger page at
CodingEverything.blogspot.com Directory: Here's a breakdown of the directory structure:
Assets : contains images for the Package.appxmanifest
Model : contains core business logic for the application Resources : contains common resources for the whole applicationAppResources.xaml : contains xaml resources that is added to App.Resources
Utilities : contains reusable helper classes that can be used in this, and other, projects.BindableBase.vb : implements INotifyPropertyChanged
which can be inherited by classes in you ViewModelNavigationHelper.vb : adds Navigation support and Process Lifetime ManagementRelayCommand.vb : implements ICommand
to help invoke delegates through binding. SuspensionManager.vb : captures global session state to simplify process lifetime managementView : contains views for the User Interface layer of the applicationMainView.xaml : has the initial window that the application launchesViewModel : contains classes which help communicate between theView
and the Model
MainViewModel.vb : contains the business logic for MainView.xaml
App.xaml : contains resources scoped to the entire applicationApp.xaml.vb : contains startup code for the application
Samples: Binding MainView.xaml
<button content="Say Hello" command="{Binding SayHelloCommand}" />
MainViewMode.vb
Private _personName As StringPublic Property PersonName As String Get Return _personName End Get Set(ByVal value As String) SetProperty(_personName, value) End SetEnd Property
Commands MainView.xaml
<button content="Say Hello" command="{Binding SayHelloCommand}" />
MainViewMode.vb
Private _sayHelloCommand As RelayCommandPublic ReadOnly Property SayHelloCommand As RelayCommand Get If _sayHelloCommand Is Nothing Then _sayHelloCommand = New RelayCommand(Async Sub() Await SayHello()) End If Return _sayHelloCommand End GetEnd Property
Contact: Reach Me At: