Created
February 29, 2016 13:19
-
-
Save vmilev/d35728f46b57422c7524 to your computer and use it in GitHub Desktop.
Share Code Blog 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MyApp.Infrastructure; | |
namespace MyApp.Views | |
{ | |
public sealed partial class MainPage : PageBase | |
{ | |
public MainPage() | |
{ | |
this.InitializeComponent(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MyApp.Infrastructure; | |
namespace MyApp.ViewModels | |
{ | |
public class MainPageViewModel : ViewModelBase | |
{ | |
private string title; | |
public string Title | |
{ | |
get { return this.title; } | |
set { SetProperty(ref title, value); } | |
} | |
public MainPageViewModel() | |
{ | |
this.Title = "Hello, MVVM World!"; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Practices.Prism.Mvvm; | |
namespace MyApp.Infrastructure | |
{ | |
#if NETFX_CORE | |
public abstract partial class PageBase : Windows.UI.Xaml.Controls.Page, IView | |
#else | |
public abstract partial class PageBase : System.Windows.Controls.Page, IView | |
#endif | |
{ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<infrastructure:PageBase | |
xmlns:infrastructure="using:MyApp.Infrastructure" | |
prism:ViewModelLocator.AutoWireViewModel="true" | |
xmlns:prism="using:Microsoft.Practices.Prism.Mvvm" | |
x:Class="MyApp.Views.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:MyApp.Views" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d"> | |
.... | |
</infrastructure:PageBase> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Practices.Prism.Mvvm; | |
namespace MyApp.Infrastructure | |
{ | |
#if NETFX_CORE | |
public abstract partial class ViewModelBase : ViewModel | |
#else | |
public abstract partial class ViewModelBase : BindableBase | |
#endif | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment