Inheritance: System.Windows.Controls.UserControl
        private void RefreshUI()
        {
            // Update variable name label.
            if (_variable == null)
            {
                xVariableName.Text = "";
            }
            else
            {
                xVariableName.Text = _variable.Name;
            }

            // Gather distributions.
            List <FObservation>         parentConfigurations = new List <FObservation>();
            List <DiscreteDistribution> distributions        = new List <DiscreteDistribution>();

            // TODO: Better ordering so that parent values change most on right, least on left.
            // TODO: Deal with limits better.
            const int maxTables = 100;

            foreach (var d in _distributions.EnumerateDistributions().Take(maxTables))
            {
                var parentConfig = d.Item1;
                var distribution = d.Item2;

                parentConfigurations.Add(parentConfig);
                distributions.Add(distribution);
            }

            // Create distribution displays.
            // TODO: Reuse existing if possible.
            xStack.Children.Clear();

            parentConfigurations
            .Zip(distributions, (p, d) => new { p, d })
            .Select(record =>
            {
                var dt = new DistributionTable();
                dt.SetData(_variable, _variableAbbreviations, record.d, record.p, _variableParents);
                return(dt);
            }
                    )
            .ForAll(dt =>
            {
                xStack.Children.Add(dt);
                dt.Margin = new Thickness(0, 0, 0, 24);
            });
        }
        private void RefreshUI()
        {
            // Update variable name label.
            if (_variable == null)
            {
                xVariableName.Text = "";
            }
            else
            {
                xVariableName.Text = _variable.Name;
            }

            // Gather distributions.
            List<FObservation> parentConfigurations = new List<FObservation>();
            List<DiscreteDistribution> distributions = new List<DiscreteDistribution>();

            // TODO: Better ordering so that parent values change most on right, least on left.
            // TODO: Deal with limits better.
            const int maxTables = 100;
            foreach (var d in _distributions.EnumerateDistributions().Take(maxTables))
            {
                var parentConfig = d.Item1;
                var distribution = d.Item2;

                parentConfigurations.Add(parentConfig);
                distributions.Add(distribution);
            }

            // Create distribution displays.
            // TODO: Reuse existing if possible.
            xStack.Children.Clear();

            parentConfigurations
                .Zip(distributions, (p, d) => new { p, d })
                .Select(record =>
                    {
                        var dt = new DistributionTable();
                        dt.SetData(_variable, _variableAbbreviations, record.d, record.p, _variableParents);
                        return dt;
                    }
                )
                .ForAll(dt =>
                {
                    xStack.Children.Add(dt);
                    dt.Margin = new Thickness(0, 0, 0, 24);
                });
        }