Windows Store MVVM Template

Windows Store MVVM Template - Hallo sahabat Jendela Dunia Internet Dan Tekhnologi, Pada Artikel yang anda baca kali ini dengan judul Windows Store MVVM Template, kami telah mempersiapkan artikel ini dengan baik untuk anda baca dan ambil informasi didalamnya. mudah-mudahan isi postingan Artikel MVVM, Artikel Windows8.1, Artikel WindowsStore, Artikel winRT, Artikel XAML, yang kami tulis ini dapat anda pahami. baiklah, selamat membaca.

Judul : Windows Store MVVM Template
link : Windows Store MVVM Template

Baca juga


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

Directory:

Here’s a breakdown of the directory structure:

directory

  • Assets: contains images for the Package.appxmanifest
  • Model: contains core business logic for the application
  • Resources: contains common resources for the whole application
    • AppResources.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 ViewModel
    • NavigationHelper.vb: adds Navigation support and Process Lifetime Management
    • RelayCommand.vb: implements ICommand to help invoke delegates through binding.
    • SuspensionManager.vb: captures global session state to simplify process lifetime management
  • View: contains views for the User Interface layer of the application
    • MainView.xaml: has the initial window that the application launches
  • ViewModel: contains classes which help communicate between the View and the Model
    • MainViewModel.vb: contains the business logic for MainView.xaml
  • App.xaml: contains resources scoped to the entire application
    • App.xaml.vb: contains startup code for the application

Samples:

Binding

MainView.xaml

<TextBox Text="{Binding PersonName}" />

MainViewModel.vb

Private _personName As String
Public Property PersonName As String
Get
Return _personName
End Get
Set(ByVal value As String)
SetProperty(_personName, value)
End Set
End Property

MainViewModel.cs

private string _propertyName;
public string PropertyName {
get { return _propertyName; }
set { SetProperty(ref _propertyName, value); }
}

Commands

MainView.xaml

<button content="Say Hello" command="{Binding SayHelloCommand}" />

MainViewModel.vb

Public ReadOnly Property EnterNameCommand As RelayCommand
Get
If _enterNameCommand Is Nothing Then
_enterNameCommand = New RelayCommand(Async Sub() Await EnterName())
End If
Return _enterNameCommand
End Get
End Property

Private Function EnterName() As Task
'do awaitable stuff here
End Function


Demikianlah Artikel Windows Store MVVM Template

Sekianlah artikel Windows Store MVVM Template kali ini, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sampai jumpa di postingan artikel lainnya.

Anda sekarang membaca artikel Windows Store MVVM Template dengan alamat link http://jendeladuniainternet.blogspot.com/2013/11/windows-store-mvvm-template.html

0 Response to "Windows Store MVVM Template"

Posting Komentar