diff --git a/App.xaml b/App.xaml index 4836c1e..96fda22 100644 --- a/App.xaml +++ b/App.xaml @@ -1,10 +1,10 @@ - + xmlns:dryIoc="http://prismlibrary.com/"> @@ -29,4 +29,4 @@ - + diff --git a/App.xaml.cs b/App.xaml.cs index 1547525..a5b3a32 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -1,9 +1,22 @@ -namespace ModernWpfPlayground +using System.Windows; +using Prism.Ioc; + +namespace ModernWpfPlayground { /// /// Interaction logic for App.xaml /// public partial class App { + protected override void RegisterTypes(IContainerRegistry containerRegistry) + { + containerRegistry.Register(); + containerRegistry.Register(); + } + + protected override Window CreateShell() + { + return Container.Resolve(); + } } } diff --git a/MainWindow.xaml b/MainWindow.xaml index a043338..b4cced2 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -11,14 +11,12 @@ Title="{Binding Title}" Width="1200" Height="600" + d:DataContext="{d:DesignInstance local:WindowViewModel}" ui:TitleBar.ExtendViewIntoTitleBar="True" ui:WindowHelper.UseModernWindowStyle="True" TextOptions.TextFormattingMode="Display" UseLayoutRounding="True" mc:Ignorable="d"> - - - diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 179bfca..e49fb9a 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -5,9 +5,10 @@ /// public partial class MainWindow { - public MainWindow() + public MainWindow(WindowViewModel viewModel) { InitializeComponent(); + DataContext = viewModel; } } } diff --git a/ModernWpfPlayground.csproj b/ModernWpfPlayground.csproj index 7983e8c..989f55f 100644 --- a/ModernWpfPlayground.csproj +++ b/ModernWpfPlayground.csproj @@ -9,6 +9,8 @@ + +