mirror of
https://github.com/holgerb83/ModernWpfPlayground.git
synced 2025-04-19 23:03:49 +02:00
installed prism
This commit is contained in:
parent
59d93a0212
commit
bd7f504a56
6
App.xaml
6
App.xaml
@ -1,10 +1,10 @@
|
|||||||
<Application
|
<dryIoc:PrismApplication
|
||||||
x:Class="ModernWpfPlayground.App"
|
x:Class="ModernWpfPlayground.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="clr-namespace:ModernWpfPlayground"
|
xmlns:local="clr-namespace:ModernWpfPlayground"
|
||||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
StartupUri="MainWindow.xaml">
|
xmlns:dryIoc="http://prismlibrary.com/">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@ -29,4 +29,4 @@
|
|||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</dryIoc:PrismApplication>
|
||||||
|
15
App.xaml.cs
15
App.xaml.cs
@ -1,9 +1,22 @@
|
|||||||
namespace ModernWpfPlayground
|
using System.Windows;
|
||||||
|
using Prism.Ioc;
|
||||||
|
|
||||||
|
namespace ModernWpfPlayground
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for App.xaml
|
/// Interaction logic for App.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App
|
public partial class App
|
||||||
{
|
{
|
||||||
|
protected override void RegisterTypes(IContainerRegistry containerRegistry)
|
||||||
|
{
|
||||||
|
containerRegistry.Register<MainWindow>();
|
||||||
|
containerRegistry.Register<WindowViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Window CreateShell()
|
||||||
|
{
|
||||||
|
return Container.Resolve<MainWindow>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,14 +11,12 @@
|
|||||||
Title="{Binding Title}"
|
Title="{Binding Title}"
|
||||||
Width="1200"
|
Width="1200"
|
||||||
Height="600"
|
Height="600"
|
||||||
|
d:DataContext="{d:DesignInstance local:WindowViewModel}"
|
||||||
ui:TitleBar.ExtendViewIntoTitleBar="True"
|
ui:TitleBar.ExtendViewIntoTitleBar="True"
|
||||||
ui:WindowHelper.UseModernWindowStyle="True"
|
ui:WindowHelper.UseModernWindowStyle="True"
|
||||||
TextOptions.TextFormattingMode="Display"
|
TextOptions.TextFormattingMode="Display"
|
||||||
UseLayoutRounding="True"
|
UseLayoutRounding="True"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Window.DataContext>
|
|
||||||
<local:WindowViewModel />
|
|
||||||
</Window.DataContext>
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<local:PixelsToGridLengthConverter x:Key="PixelsToGridLength" />
|
<local:PixelsToGridLengthConverter x:Key="PixelsToGridLength" />
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
@ -5,9 +5,10 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow
|
public partial class MainWindow
|
||||||
{
|
{
|
||||||
public MainWindow()
|
public MainWindow(WindowViewModel viewModel)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = viewModel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ModernWpfUI" Version="0.8.1" />
|
<PackageReference Include="ModernWpfUI" Version="0.8.1" />
|
||||||
|
<PackageReference Include="Prism.DryIoc" Version="7.2.0.1422" />
|
||||||
|
<PackageReference Include="Prism.Wpf" Version="7.2.0.1422" />
|
||||||
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
|
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user