public void RemoveLight(LightControl light) { // Dipose the light to remove the targets light.Dispose(); Material.Lights.Remove(light.Light); LightPanel.Children.Remove(light); if (LightPanel.Children.Count == 0) { NoLightText.Visibility = Visibility.Visible; } }
private void AddLight_Click(object sender, RoutedEventArgs e) { Light light = new Light(_compositor, _container); light.Offset = new Vector3((float)PreviewPanel.ActualWidth / 2, (float)PreviewPanel.ActualHeight / 2, 100); Material.Lights.Add(light); LightControl control = new LightControl(light, this); LightPanel.Children.Add(control); NoLightText.Visibility = Visibility.Collapsed; control.ShowProperties(); }
public EditLightControl(LightControl light) { this.InitializeComponent(); _light = light; UpdateUI(); foreach (LightTypes lightType in Enum.GetValues(typeof(LightTypes))) { ComboBoxItem item = new ComboBoxItem(); item.Tag = lightType; item.Content = lightType.ToString(); item.IsSelected = lightType == _light.Light.Type; LightTypeSelection.Items.Add(item); } }