Inheritance: System.Windows.Controls.UserControl
        public void SetVariable(FRandomVariable variable, IDictionary<string,string> abbreviations)
        {
            _variable = variable;

            // Short name.
            char letter;
            string subscript;
            Utils.ParseVariableName(abbreviations[variable.Name], out letter, out subscript);

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

            // Long name.
            xFullName.Text = variable.Name;

            // Space.
            xSpace.Children.Clear();
            foreach (var value in variable.Space.Values)
            {
                ObservationNameValue onv = new ObservationNameValue();
                onv.VariableName = "";
                onv.VariableValueLabel = variable.Space.GetLabel(value);
                onv.VariableValueColor = variable.Space.GetColor(value);
                onv.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

                xSpace.Children.Add(onv);
            }
        }
Exemple #2
0
        private void RefreshUI()
        {
            xFlow.Children.Clear();

            if (_variables == null || _values == null)
            {
                return;
            }

            foreach (var rv in _variables)
            {
                var variableValueMaybe = _values.TryValueForVariable(rv.Name);
                if (variableValueMaybe == null)
                {
                    continue;
                }
                var variableValue = variableValueMaybe.Value;

                ObservationNameValue onv = new ObservationNameValue();
                onv.VariableName = _variableAbbreviations[rv.Name];
                if (_variableNameColor != default(Color))
                {
                    onv.VariableNameColor = _variableNameColor;
                }
                onv.VariableValueLabel = rv.Space.GetLabel(variableValue);
                onv.VariableValueColor = rv.Space.GetColor(variableValue);

                xFlow.Children.Add(onv);
            }
        }
Exemple #3
0
        private void RefreshUI()
        {
            xFlow.Children.Clear();

            if (_variables == null || _values == null)
            {
                return;
            }

            foreach (var rv in _variables)
            {
                var variableValueMaybe = _values.TryValueForVariable(rv.Name);
                if (variableValueMaybe == null)
                {
                    continue;
                }
                var variableValue = variableValueMaybe.Value;

                ObservationNameValue onv = new ObservationNameValue();
                onv.VariableName = _variableAbbreviations[rv.Name];
                if (_variableNameColor != default(Color))
                {
                    onv.VariableNameColor = _variableNameColor;
                }
                onv.VariableValueLabel = rv.Space.GetLabel(variableValue);
                onv.VariableValueColor = rv.Space.GetColor(variableValue);

                xFlow.Children.Add(onv);
            }
        }