public void SetSlices(double[] slices, int scenarioNumber, bool isEvidence)
{
if (slices == null)
{
throw new ArgumentNullException("Slices");
}
// Record if evidence or not.
_scenarioIsEvidence[scenarioNumber] = isEvidence;
//
// Posterior slices.
//
// Scenario 1.
if (scenarioNumber == 1)
{
xSlices.SliceWeights = slices;
}
// Scenario 2.
else if (scenarioNumber == 2)
{
// If we're configuring, configuration already owns the decision
// on scenario 2 ring visibility.
if (this.State != StateEnum.Configuring
&& this.State != StateEnum.Minimized)
{
if (slices.Length != 0)
{
xScenarioRing2.Visibility
= Visibility.Visible;
}
else
{
xScenarioRing2.Visibility
= Visibility.Collapsed;
}
}
xScenarioRing2.SliceWeights = slices;
}
// Update evidence display.
xInnerShadow.StrokeThickness = _scenarioIsEvidence.ContainsKey(1) && _scenarioIsEvidence[1] ? 2.0 : 0.0;
xScenarioRing2.StrokeOutsideEnabled = _scenarioIsEvidence.ContainsKey(2) && _scenarioIsEvidence[2];
xScenarioRing2.StrokeInsideEnabled = false;
bool anyEvidence = _scenarioIsEvidence.ContainsValue(true);
_hasEvidence = anyEvidence;
}