์๋ฉํฑ
์๋ฉํฑ ์ ๋ณด๋ ์ผ์ข
์ ๋ฉํ์ ๋ณด์ด๋ฉฐ ์ฌ๋์ด ์๋ณํ๊ฑฐ๋ ๊ธฐ๊ธฐ์์ ์๋ณํ ์ ์๋ ์ ๋ณด๋ฅผ ์ ๊ณตํฉ๋๋ค.
์ฑ ์๋ช
์ฃผ๊ธฐ

์ฑ ์๋ช
์ฃผ๊ธฐ๋ฅผ MAUI ๊ด์ ์์ ๋๋ ํ๋ ํผ๋ณ๋ก ๊ด์ฌํ ์ ์์ต๋๋ค.
์ฑ ์์
MauiProgram.cs
์ ํตํด ์์ ์ ์ฌ๋ฌ๊ฐ์ง ์ค์ ์ ํ ์ ์์ต๋๋ค. ๊ธ๊ผด์ด๋ ํฐํธ๋ฅผ ๋ฑ๋กํ ์ ์๊ณ ํธ๋ค๋ฌ๋ ์๋น์ค๋ฅผ ๋ฑ๋กํ ์ ์์ต๋๋ค.
๋ ๋๋ฌ ์ญ์ ํธ๋ค๋ฌ๋ฅผ ํตํด ์ฒ๋ฆฌ๋ ์ ์๋๋ฐ ๋ค์์ ์ฝ๋์ฒ๋ผ ๊ฐ ํ๋ ํผ๋ณ๋ก ๋ ๋๋ฌ๋ฅผ ๋ฑ๋กํ ์ ์์ต๋๋ค.
...
#if ANDROID
.ConfigureMauiHandlers(handlers =>
{
handlers.AddCompatibilityRenderer(typeof(Microsoft.Maui.Controls.BoxView),
typeof(Microsoft.Maui.Controls.Compatibility.Platform.Android.BoxRenderer));
handlers.AddCompatibilityRenderer(typeof(Microsoft.Maui.Controls.Frame),
typeof(Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers.FrameRenderer));
});
#elif IOS
.ConfigureMauiHandlers(handlers =>
{
handlers.AddCompatibilityRenderer(typeof(Microsoft.Maui.Controls.BoxView),
typeof(Microsoft.Maui.Controls.Compatibility.Platform.iOS.BoxRenderer));
handlers.AddCompatibilityRenderer(typeof(Microsoft.Maui.Controls.Frame),
typeof(Microsoft.Maui.Controls.Compatibility.Platform.iOS.FrameRenderer));
});
#endif
...
Behavior
์์์ ํ์ง ์๊ณ ๋ ์ฌ์ฉ์ ์ธํฐํ์ด์ค ์ปจํธ๋กค์ ๊ธฐ๋ฅ์ ์ถ๊ฐ ํ ์ ์์ต๋๋ค. WPF ๊ทธ๊ฒ๊ณผ ์ ์ฌํฉ๋๋ค.
...
public static class AttachedNumericValidationBehavior
{
public static readonly BindableProperty AttachBehaviorProperty =
BindableProperty.CreateAttached("AttachBehavior", typeof(bool), typeof(AttachedNumericValidationBehavior), false, propertyChanged: OnAttachBehaviorChanged);
...
๋ฐ์ดํฐ ๋ฐ์ธ๋ฉ
๋ณ๋ ์ ๋ฆฌ
์ ์ค์ฒ
Drag&Drop, Pan, Pinch, Swipe, Tap์ ๋ค์ํ ์ ์ค์ฒ๋ฅผ ์ฒ๋ฆฌํ ์ ์์ต๋๋ค.
์์ฑ
๋ฐ์ธ๋ฉ ๊ฐ๋ฅ ์์ฑ(Bindable property)๊ณผ, ์ฒจ๋ถ ์์ฑ(Attached property) ๋ชจ๋ WPF์ ๊ทธ๊ฒ๊ณผ ์ ์ฌํฉ๋๋ค.
๋ฉ์์ง ๊ฒ์ ๋ฐ ๊ตฌ๋
๋ฐํ-๊ตฌ๋
ํจํด์ ๋ฐํ์์ ๊ตฌ๋
์๋ฅผ ์ง์ ์ฐธ์กฐํ์ง ์๊ณ ๋ ํ์ํ ๋ฉ์์ง๋ฅผ ๋ณด๋ด๊ณ ๋ฐ์ ์ ์๋ ํจํด์
๋๋ค. MAUI์์๋ MessagingCenter
๋ฅผ ์ด์ฉํด ์ด ํจํด์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ด๋ฅผ ์ด์ฉํด ์ปจํธ๋กค์ ์ปจํธ๋กค๊ฐ ๋ฉ์์ง๋ฅผ ์ฃผ๊ณ ๋ฐ์ ์ ์์ต๋๋ค.
๋ฆฌ์์ค ์ฌ์
ResourceDictionary
๋ฅผ ์ด์ฉํด ๋ฆฌ์์ค๋ฅผ ๋ ํ์งํ ๋ฆฌ๋ก ๊ด๋ฆฌํ ์ ์์ต๋๋ค. WPF์ ๊ทธ๊ฒ๊ณผ ์ ์ฌํฉ๋๋ค.
Shell
๋จ์ผ ํ๋ก์ ํธ
๋ค์ํ ํ๋ก์ ํธ ์ค์ ์ผ๋ก ๋ฆฌ์์ค์ ๋ํ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค.
<ItemGroup>
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<!-- Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Assets -->
<MauiAsset Include="Resources\Assets\*" />
</ItemGroup>
ํ
ํ๋ฆฟ
WPF์ ๊ทธ๊ฒ๊ณผ ๊ฐ์ด ControlTemplate
, DateTemplate
์ ์ฌ์ฉํฉ๋๋ค.
ํธ๋ฆฌ๊ฑฐ
ํธ๋ฆฌ๊ฑฐ๋ฅผ ํตํด XAML์์ ๋ค์ํ ๋ณํ๋ฅผ ๊ฐ์งํ์ฌ ๋ค๋ฅธ ๋์์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค. ๊ตฌ์ฑ์ WPF์ ํธ๋ฆฌ๊ฑฐ์ ์ ์ฌํฉ๋๋ค.
์ฐฝ
์ค๋ ๊ธฐ์ด
๋ถ๋ถ์ ์ ๋ฐ์ ์ผ๋ก ์ดํด๋ดค๋๋ฐ WPF ๊ฐ๋ฐ์๋ผ๋ฉด ๋น ๋ฅด๊ฒ MAUI์ ์ต์ํด์ง ์ ์๋๋ก ๊ธฐ์กด ๊ธฐ์ ์ ๊ฑฐ์ ๋๋ถ๋ถ ๊ณ์นํด์ ์ฌ์ฉํ๋ค์. ๋ค์ ์๊ฐ์๋ MAUI ์ปจํธ๋กค์ ์ค์ ์ ์ผ๋ก ๋ฐฐ์๋ณผ ์๊ฐ์
๋๋ค.