/// <summary> /// Updates the inspector. /// </summary> public void UpdateInspector() { // Update fields with the current shape information StyleName.StringValue = SelectedStyle.Name; ApplyButton.Enabled = (SelectedShape != null && SelectedShape.Style != SelectedStyle); DeleteButton.Enabled = (SelectedStyle.StyleType != KimonoStyleType.Default); Backbutton.Enabled = (SelectedShape != null && SelectedShape.Style == SelectedStyle); // Set type switch (SelectedStyle.StyleType) { case KimonoStyleType.Default: TypeDropdown.SelectItem(0); TypeDropdown.Enabled = false; StyleName.Enabled = false; break; case KimonoStyleType.Standard: TypeDropdown.SelectItem(0); TypeDropdown.Enabled = true; StyleName.Enabled = true; break; case KimonoStyleType.Text: TypeDropdown.SelectItem(1); TypeDropdown.Enabled = true; StyleName.Enabled = true; break; } }
/// <summary> /// Updates the inspector. /// </summary> public void UpdateInspector() { // Update fields with the current shape information if (SelectedGradient != null) { GradientName.StringValue = SelectedGradient.Name; } BackButton.Enabled = (SelectedShape != null); ShowCurrentColor(); TileDropdown.Enabled = (SelectedGradient.GradientType != KimonoGradientType.SweepGradient); RadiusSlider.FloatValue = SelectedGradient.Radius; RadiusValue.StringValue = RadiusSlider.IntValue.ToString(); RadiusSlider.Enabled = (SelectedGradient.GradientType == KimonoGradientType.RadialGradient || SelectedGradient.GradientType == KimonoGradientType.ConicalGradient); // Set type switch (SelectedGradient.GradientType) { case KimonoGradientType.LinearGradient: TypeDropdown.SelectItem(0); break; case KimonoGradientType.RadialGradient: TypeDropdown.SelectItem(1); break; case KimonoGradientType.SweepGradient: TypeDropdown.SelectItem(2); break; case KimonoGradientType.ConicalGradient: TypeDropdown.SelectItem(3); break; } // Set tile mode switch (SelectedGradient.TileMode) { case SKShaderTileMode.Clamp: TileDropdown.SelectItem(0); break; case SKShaderTileMode.Repeat: TileDropdown.SelectItem(1); break; case SKShaderTileMode.Mirror: TileDropdown.SelectItem(2); break; } }