Skip to content

PdfViewer goes to mobilelayout when resized. #22301

Description

@ykarpeev

Describe the bug

Hello, I am trying to use PDFViewer to just show a PDF while hiding all controls - this is working OK but I noticed that if I resize the application a few controls suddenly show up. Here are some screenshots:

Everything looking as expected:

Image

After resizing the width of the application:

Image

I can also see IsMobileLayout turn to true when this happens:

Image

And if I set it to false the unwanted controls go away.

To Reproduce

  • Create a PDF Viewer control

  • Resize application down

  • Observe buttons show up.

      <pdf:PdfViewer x:Name="Viewer"
                     
                     DocumentSource="{Binding Pdf}"
                     ViewMode="Continuous"
                     IsSidebarVisible="False"
                     IsHighlightToolVisible="False"
                     IsUnderlineToolVisible="False"
                     IsStrikethroughToolVisible="False"
                     IsSquigglyToolVisible="False"
                     IsRedactToolVisible="False"
                     IsDrawToolVisible="False"
                     IsShapeToolVisible="False"
                     IsTextToolVisible="False"
                     IsNoteToolVisible="False"
                     IsLinkToolVisible="False"
                     IsStampToolVisible="False"
                     IsPrintVisible="False"
                     IsMoreOptionsVisible="False"
                     IsToolbarVisible="False" 
                     AllowAnnotationEditing="False"
                     IsMobileLayout="False"
                     IsReadOnly="True"
                     AllowDocumentSaving="False"
                     AllowTextSelection="False"
                     AllowFormEditing="False"
                     SidebarMode="None" />
    

Expected behavior

I expect the additional buttons to stay hidden regardless of the size of the control.

Avalonia version

12.1.3

OS

Windows

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions