C#/Prism
-
[Prism] Navigation view oneTime InstanceC#/Prism 2023. 2. 1. 17:21
void ExecuteItem1Command(string navigatePath) { if (navigatePath != null) this.regionManager.RequestNavigate("DocumentRegion", navigatePath); } RequestNavigate으로 불러와지는 뷰, 뷰모델 위와 같이 IRegionMemberLifetime 상속받고 KeepAlive return false하면 다른뷰로 넘어갈때 인스턴스 해제 RequestNavigate 할때 마다 View instance 생성 ( 생성된 each View Instance마다 each ViewModel생성 ) 위와 같이 INavigationAware상속 후 아래 return false; 추가 public bool IsN..
-
[Prism] RegionAdapterC#/Prism 2023. 2. 1. 14:40
//StackPanelRegionAdapter.cs using Prism.Regions; using System.Collections.Specialized; using System.Windows; using System.Windows.Controls; namespace PMLSStudio.RegionAdapter { public class StackPanelRegionAdapter : RegionAdapterBase { //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////..
-
[Prism] <Control> ContentRegionC#/Prism 2023. 2. 1. 14:22
Region 에 하나의 View를 View Injection방식으로 각각을 Instance화 시켜서 View를 여러개 더하여 표현은 가능!! BUT Region 에 하나의 View를 View Injection방식으로 각각을 Instance화 시켜서 Add할때 Add하려는 View에 View Discovery방식으로 주입되어있는 view가 있는경우 Compile Error ( View Discovery방식은 Singletone) View Injection으로 주입되어있는 view가 있는 경우에도 Error Navigation 방식으로하는 경우는 정상작동. ex) View ->(View Injection)independent_View, independent_View, independent_View (가능) ..
-
[Prism] Call Moule ClassC#/Prism 2023. 2. 1. 11:53
Test 필요. how to call wpf prism module class You can call a WPF Prism module class by using the IModuleManager service provided by Prism. You can use the IModuleManager to load a module by type or name and then call the module's class methods. Here is an example of how you can use IModuleManager to load a module and call its class methods: // Get the IModuleManager service from the service locato..
-
-
[Prism] DialogC#/Prism 2023. 1. 6. 16:57
모듈을 Dialog로 등록해서 사용. ViewModel에 IDialogAware인터페이스 추가 ShowDialog public void NewProject() { //using the dialog service as-is var newProjectData = new NewProject(); var dialogParameters = new DialogParameters(); dialogParameters.Add("newProject", newProjectData); //using the dialog service as-is _dialogService.ShowDialog("NewProjectView", dialogParameters, r => { if (r.Result == ButtonResult.OK) {..
-
-
[Prism] 시작하기C#/Prism 2022. 11. 23. 17:18
목차 1.Prism Template Pcak 으로 시작하기 2.Prism Nuget Package 설치로 시작하기 1.Prism Template Pack으로 시작하기 Prism Template Pack 설치 Module 등록 프로젝트 모듈 추가 Dependencies에 Project Module 추가 후 protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) { moduleCatalog.AddModule(); moduleCatalog.AddModule(); } 위 override 함수에 추가 할 모듈 추가 View Discovery방식 위 표시영역은 View Discovery방식 즉시 표시되는 아이템(View)에 대해서만 ..