MainWindow 이젠 Bye~

ν˜„μž¬ 개발 쀑인 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);
        }
    }
}

μ‹œμ—°μ˜μƒβ€¦

2개의 μ’‹μ•„μš”

ν™”λ©΄μ „ν™˜λ„β€¦!

(μΆ”κ°€)

  • ViewModel Mapper Map μΆ”κ°€
  • Attachedλ₯Ό 처리둜 μΆ”κ°€ 된 ViewModel Mapper Map을 톡해 AutoDataContext 처리
5개의 μ’‹μ•„μš”

ν™”λ©΄μ „ν™˜ 2

Scale

Fade

SlideLeftRight

6개의 μ’‹μ•„μš”