甄文超

TNT 数字生活

prism


prism RequestNavigate传参

RegionManager.RequestNavigate传参说明 方法说明 // 参数: // regionName: // The name of the region where the navigation will occur. // // target: // A string that represents the target where the region will navigate. // // navigationParameters: // An instance of NavigationParameters, which holds a collection of object parameters. void RequestNavigate(string regionName, string …

.NET wpf prism

prsm 复杂对象改变,通知View的方法

viewmodel对象的属性改变时,可以使用RaisePropertyChagned通知View private void Execute_OpenPickerMemberCommand() { _dialogService.ShowDialog(DialogNames.MemberPickerDialog, null, r = { if (r.Result != ButtonResult.OK) return; var member = r.Parameters.GetValue("SelectedData"); PrjModel.Owner = member.Id; PrjModel.OwnerName = member.Name; this. …

wpf prism

Prism 非主界面使用Region

非主界面使用Region时,需要特殊处理,否则无法找region 示例: 1、在Module的View里使用Region的方法 填充Region后不再,切换 .xaml <ContentControl x:Name="groupRegion" Margin="10,5,5,5" prism:RegionManager.RegionName="RegionName"/> .cs public MainForm(IRegionManager regionManager, IContainerProvider provider) { InitializeComponent(); //新页面需要手动加入RegionManger,并更新 RegionManager.SetRegionManager(groupRegion, provider.Resolve< …

wpf prism

INavigationAware接口

public interface INavigationAware { bool IsNavigationTarget(NavigationContext navigationContext); void OnNavigatedTo(NavigationContext navigationContext); void OnNavigatedFrom(NavigationContext navigationContext); } 当从本页面转到其它页面的时候,会调用OnNavigatedFrom方法,navigationContext会包含目标页面的URI。 当从其它页面导航至本页面的时候,首先会调用IsNavigationTarget,IsNavigationTarget返回一个bool值,简单地说这个方法的作用就是告诉Prism,是重复使用这个视图的实例还是再创建 …

wpf prism

  • 1