Repository navigation
Migration
이 포크는 원본 Stylet과 API가 다릅니다. 참조를 바꾸고, 호출을 await하며, 훅 이름과 객체 소유권을 함께 이전합니다.
| 이전 이름 | 현재 이름 |
|---|---|
WPF 패키지·어셈블리 Stylet
|
Gyedo.Wpf |
공통 패키지·어셈블리 Stylet.Core
|
Gyedo.Core |
템플릿 패키지 Stylet.Templates / dotnet new stylet
|
Gyedo.Templates / dotnet new gyedo
|
using Stylet; / Stylet.Xaml / Stylet.Logging
|
using Gyedo; / Gyedo.Xaml / Gyedo.Logging
|
ConfigureStylet / StartStyletAsync / ShutdownStyletAsync
|
ConfigureGyedo / StartGyedoAsync / ShutdownGyedoAsync
|
XAML https://github.com/canton7/Stylet
|
https://github.com/dragonfavors/Gyedo |
리소스 키 StyletConductorTabControl
|
GyedoConductorTabControl |
Stylet;component/Xaml/StyletResourceDictionary.xaml |
Gyedo.Wpf;component/Xaml/GyedoResourceDictionary.xaml |
이전 이름의 호환 별칭은 제공하지 않습니다. XAML URI는 네임스페이스 식별자이며 웹 페이지를 다운로드하지 않습니다.
| 이전 | 현재 |
|---|---|
| 동기 Activate / Deactivate / Close |
ActivateAsync / DeactivateAsync / CloseAsync
|
| RequestClose / TryClose | 일반 종료 요청은 await RequestCloseAsync()
|
| ActivateItem / ActiveItem 대입 | await ActivateItemAsync(item) |
| DeactivateItem / CloseItem | 해당 Async 메서드 await |
| Items 직접 변경 | 읽기 전용. AddItemAsync / ActivateItemAsync / CloseItemAsync / ClearAsync 사용 |
| GoBack | await GoBackAsync() |
| OnInitialActivate / OnActivate |
OnInitialActivatedAsync(token) / OnActivatedAsync(token)
|
| OnDeactivate / OnClose |
OnDeactivatedAsync() / OnClosedAsync()
|
| OnViewLoaded / OnStateChanged |
OnViewLoadedAsync() / OnStateChangedAsync(previous, current)
|
| 동기 CanClose | Task<bool> CanCloseAsync() |
| ShowWindow / ShowDialog / ShowMessageBox | 해당 Async 메서드 await |
| Start / Launch / DisplayRootView | StartAsync / LaunchAsync / DisplayRootViewAsync |
훅은 상태가 바뀐 뒤 실행됩니다. OnActivatedAsync에서는 IsActive가 true입니다. 훅 완료와 실패·취소는 반환 Task로 확인합니다. 생성자에서 화면을 열던 코드는 OnInitialActivatedAsync로 옮깁니다. 생명주기 규칙
ActivateWith·DeactivateWith·CloseWith·ConductWith는 제거했습니다. Conductor의 자식 소유 관계나 훅 안의 명시적인 await로 대체합니다. 직접 CloseAsync를 호출하면 종료 확인을 우회합니다.
| 이전 | 현재 |
|---|---|
| PropertyChangedBase | 일반 모델은 ObservableObject, 화면은 Screen |
| SetAndNotify | SetProperty 또는 ObservableProperty |
| NotifyOfPropertyChange | OnPropertyChanged |
| NotifyOfPropertyChange(() => Name) | OnPropertyChanged(nameof(Name)) |
| 모델 Refresh() | 파생 클래스에서 OnPropertyChanged(string.Empty) |
{s:Action Save} |
{Binding SaveCommand} |
| View.ActionTarget | 바인딩 대상을 명시 |
| CanSave 이름 규칙 | RelayCommand의 CanExecute와 상태 갱신 연결 |
| 샘플 DelegateCommand / Fody | RelayCommand / ObservableProperty |
BindableCollection.Refresh()는 유지합니다. Screen은 ObservableRecipient 기반이며 세 수신 기간의 Toolkit 메신저를 제공합니다.
IEventAggregator, EventAggregator, IHandle·IHandle<T>와 발행 확장은 제거했습니다.
| 이전 | 현재 |
|---|---|
| IHandle.Handle | IRecipient.Receive |
| Publish | IMessenger.Send |
| 생성자에서 Subscribe | Screen의 AlwaysMessenger 자동 등록 |
| 최초 활성화~닫기 구독 | LongMessenger 자동 등록 |
| 활성화~비활성화 구독 | Messenger 자동 등록 |
| PublishOnUIThread | Execute.Run 안에서 Send |
| 문자열 채널 | 토큰을 지정한 Register / Send / Unregister |
일반 객체는 IMessenger로 직접 등록·해제합니다. Toolkit은 파생 메시지를 기반 타입 구독자에게 자동 전달하지 않으며, 여러 토큰으로 발행할 때 중복 수신 정책도 앱이 정합니다. 비동기 완료 대기가 필요하면 요청 메시지에 Task로 응답하고 발신자가 기다립니다.
검증은 여전히 IModelValidator입니다. Screen에 ObservableValidator 전용 [NotifyDataErrorInfo]를 붙이지 않습니다.
IDispatcher 구현에는 Post·Send의 DispatchPriority 인자와 네 가지 InvokeAsync 오버로드를 추가합니다. 기본값은 Lowest입니다. WPF 매핑은 디스패처 문서를 참고하세요.
Execute의 기존 긴 이름은 제거했습니다. 동작은 유지하고 이름만 아래처럼 바꿉니다.
| 이전 | 현재 |
|---|---|
| Execute.OnUIThreadAsync | Execute.RunAsync |
| Execute.PostToUIThreadAsync | Execute.InvokeAsync |
| Execute.OnUIThread | Execute.Run |
| Execute.PostToUIThread | Execute.Post |
| Execute.OnUIThreadSync | Execute.Send |
RunAsync는 현재 UI에서 즉시 시작할 수 있고 InvokeAsync는 항상 게시합니다. 두 메서드는 Func와 Func<Task>도 받으며 내부 작업까지 기다립니다. 콜백 예외는 현재 UI에서 실행하더라도 Task로 전달하므로 await를 try/catch로 감쌉니다.
| 이전 | 현재 |
|---|---|
| 여러 .NET Framework/.NET 대상 | Core net10.0, WPF net10.0-windows |
| 공통 타입이 Stylet.dll에 포함 | Gyedo.Core.dll로 분리. 네임스페이스는 Gyedo로 변경 |
| StyletIoC, Inject, BuildUp | Generic Host·Microsoft DI·생성자 주입 |
| ConfigureIoC / Container.Get | ConfigureServices / Services.GetRequiredService |
| 자동 VM 등록·추상 팩터리 | 명시적 서비스·팩터리 등록 |
| Screen.State / ScreenState.Initial | ScreenState / 초기 Deactivated |
| Screen.View / AttachView | WPF IViewManager.GetView / BindViewToModel |
| Execute.InDesignMode | WPF DesignMode.IsEnabled |
| BindWeak | Bind 또는 BindAndInvoke, 필요 시 Unbind |
공통 타입을 XAML에서 assembly=Stylet로 지정했다면 assembly=Gyedo.Core로, WPF 타입은 assembly=Gyedo.Wpf로 바꿉니다. CLR 네임스페이스와 XAML URI도 위 표에 맞춰 변경합니다.
원본 NuGet 패키지 대신 이 포크의 소스 또는 직접 빌드한 패키지를 사용합니다. DI 소유 자식과 Conductor의 중복 Dispose를 피하도록 소유권을 확인합니다.