Runtime Variable References
Introduction
Propagating Variable References
// Initialize
var project = GumUI.Initialize(this, "GumProject/GumProject.gumx");
// Find your style component and change values
var styles = project.Components.First(item => item.Name == "Styles");
styles.DefaultState.SetValue("Primary.Red", 255);
styles.DefaultState.SetValue("Primary.Green", 0);
styles.DefaultState.SetValue("Primary.Blue", 0);
// Propagate all variable references across the project
ObjectFinder.Self.GumProjectSave.ApplyAllVariableReferences();
// Now create UI - it will use the updated values
project.Screens.First().ToGraphicalUiElement().AddToRoot();Refreshing Live Visuals After Style Changes
Automatic State Preservation
Explicit Value Preservation
Preserving Custom Runtime Properties
Recomputing Values After a Style Refresh
Expression Support (Optional)
Last updated
Was this helpful?

