/// <summary>
        ///    Hide the layout if no item is being displayed. Otherwise adjust the height of the layout item to fit exactly the
        ///    space needed by the grid view
        /// </summary>
        private void adjustLayoutItemForView <T>(LayoutControlItem layoutControlItem, UxGridView gridView, GridViewBinder <T> gridViewBinder)
        {
            bool hasItems = (gridViewBinder.Source.Any());

            layoutControlItem.Visibility          = LayoutVisibilityConvertor.FromBoolean(hasItems);
            layoutControlItem.SizeConstraintsType = SizeConstraintsType.Custom;
            gridView.BestFitColumns();
            layoutControlItem.AdjustControlHeight(gridView.OptimalHeight);
        }
        public static void AddExportModes(this RadioGroup radioGroup, LayoutControlItem layoutControlItem)
        {
            radioGroup.Properties.Items.AddRange(new[]
            {
                new RadioGroupItem(SnapshotExportMode.Project, Captions.SnapshotExportModeProject),
                new RadioGroupItem(SnapshotExportMode.Snapshot, Captions.SnapshotExportModeSnapshot)
            });

            layoutControlItem.AdjustControlHeight(UIConstants.Size.RADIO_GROUP_HEIGHT);
        }
        protected virtual void AdjustLayoutItemSize(LayoutControlItem layoutControlItem, IResizableView view, int height)
        {
            if (layoutControlItem == null || layoutControlItem.Parent == null)
            {
                return;
            }

            try
            {
                layoutControlItem.Owner.BeginUpdate();
                layoutControlItem.AdjustControlHeight(height);
                var group = layoutControlItem.Parent;
                //only one item in the group and the view should be hidden
                group.Visibility = LayoutVisibilityConvertor.FromBoolean(height > 0 || group.Items.Count > 1);
                view.Repaint();
            }
            finally
            {
                layoutControlItem.Owner.EndUpdate();
            }
        }
Exemple #4
0
        public override void InitializeResources()
        {
            base.InitializeResources();

            _rgPlasmaBindingPartner = new RadioGroup {
                Name = "rgPlasmaBindingPartner"
            };
            _rgPlasmaBindingPartner.Properties.Items.AddRange(new[]
            {
                new RadioGroupItem(PlasmaProteinBindingPartner.Albumin, PKSimConstants.UI.Albumin),
                new RadioGroupItem(PlasmaProteinBindingPartner.Glycoprotein, PKSimConstants.UI.Glycoprotein),
                new RadioGroupItem(PlasmaProteinBindingPartner.Unknown, PKSimConstants.UI.Unknown)
            });

            _layoutItemBindingMode = new LayoutControlItem
            {
                Parent  = layoutControl.Root,
                Control = _rgPlasmaBindingPartner,
                Text    = PKSimConstants.UI.FractionUnboundBindingType.FormatForLabel()
            };
            _layoutItemBindingMode.AdjustControlHeight(UIConstants.Size.RADIO_GROUP_HEIGHT);
            _layoutItemBindingMode.Move(layoutItemGrid, InsertType.Top);
            _rgPlasmaBindingPartner.SelectedIndexChanged += (o, e) => OnEvent(bindingPartnerChanged);
        }
Exemple #5
0
 private void adjustLayoutItemSize(LayoutControlItem layoutControlItem, IResizableView view, int height)
 {
     layoutControlItem.AdjustControlHeight(height);
     view.Repaint();
 }