Inheritance: System.Windows.Controls.UserControl
        private void RefreshUI()
        {
            if (_conditionedOn == null ||
                _variable == null ||
                _distribution == null ||
                _parents == null)
            {
                return;
            }

            // Setup variable name.
            {
                char   letter;
                string subscript;
                Utils.ParseVariableName(_variableAbbreviations[_variable.Name], out letter, out subscript);

                xNameLetter.Text    = letter.ToString();
                xNameSubscript.Text = subscript;
            }

            // Setup parent values region.
            xConditionedOn.SetData(_conditionedOn, _parents, _variableAbbreviations);

            // Add masses.
            xMasses.Children.Clear();
            var space     = _variable.Space;
            var values    = space.Values.ToList();
            var spaceSize = values.Count();

            for (int i = 0; i < spaceSize; ++i)
            {
                var value = values[i];
                var label = space.GetLabel(value);
                var color = _variable.Space.GetColor(value);
                var mass  = (double)_distribution.GetMass(value).Value;

                var row = new DistributionMass();
                row.ValueColor          = color;
                row.ValueLabel          = label;
                row.ValueMass           = mass;
                row.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

                xMasses.Children.Add(row);
            }
        }
        private void RefreshUI()
        {
            if (_conditionedOn == null
                || _variable == null
                || _distribution == null
                || _parents == null)
            {
                return;
            }

            // Setup variable name.
            {
                char letter;
                string subscript;
                Utils.ParseVariableName(_variableAbbreviations[_variable.Name], out letter, out subscript);

                xNameLetter.Text = letter.ToString();
                xNameSubscript.Text = subscript;
            }

            // Setup parent values region.
            xConditionedOn.SetData(_conditionedOn, _parents, _variableAbbreviations);

            // Add masses.
            xMasses.Children.Clear();
            var space = _variable.Space;
            var values = space.Values.ToList();
            var spaceSize = values.Count();

            for (int i = 0; i < spaceSize; ++i)
            {
                var value = values[i];
                var label = space.GetLabel(value);
                var color = _variable.Space.GetColor(value);
                var mass = (double)_distribution.GetMass(value).Value;

                var row = new DistributionMass();
                row.ValueColor = color;
                row.ValueLabel = label;
                row.ValueMass = mass;
                row.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

                xMasses.Children.Add(row);
            }
        }