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개의 좋아요