void ArrangeChildren(bool force) { if (widgets == null || rects == null) { return; } // Use the 'widgets' field so we can easily map a control position by looking at 'rects'. for (int i = 0; i < widgets.Length; i++) { var element = WidgetBackend.GetFrameworkElement(widgets [i]); if (!element.IsArrangeValid || !element.IsMeasureValid || force) { // Measure the widget again using the allocation constraints. This is necessary // because WPF widgets my cache some measurement information based on the // constraints provided in the last Measure call (which when calculating the // preferred size is normally set to infinite. var r = rects[i].WithPositiveSize(); if (force) { // Don't recalculate the size unless a relayout is being forced element.InvalidateMeasure(); element.Measure(new SW.Size(r.Width, r.Height)); } element.Arrange(r.ToWpfRect()); // element.UpdateLayout (); } } }
private void OnContentLoaded(object sender, RoutedEventArgs routedEventArgs) { WidgetBackend backend = (WidgetBackend)((FrameworkElement)sender).Tag; var surface = backend.Frontend as IWidgetSurface; if (surface == null) { return; } surface.Reallocate(); }
void ArrangeChildren(bool force) { if (widgets == null || rects == null) { return; } // Use the 'widgets' field so we can easily map a control position by looking at 'rects'. for (int i = 0; i < widgets.Length; i++) { var element = WidgetBackend.GetFrameworkElement(widgets [i]); if (!element.IsArrangeValid || force) { element.Arrange(DataConverter.ToWpfRect(rects [i])); } } }
public virtual void UpdateChildPlacement(IWidgetBackend childBackend) { WidgetBackend.SetChildPlacement(childBackend); }