public override DataTemplate SelectTemplate(object item, DependencyObject container) { LoadingElement element = item as LoadingElement; if (element != null) { return(LoadingElementTemplate); } else { return(ElementTemplate); } }
protected override void CreateChildElements() { base.CreateChildElements(); this.drivingToPickUpLocationElement = new DrivingToPickUpLocationElement(); this.drivingToPickUpLocationElement.DrawFill = true; this.drivingToPickUpLocationElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; this.drivingToPickUpLocationElement.BackColor = Color.LightBlue; this.loadingElement = new LoadingElement(); this.loadingElement.DrawFill = true; this.loadingElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; this.loadingElement.BackColor = Color.DarkBlue; this.drivingElement = new DrivingElement(); this.drivingElement.DrawFill = true; this.drivingElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; this.drivingElement.BackColor = Color.Green; this.driverRestElement = new DriverRestElement(); this.driverRestElement.DrawFill = true; this.driverRestElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; this.driverRestElement.BackColor = Color.SlateGray; this.waitingElement = new WaitingElement(); this.waitingElement.DrawFill = true; this.waitingElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; this.waitingElement.BackColor = Color.Gold; this.unloadingElement = new UnloadingElement(); this.unloadingElement.DrawFill = true; this.unloadingElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; this.unloadingElement.BackColor = Color.RosyBrown; this.borderElement = new LightVisualElement(); this.borderElement.DrawBorder = true; this.borderElement.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid; this.borderElement.BorderColor = Color.Black; this.borderElement.ShouldHandleMouseInput = false; this.borderElement.NotifyParentOnMouseInput = true; this.Children.Add(this.drivingToPickUpLocationElement); this.Children.Add(this.loadingElement); this.Children.Add(this.drivingElement); this.Children.Add(this.driverRestElement); this.Children.Add(this.waitingElement); this.Children.Add(this.unloadingElement); this.Children.Add(this.borderElement); }