override public void applyBehavior(UserControl control, string name, int value) { if (value == 0) { _objectGeometry.Material = (MaterialGroup)control.FindResource(TRAFFIC_GREEN_LIGHT_XML_TAG); } else if (value == 1) { _objectGeometry.Material = (MaterialGroup)control.FindResource(TRAFFIC_RED_LIGHT_XML_TAG); } else { setObjectHidden(); } }
override public void applyBehavior(UserControl control, string name, int value) { if ((value != 1 && value != 2)) { _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Vehicle_Sensor_Good"); } else if (value == 1) { _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Vehicle_Sensor_Warning"); } else if (value == 2) { _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Vehicle_Sensor_Bad"); } }
override public void applyBehavior(UserControl control, string name, int value) { if (value == 1) { _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Error"); } else if (value == 2) { _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Warning"); } else { _objectGeometry.Material = (Material)control.FindResource("M_Interlock"); } }
override public void applyBehavior(UserControl control, string name, int value) { System.Console.WriteLine("Applying behavior to " + name + " value " + value); if (value == 1) { _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Error"); } else if (value == 2) { _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Warning"); } else { _objectGeometry.Material = (Material)control.FindResource("M_Interlock"); } }
/// <summary> /// Ga terug naar idle /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void playAnimation(String animation_name, UserControl uc) // Mogelijke animaties: idle, attack, winner { Storyboard sb = uc.FindResource(animation_name) as Storyboard; sb.Completed += (sender, eventArgs) => { Storyboard sb2 = uc.FindResource("idle") as Storyboard; sb2.Begin(); RefreshData(); }; sb.Begin(); }