当前位置: 首页>>代码示例>>C#>>正文


C# IMessenger类代码示例

本文整理汇总了C#中IMessenger的典型用法代码示例。如果您正苦于以下问题:C# IMessenger类的具体用法?C# IMessenger怎么用?C# IMessenger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IMessenger类属于命名空间,在下文中一共展示了IMessenger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProductPreviewViewModel

        public ProductPreviewViewModel(IMessenger messenger, IBasketModel basketModel)
        {
            // Design setup
            if (this.IsInDesignMode)
            {
                Visible = true;

                Product = new Product()
                {
                    ProductId=12345,
                    Name = "Product Name",
                    Description = "Product Description",
                    UpdatedDate = DateTime.Today,
                };
            }

            // Unpack
            MessengerInstance = messenger;
            _basketModel = basketModel;

            // Register Message Handlers
            MessengerInstance.Register<ProductPreviewMessage>(this, HandleProductPreview);

            // Commands
            CloseCommand = new RelayCommand(CloseExecute);
            AddProductCommand = new RelayCommand(AddProductExecute);
        }
开发者ID:TristanRhodes,项目名称:SampleApp,代码行数:27,代码来源:ProductPreviewViewModel.cs

示例2: FileListingController

    public FileListingController(FileListingViewModel ViewModel, MainMenuViewModel MenuViewModel, IMessenger Messenger, IMapper Mapper, IUpkFileRepository Repository, IUpkFileRemoteRepository RemoteRepository) {
          viewModel = ViewModel;
      menuViewModel = MenuViewModel;

      messenger = Messenger;
         mapper = Mapper;

      repository = Repository;

      remoteRepository = RemoteRepository;

      viewModel.Files = new ObservableCollection<FileViewEntity>();

      viewModel.FilterText = String.Empty;

          viewModel.PropertyChanged += onViewModelPropertyChanged;
      menuViewModel.PropertyChanged += onMenuViewModelPropertyChanged;

      allFiles = new List<DomainUpkFile>();

      allFileEntities = new List<FileViewEntity>();

      registerMessages();
      registerCommands();
    }
开发者ID:stricq,项目名称:UPKManager,代码行数:25,代码来源:FileListingController.cs

示例3: ProjectPanelViewModel

        public ProjectPanelViewModel(ITrackerService svc, IMessenger mess)
        {
            _Messenger = mess;
            _Service = svc;

            Project = new ProjectViewModel();
        }
开发者ID:hyperatom,项目名称:Bug-Tracker,代码行数:7,代码来源:ProjectPanelViewModel.cs

示例4: MainPageViewModel

        /// <summary>
        /// Initializes a new instance of the <see cref="MainPageViewModel"/> class.
        /// </summary>
        /// <param name="messenger">
        /// The messenger.
        /// </param>
        /// <param name="navigationService">
        /// The navigation service.
        /// </param>
        public MainPageViewModel(IMessenger messenger, NavigationService navigationService)
            : base(messenger, navigationService)
        {
            this.InitializeMenu();

            this.ItemInvokedCommand = new RelayCommand<ListViewItem>(this.ItemInvoked);
        }
开发者ID:jamesmcroft,项目名称:Windows-Universal-SplitViewTemplate,代码行数:16,代码来源:MainPageViewModel.cs

示例5: MessageController

 public MessageController(IMessageService iMessageService, IUserInfo iUserInfo, IUnitOfWork unitOfWork, IMessenger iMessenger)
 {
     _iMessageService = iMessageService;
     _iUserInfo = iUserInfo;
     _unitOfWork = unitOfWork;
     _iMessenger = iMessenger;
 }
开发者ID:b9502032,项目名称:MySite,代码行数:7,代码来源:MessageController.cs

示例6: MainViewModel

 public MainViewModel(IViewModelNavigator navigator, IMessenger messenger)
 {
     messenger.Register<ContentChangedMessage>(this, OnContentChanged);
     _messenger = messenger;
     _navigator = navigator;
     _navigator.NavigateForward<WelcomViewModel>(null);
 }
开发者ID:KonigLabs,项目名称:SpriteEvent,代码行数:7,代码来源:MainViewModel.cs

示例7: UserPasswordReset

        public static UserPassword UserPasswordReset(string name, out string password, IMessenger messenger)
        {
            var user = UserPassword.FetchUserPassword(
                new UserPasswordCriteria
                    {
                        Name = name
                    });

            if (user != null)
            {
                password = PasswordHelper.GetRandomPassword(10);

                user.SetPassword(password);

                user = user.Save();

                if (messenger == null)
                {
                    messenger = MessageHelper.InitializeMessageForUserPasswordReset(user.Email);
                }

                messenger.Message = messenger.Message.Replace(MessageParameter.Password, password);

                messenger.Send();
            }
            else
            {
                throw new ArgumentException("No such user exists.");
            }

            return user;
        }
开发者ID:WhiteIsland,项目名称:epiworx,代码行数:32,代码来源:UserPasswordService.cs

示例8: ViewModelBaseEx

 protected ViewModelBaseEx( IViewServiceRepository viewServices = null, ISettingsRepository settingsRepo = null, IMessenger messenger = null )
 {
     MessengerInstance = messenger;
     ViewServices = viewServices ?? App.ViewServices;
     Session = App.Session;
     Settings = settingsRepo ?? App.Settings;
 }
开发者ID:TheSylence,项目名称:GSD,代码行数:7,代码来源:ViewModelBaseEx.cs

