private void updateLayoutHeight() { var newHeight = heights[(int)editorMode]; tabLayout.RequestLayout(); controlButtons.ForceLayout(); Activity.RunOnUiThread(() => { var heightInPixels = newHeight.DpToPixels(Context); var pagerLayout = pager.LayoutParameters; pagerLayout.Height = heightInPixels; pager.LayoutParameters = pagerLayout; Dialog.Window.SetDefaultDialogLayout(Activity, Context, heightDp: ViewGroup.LayoutParams.WrapContent); }); }