/// <summary> /// Prepares field with all needed information including UI representation. /// </summary> /// <param name="properties">information about a field, needed for e.g setting id of field</param> /// <param name="road">if not empty, field belongs to some inner class. This fact must be set into fields id.</param> /// <param name="skin">defines the look of field</param> /// <returns>prepared field with all needed information</returns> public AFField prepareField(AFFieldInfo properties, StringBuilder road, Skin skin) { AFField field = new AFField(properties); field.setId(road.ToString() + properties.getId()); //LABEL TextBlock label = buildLabel(properties, skin); field.setLabel(label); //ERROR TEXT TextBlock errorView = buildErrorView(skin); field.setErrorView(errorView); //Input view FrameworkElement widget = null; AbstractWidgetBuilder widgetBuilder = WidgetBuilderFactory.getInstance().getFieldBuilder(field, skin); if (widgetBuilder != null && (widget = widgetBuilder.buildFieldView()) != null) { field.setWidgetBuilder(widgetBuilder); field.setFieldView(widget); } //put it all together //when field is not visible don't even add it to form; FrameworkElement completeView = buildCompleteView(field, skin); if (!properties.isVisible()) { completeView.Visibility = Visibility.Collapsed; } field.setCompleteView(completeView); return field; }