AvaloniaUtils/DialogHost.Avalonia

How to make the dialog bigger?

amp64 opened this issue · 3 comments

amp64 commented

How do I make the dialog bigger? (This is on iOS)

	<dialogHostAvalonia:DialogHost x:Name="DialogHost" DialogMargin="4" IsOpen="{Binding VolumePopupOpen}">
		<dialogHostAvalonia:DialogHost.DialogContent>
			<views:GroupVolumeView DataContext="{Binding CurrentZone}"
								   HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
		</dialogHostAvalonia:DialogHost.DialogContent>

DialogMargin has no apparent affect. See screenshot:
20240905_234928000_iOS

Hello, @amp64

Set up the Height and Width property of your dialog view or use custom positioner to change the placement rules of dialog content.

amp64 commented

Thank you! This was my solution:


    private class DialogPopupPositioner : IDialogPopupPositioner
    {
        public Rect Update(Size anchorRectangle, Size size)
        {
            double margin = 12;
            Rect posn = new Rect(0, 0, anchorRectangle.Width, anchorRectangle.Height);
            return posn.Inflate(-margin);
        }
    }

Actually you don't need to implement a custom positioner by yourself, cuz you can try AlignmentDialogPopupPositioner, it should fit all your needs