private UserControl constructNameValueControl(FieldDataSelectionBuilder.SearchSpecification.RestrictionSpecification restriction)
        {
            var nvControl = new NameValueControl();

            var titleBinding = new Binding(PropertyHelper.ExtractPropertyName(() => restriction.TitleID))
            {
                Source = restriction,
                Converter = this.LanguageStringFromIDConverter,
                Mode = BindingMode.OneWay
            };
            nvControl.SetBinding(NameValueControl.TitleProperty, titleBinding);

            var valueBinding = new Binding(PropertyHelper.ExtractPropertyName(() => restriction.Value))
            {
                Source = restriction,
                Mode = BindingMode.OneWayToSource,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };
            nvControl.SetBinding(NameValueControl.ValueProperty, valueBinding);

            var checkedBinding = new Binding(PropertyHelper.ExtractPropertyName(() => restriction.IsEnabled))
            {
                Mode = BindingMode.OneWayToSource,
                Source = restriction,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };
            nvControl.SetBinding(NameValueControl.IsCheckedProperty, checkedBinding);

            return nvControl;
        }
        private UserControl constructDateRangeControl(FieldDataSelectionBuilder.SearchSpecification.RestrictionSpecification restriction)
        {
            UserControl restrictionControl;
            var drControl = new DateRangeControl();

            var titleBinding = new Binding(PropertyHelper.ExtractPropertyName(() => restriction.TitleID))
            {
                Source = restriction,
                Converter = LanguageStringFromIDConverter,
                Mode = BindingMode.OneWay
            };
            drControl.SetBinding(DateRangeControl.TitleProperty, titleBinding);

            var startDateBinding = new Binding(PropertyHelper.ExtractPropertyName(() => restriction.StartTime))
            {
                Source = restriction,
                Mode = BindingMode.OneWayToSource,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };
            drControl.SetBinding(DateRangeControl.StartDateProperty, startDateBinding);

            var endDateBinding = new Binding(PropertyHelper.ExtractPropertyName(() => restriction.EndTime))
            {
                Source = restriction,
                Mode = BindingMode.OneWayToSource,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };
            drControl.SetBinding(DateRangeControl.EndDateProperty, endDateBinding);

            var checkedBinding = new Binding(PropertyHelper.ExtractPropertyName(() => restriction.IsEnabled))
            {
                Source = restriction,
                Mode = BindingMode.OneWayToSource,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };
            drControl.SetBinding(DateRangeControl.IsCheckedProperty, checkedBinding);

            drControl.From = OptionsAccess.Language.getLanguageString(1231);
            drControl.Until = OptionsAccess.Language.getLanguageString(1232);

            restrictionControl = drControl;
            return restrictionControl;
        }