Ejemplo n.º 1
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);
            SimpleEventBus.Subscribe <PopoverMenuToggleRequested>(OnPopoverMenuToggled);

            if (null == _dataMap)
            {
                var emptyState = new UIImageView(Theme.DetailEmptyStateImage)
                {
                    ContentMode = UIViewContentMode.TopLeft
                };

                View = emptyState;
            }
        }
Ejemplo n.º 2
0
        public void MessagePublishAndHandleWithEventHandlerTest()
        {
            var serviceCollection = new ServiceCollection();
            var list = new List <string>();
            var messageHandlerExecutionContext = new ServiceProviderMessageHandlerExecutionContext(serviceCollection);

            serviceCollection.AddSingleton(list);

            var eventBus = new SimpleEventBus(new MessageJsonSerializer(), messageHandlerExecutionContext);

            eventBus.Subscribe <NameChangedEvent, NameChangedEventHandler>();

            eventBus.Publish(new NameChangedEvent("myName"));

            Assert.Single(list);
            Assert.Equal("myName", list[0]);
        }
Ejemplo n.º 3
0
 private void SubscribeToBus()
 {
     SimpleEventBus.Subscribe <PopoverMenuToggled>(OnPopoverMenuToggled);
     SimpleEventBus.Subscribe <DataMapSaved>(OnDataMapSaved);
 }
Ejemplo n.º 4
0
 private void SubscribeToBus()
 {
     SimpleEventBus.Subscribe <DataSynchronized>(OnDataSynchronized);
 }