Hiding the toolbar in our PDF viewer
By modifying the ShowToolbar
dependency property, you can easily control when the toolbar should be shown or hidden.
Update this property of PDFView
, and the toolbar will be shown when the property is set to true
and hidden when set to false
.
The following example toggles the ShowToolbar
property between both states, so it’ll show it if it’s hidden and hide it if it’s visible:
<!-- MyPage.xaml --> ... <pspdfkit:PDFView x:Name="PDFView" Initialized="OnPDFViewInitialized" ShowToolbar="{Binding ShouldShowToolbar}" /> <Button Text="Toggle Toolbar" Clicked="OnToggleToolbarClicked" /> ...
// MyPage.xaml.cs ... private void OnToggleToolbarClicked(object sender, EventArgs e) { PDFView.ShowToolbar = !PDFView.ShowToolbar; } ...