public EntryFieldExpandedMessage(EntryFieldViewModel item)
        {
            if (item == null)
                throw new ArgumentNullException("item");

            _item = item;
        }
Exemplo n.º 2
0
        public EntryFieldExpandedMessage(EntryFieldViewModel item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            _item = item;
        }
        public void Should_update_IsExpanded_state_of_items()
        {
            var parent = new Screen();
            var events = new EventAggregator();

            ScreenExtensions.TryActivate(parent);

            var item1 = new EntryFieldViewModel(parent, events);
            var item2 = new EntryFieldViewModel(parent, events);

            ViewModel.Items.Add(item1);
            ViewModel.Items.Add(item2);

            item1.Expand();
            ViewModel.Handle(new EntryFieldExpandedMessage(item1));
            Assert.True(item1.IsExpanded);
            Assert.False(item2.IsExpanded);

            item2.Expand();
            ViewModel.Handle(new EntryFieldExpandedMessage(item2));
            Assert.False(item1.IsExpanded);
            Assert.True(item2.IsExpanded);
        }