Hello guys!
I have somethi like this as Grid Resources:
<Grid.Resources><!-- Particle Styling --><SolidColorBrush x:Key = "ParticleColor" Color = "#006699"/><SolidColorBrush x:Key = "ParticleBackgroundColor" Color = "Transparent"/><system:Double x:Key = "ParticleOpacity">1</system:Double><system:Double x:Key = "ParticleRadius">5</system:Double><system:Double x:Key = "StartingPointX">0</system:Double><system:Double x:Key = "StartingPointY">-20</system:Double><system:Double x:Key = "RotationPointX">0.5</system:Double><system:Double x:Key = "RotationPointY">0.5</system:Double><!-- StoryBoard --><system:TimeSpan x:Key = "StoryBoardBeginTimeP0">00:00:00.000</system:TimeSpan><system:TimeSpan x:Key = "StoryBoardBeginTimeP1">00:00:00.100</system:TimeSpan><system:TimeSpan x:Key = "StoryBoardBeginTimeP2">00:00:00.200</system:TimeSpan><system:TimeSpan x:Key = "StoryBoardBeginTimeP3">00:00:00.300</system:TimeSpan><system:TimeSpan x:Key = "StoryBoardBeginTimeP4">00:00:00.400</system:TimeSpan><Duration x:Key = "StoryBoardDuration">00:00:01.800</Duration><!-- Particle Origin Angles --><system:Double x:Key = "ParticleOriginAngleP0">0</system:Double><system:Double x:Key = "ParticleOriginAngleP1">-10</system:Double><system:Double x:Key = "ParticleOriginAngleP2">-20</system:Double><system:Double x:Key = "ParticleOriginAngleP3">-30</system:Double><system:Double x:Key = "ParticleOriginAngleP4">-40</system:Double><!-- Particle Position & Timing 1 --><system:Double x:Key = "ParticleBeginAngle1">0</system:Double><system:Double x:Key = "ParticleEndAngle1">90</system:Double><system:TimeSpan x:Key = "ParticleBeginTime1">00:00:00.000</system:TimeSpan><Duration x:Key = "ParticleDuration1">00:00:00.750</Duration><!-- Particle Position & Timing 2 --><system:Double x:Key = "ParticleBeginAngle2">90</system:Double><system:Double x:Key = "ParticleEndAngle2">270</system:Double><system:TimeSpan x:Key = "ParticleBeginTime2">00:00:00.751</system:TimeSpan><Duration x:Key = "ParticleDuration2">00:00:00.300</Duration><!-- Particle Position & Timing 3 --><system:Double x:Key = "ParticleBeginAngle3">270</system:Double><system:Double x:Key = "ParticleEndAngle3">360</system:Double><system:TimeSpan x:Key = "ParticleBeginTime3">00:00:01.052</system:TimeSpan><Duration x:Key = "ParticleDuration3">00:00:00.750</Duration><Style x:Key = "EllipseStyle" TargetType = "Ellipse"><Setter Property = "Width" Value = "{StaticResource ParticleRadius}"/><Setter Property = "Height" Value = "{StaticResource ParticleRadius}"/><Setter Property = "Fill" Value = "{StaticResource ParticleColor}"/><Setter Property = "RenderTransformOrigin" Value = "0.5, 0.5"/><Setter Property = "Opacity" Value = "{StaticResource ParticleOpacity}"/></Style></Grid.Resources>
i'm having a problem changing the Static resource ParticleColor from the code behind.
i'm doing:
public void SetLoadingSolidColor(Brush color) { this.mainGrid.Resources["ParticleColor"] = color; }
this works well and changes the static resource, but NOT changes the Elipse style color, it stays the same.
How to solve this? Isn't this supposed to be bounded?
I've tried in the style to make something like:
<Style x:Key = "EllipseStyle" TargetType = "Ellipse"><Setter Property = "Width" Value = "{StaticResource ParticleRadius}"/><Setter Property = "Height" Value = "{StaticResource ParticleRadius}"/><Setter Property = "Fill" Value = "{Binding Source={StaticResource ParticleColor}, Mode=Default}"/><Setter Property = "RenderTransformOrigin" Value = "0.5, 0.5"/><Setter Property = "Opacity" Value = "{StaticResource ParticleOpacity}"/></Style>
..to try some binding, and the color stays the same.
Any help would be nice!
Thanks in advance!