示例9: LoginViewModel

        public LoginViewModel(IMessenger messenger, ILoginService loginService)
        {
            _messenger = messenger;
            _loginService = loginService;

            LoginCommand = new RelayCommand<object>(Login);
        }
开发者ID:korchakmv,项目名称:warehouse,代码行数:7,代码来源:LoginViewModel.cs

示例10: UpkManagerController

    public UpkManagerController(UpkManagerViewModel ViewModel, MainMenuViewModel MenuViewModel, IMessenger Messenger, ISettingsRepository SettingsRepository, IExceptionRepository ExceptionRepository, IMapper Mapper) {
      if (Application.Current != null) Application.Current.DispatcherUnhandledException += onCurrentDispatcherUnhandledException;

      AppDomain.CurrentDomain.UnhandledException += onDomainUnhandledException;

      Dispatcher.CurrentDispatcher.UnhandledException += onCurrentDispatcherUnhandledException;

      TaskScheduler.UnobservedTaskException += onUnobservedTaskException;

      System.Windows.Forms.Application.ThreadException += onThreadException;

          viewModel =     ViewModel;
      menuViewModel = MenuViewModel;

      messenger = Messenger;

      settingsRepository  = SettingsRepository;
      exceptionRepository = ExceptionRepository;

      mapper = Mapper;

      settings = Task.Run(() => settingsRepository.LoadSettingsAsync()).Result;

      viewModel.Settings = mapper.Map<SettingsWindowViewEntity>(settings);

      registerMessages();
      registerCommands();
    }
开发者ID:stricq,项目名称:UPKManager,代码行数:28,代码来源:UpkManagerController.cs

示例11: Consolery

        public Consolery(Type targetType, object target, string[] args, IMessenger messenger, Notation notationType)
        {
            Contract.Requires(targetType != null);
            Contract.Requires(args != null);
            Contract.Requires(messenger != null);

            _target = target;
            _targetType = targetType;
            _args = args;
            _messenger = messenger;

            _actionMethods = _targetType
                .GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance)
                .Where(method => method.GetCustomAttributes(false).OfType<ActionAttribute>().Any())
                .ToList();

            _metadata = new Metadata(_actionMethods);
            _metadataValidator = new MetadataValidator(_targetType, _actionMethods, _metadata);
            if (notationType == Notation.Windows)
            {
                _notation = new WindowsNotationStrategy(_args, _messenger, _metadata, _targetType, _actionMethods);
            }
            else
            {
                _notation = new LinuxNotationStrategy(_args, _messenger, _metadata);
            }
        }
开发者ID:nuxleus,项目名称:nconsoler,代码行数:27,代码来源:Consolery.cs

示例12: CommonWindow

        public CommonWindow(IMessenger messenger)
        {
            _messenger = messenger;
            _messenger.Register<CloseViewMessage>(this, Close);

            InitializeComponent();
        }
开发者ID:Zhenya777777777,项目名称:DataGridBehaviors,代码行数:7,代码来源:CommonWindow.xaml.cs

示例13: ChangePasswordView

        public ChangePasswordView(IMessenger messenger)
        {
            InitializeComponent();

            _messenger = messenger;
            _messenger.Register<PasswordChangeMsg>(this, OnPasswordChangeMsgMessage);
        }
开发者ID:wasteland540,项目名称:SecureFileShare,代码行数:7,代码来源:ChangePasswordView.xaml.cs

示例14: Init

        public void Init()
        {
            var messengerMock = new Mock<IMessenger>();
            var serviceMock   = new Mock<ITrackerService>();

            _Messenger = messengerMock.Object;

            _MockPriorityList = new List<string>() { "High", "Low" };
            _MockStatusList = new List<string>() { "In Progress", "Closed" };

            _MockActiveProject = new ProjectViewModel(new Project { Id = 1, Code = "GGGGG", Description = "", Name = "TestProject" });

            _AssignedUserMock = new User() { Id = 5, FirstName = "Adam", Username = "adam", Password = "password" };

            _MockProjectUsersList = new List<User>() { _AssignedUserMock};

            serviceMock.Setup<List<string>>(p => p.GetBugPriorityList()).Returns(_MockPriorityList);
            serviceMock.Setup<List<string>>(p => p.GetBugStatusList()).Returns(_MockStatusList);
            serviceMock.Setup<List<User>>(p => p.GetUsersByProject(_MockActiveProject.ToProjectModel())).Returns(_MockProjectUsersList);
            serviceMock.Setup<User>(p => p.GetMyUser()).Returns(_AssignedUserMock);

            var _MockNotifier = new Mock<IGrowlNotifiactions>();

            _ServiceMock = serviceMock.Object;

            _ActiveProjectStub = new ProjectViewModel(new Project { Id = 5, Description = "Stub Project", Name = "Stub Title" });

            _AddPanel = new BugAddPanelViewModel(_Messenger, _ServiceMock, _MockActiveProject, _MockNotifier.Object);
        }
开发者ID:hyperatom,项目名称:Bug-Tracker,代码行数:29,代码来源:BugAddPanelTests.cs

示例15: MovieGroupDetailViewModel

		public MovieGroupDetailViewModel(
			IMovieRepository movieRepository,
			IMessenger messenger)
		{
			MovieRepository = movieRepository;
			Messenger = messenger;
		}
开发者ID:brentedwards,项目名称:Movies.WinRT,代码行数:7,代码来源:MovieGroupDetailViewModel.cs


注:本文中的IMessenger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。