νμ¬ κ°λ° μ€μΈ WPF ν
νλ¦Ώμ
λλ€.
App.xaml
<FlexApplication
x:Class="WpfApp4.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApp4">
<FlexApplication.Resources />
</FlexApplication>
App.xaml.cs
using FlexMVVM;
using FlexMVVM.WPF;
namespace WpfApp4
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : FlexApplication
{
protected override void Render() => flex.StartWithLayout<Main.Layout> ();
protected override void Register(IContainerRegistry containerRegistry)
{
base.Register (containerRegistry);
containerRegistry.RegisterLayout<Main.Layout> ();
}
protected override void ModuleContext(IModuleCatalog moduleCatalog)
{
base.ModuleContext (moduleCatalog);
}
}
}
Layout.xaml
<UserControl
x:Class="WpfApp4.Main.Layout"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfApp4.Main"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Width="1000"
Height="500"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Grid Background="Red" />
</UserControl>
Layout.xaml.cs
using FlexMVVM.WPF;
using System.Windows.Controls;
namespace WpfApp4.Main
{
/// <summary>
/// Layout.xamlμ λν μνΈ μμ© λ
Όλ¦¬
/// </summary>
public partial class Layout : UserControl , IShellComponent
{
public Layout()
{
InitializeComponent ();
}
public void RegionAttached(object argu = null)
{
RegionManager.Attach ("Root", this);
}
}
}
μμ°μμβ¦