/** * \brief This functions is called on the fill stace vertically case */ private void FillSpaceVertically() { mView.ClearValue(Canvas.HeightProperty); mView.SetValue(Canvas.VerticalAlignmentProperty, VerticalAlignment.Stretch); setVerticalSizePolicyFlags(true, false); mHeight = MoSync.Constants.MAW_CONSTANT_FILL_AVAILABLE_SPACE; //In case of setting the widget property after it is added //to a parent widget // FILL_SPACE_V in a HorizontalLayout if (this.GetParent() is HorizontalLayout) { HorizontalLayout parent = (this.GetParent() as HorizontalLayout); Grid content = (parent.View as Grid); content.ColumnDefinitions[ColumnNumber].Width = new GridLength(1, GridUnitType.Auto); parent.SetContainerOrientation(this, ColumnNumber, Orientation.Horizontal); if (FILL_SPACE_H && parent.RemoveWidgetFromStackPanelContainer(this, ColumnNumber)) { content.ColumnDefinitions[ColumnNumber].Width = new GridLength(1, GridUnitType.Star); Grid.SetRow(View as FrameworkElement, RowNumber); Grid.SetColumn(View as FrameworkElement, ColumnNumber); } } // FILL_SPACE_V in a VerticalLayout else if (this.GetParent() is VerticalLayout) { VerticalLayout parent = (this.GetParent() as VerticalLayout); Grid content = (parent.View as Grid); content.RowDefinitions[RowNumber].Height = new GridLength(1, GridUnitType.Star); parent.SetContainerOrientation(this, RowNumber, Orientation.Horizontal); if (FILL_SPACE_H && parent.RemoveWidgetFromStackPanelContainer(this, RowNumber)) { Grid.SetColumn(View as FrameworkElement, ColumnNumber); Grid.SetRow(View as FrameworkElement, RowNumber); } } }