コード例 #1
0
 public void SetUp()
 {
     viewModel = new NestedViewModel <ViewModelBase <BindableBase> > ();
     child1    = new ViewModelBase <BindableBase> ();
     child2    = new ViewModelBase <BindableBase> ();
     viewModel.ViewModels.Add(child1);
     viewModel.ViewModels.Add(child2);
 }
コード例 #2
0
        public void TestVisibleEvents()
        {
            // Arrange
            var childVM1  = new TimelineEventVM();
            var childVM2  = new TimelineEventVM();
            var childVM3  = new TimelineEventVM();
            var viewModel = new NestedViewModel <TimelineEventVM> ();

            viewModel.ViewModels.Add(childVM1);
            viewModel.ViewModels.Add(childVM2);
            viewModel.ViewModels.Add(childVM3);
            // Assume
            Assert.AreEqual(3, viewModel.VisibleChildrenCount);

            // Act
            childVM1.Visible = false;
            childVM3.Visible = false;

            // Assert
            Assert.AreEqual(1, viewModel.VisibleChildrenCount);
        }
コード例 #3
0
 public TimelineVM()
 {
     eventTypeToTimeline = new Dictionary <EventType, EventTypeTimelineVM> ();
     playerToTimeline    = new Dictionary <Player, PlayerTimelineVM> ();
     EventTypesTimeline  = new NestedViewModel <EventTypeTimelineVM> ();
     TeamsTimeline       = new NestedViewModel <TeamTimelineVM> ();
     FullTimeline        = CreateFullTimeline();
     FullTimeline.ViewModels.CollectionChanged += HandleTimelineCollectionChanged;
     FullTimeline.PropertyChanged += FullTimeline_PropertyChanged;
     EditionCommand             = new Command <TimelineEventVM> (HandleEditPlay);
     GroupEventsByEventTypeName = false;
     Filters         = new AndPredicate <TimelineEventVM> ();
     EventsPredicate = new AndPredicate <TimelineEventVM> {
         Name        = "Events",
         DisplayName = Catalog.GetString("Events")
     };
     PeriodsPredicate = new OrPredicate <TimelineEventVM> {
         Name        = "Periods",
         DisplayName = Catalog.GetString("Periods")
     };
     TimersPredicate = new OrPredicate <TimelineEventVM> {
         Name        = "Timers",
         DisplayName = Catalog.GetString("Timers")
     };
     CommonTagsPredicate = new AndPredicate <TimelineEventVM> {
         Name        = "Common Tags",
         DisplayName = Catalog.GetString("Common Tags")
     };
     EventTypesPredicate = new OrPredicate <TimelineEventVM> {
         Name        = "Event Types",
         DisplayName = Catalog.GetString("Event Types")
     };
     TeamsPredicate = new OrPredicate <TimelineEventVM> {
         Name        = "Teams",
         DisplayName = Catalog.GetString("Teams"),
     };
 }
コード例 #4
0
 public NestedElementTickViewModel(NestedViewModel parent, NestedElementViewModel element) : base(parent)
 {
     Element = element;
     X       = Element.Position.X - (4 * Element.Width);
     Y       = Element.Position.Y + 5;
 }
コード例 #5
0
 public NestedBasePairViewModel(NestedViewModel parent, NestedElementViewModel fivePrimeElement,
                                NestedElementViewModel threePrimeElement) : base(parent)
 {
     FivePrimeElement  = fivePrimeElement;
     ThreePrimeElement = threePrimeElement;
 }