yuanchaost

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
namespace Microsoft.Practices.Prism.PubSubEvents
{
    public interface IEventAggregator
    {
        TEventType GetEvent<TEventType>() where TEventType : EventBase, new();
    }
}

namespace Microsoft.Practices.ServiceLocation
{
    public static class ServiceLocator
    {
        public static IServiceLocator Current { get; }
        public static bool IsLocationProviderSet { get; }

        public static void SetLocatorProvider(ServiceLocatorProvider newProvider);
    }
}


 private IEventAggregator _eventAggregator;
  _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();

 _eventAggregator.GetEvent<ShowTipEvent>().Publish(new TipWindowViewModel
                {
                    Message = ResourceHelper.FindKey("TooManyPointsInPolyon"),
                    ShowConfirm = true
                });

 

posted on 2019-08-19 19:45  yuanchaost  阅读(595)  评论(0编辑  收藏  举报