Exemple #1
0
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            TimelineDataItem data = item as TimelineDataItem;
            Product          productItem;

            if (data == null)
            {
                productItem = item as Product;
            }
            else
            {
                productItem = data.DataItem as Product;
            }

            if (productItem == null)
            {
                return(base.SelectTemplate(item, container));
            }

            if (productItem.Duration.Days != 0)
            {
                return(this.ItemWithDurationTemplate);
            }
            else
            {
                return(this.InstantItemTemplate);
            }
        }
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            TimelineDataItem e          = item as TimelineDataItem;
            TimelineEvent    roundEvent = e?.DataItem as TimelineEvent;

            if (roundEvent == null)
            {
                return(null);
            }
            switch (roundEvent.Type)
            {
            case "kill":
                return(KillTemplate);

            case "flash":
                return(FlashbangTemplate);

            case "smoke":
                return(SmokeTemplate);

            case "he":
                return(HeTemplate);

            case "decoy":
                return(DecoyTemplate);

            case "molotov":
                return(MolotovTemplate);

            case "incendiary":
                return(IncendiaryTemplate);

            case "bomb_planted":
                return(BombPlantedTemplate);

            case "bomb_exploded":
                return(BombExplodedTemplate);

            case "bomb_defused":
                return(BombDefusedTemplate);

            default:
                return(null);
            }
        }
Exemple #3
0
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            TimelineDataItem e             = item as TimelineDataItem;
            TimelineEvent    timelineEvent = e?.DataItem as TimelineEvent;

            if (timelineEvent == null)
            {
                return(null);
            }
            switch (timelineEvent.Type)
            {
            case "round_start":
                return(RoundTemplate);

            case "start_tick":
                return(MarkerStartTickTemplate);

            case "end_tick":
                return(MarkerEndTickTemplate);

            default:
                return(base.SelectTemplate(item, container));
            }
        }