| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <Window xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:previewer="clr-namespace:QuestPDF.Previewer"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="QuestPDF.Previewer.PreviewerWindow"
- x:DataType="previewer:PreviewerWindowViewModel"
- x:CompileBindings="True"
- WindowStartupLocation="CenterScreen"
- ExtendClientAreaToDecorationsHint="true"
- ExtendClientAreaTitleBarHeightHint="-1"
- Background="#666"
- Icon="/Resources/Logo.png"
- UseLayoutRounding="True"
- Title="QuestPDF Document Preview">
-
- <Window.Styles>
- <Style Selector="Button.actions">
- <Setter Property="VerticalAlignment" Value="Bottom"/>
- <Setter Property="HorizontalAlignment" Value="Left"/>
- <Setter Property="Padding" Value="10"/>
- <Setter Property="CornerRadius" Value="100"/>
- <Setter Property="Background" Value="#888"/>
- </Style>
-
- <Style Selector="Button:pointerover /template/ ContentPresenter">
- <Setter Property="Background" Value="#999"/>
- </Style>
- </Window.Styles>
- <Panel>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="32" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
- <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
- VerticalAlignment="Center" HorizontalAlignment="Center"
- TextAlignment="Center" Text="QuestPDF Previewer" FontSize="14" Foreground="#DFFF" FontWeight="Regular" IsHitTestVisible="False" />
-
- <previewer:PreviewerControl Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- CurrentScroll="{Binding CurrentScroll, Mode=TwoWay}"
- ScrollViewportSize="{Binding ScrollViewportSize, Mode=OneWayToSource}"
- Pages="{Binding Pages, Mode=OneWay}" />
-
- <Border IsVisible="{Binding DocumentContentHasLayoutOverflowIssues}" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Padding="16,8" Background="#F44336" CornerRadius="8" BoxShadow="0 0 8 0 #44000000" Margin="32">
- <StackPanel Orientation="Horizontal" Spacing="8">
- <Viewbox Width="24" Height="24">
- <Canvas Width="24" Height="24">
- <Path Fill="White" Data="M20 17H22V15H20V17M20 7V13H22V7M6 16H11V18H6M6 12H14V14H6M4 2C2.89 2 2 2.89 2 4V20C2 21.11 2.89 22 4 22H16C17.11 22 18 21.11 18 20V8L12 2M4 4H11V9H16V20H4Z" />
- </Canvas>
- </Viewbox>
-
- <TextBlock VerticalAlignment="Center">Document has layout problems</TextBlock>
- </StackPanel>
- </Border>
-
- <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical" VerticalAlignment="Bottom" Spacing="16" Margin="32">
- <Button Classes="actions"
- Command="{Binding ShowPdfCommand, Mode=OneTime}"
- IsVisible="{Binding !!Pages.Count}"
- ToolTip.Tip="Generates PDF file and shows it in the default browser. Useful for testing compatibility and interactive links.">
- <Viewbox Width="24" Height="24">
- <Canvas Width="24" Height="24">
- <Path Fill="White" Data="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H13C12.59,21.75 12.2,21.44 11.86,21.1C11.53,20.77 11.25,20.4 11,20H6V4H13V9H18V10.18C18.71,10.34 19.39,10.61 20,11V8L14,2M20.31,18.9C21.64,16.79 21,14 18.91,12.68C16.8,11.35 14,12 12.69,14.08C11.35,16.19 12,18.97 14.09,20.3C15.55,21.23 17.41,21.23 18.88,20.32L22,23.39L23.39,22L20.31,18.9M16.5,19A2.5,2.5 0 0,1 14,16.5A2.5,2.5 0 0,1 16.5,14A2.5,2.5 0 0,1 19,16.5A2.5,2.5 0 0,1 16.5,19Z" />
- </Canvas>
- </Viewbox>
- </Button>
-
- <Button Classes="actions"
- Command="{Binding ShowDocumentationCommand, Mode=OneTime}"
- ToolTip.Tip="Opens official QuestPDF documentation">
- <Viewbox Width="24" Height="24">
- <Canvas Width="24" Height="24">
- <Path Fill="White" Data="M19 1L14 6V17L19 12.5V1M21 5V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5V6C10.55 4.9 8.45 4.5 6.5 4.5C4.55 4.5 2.45 4.9 1 6V20.65C1 20.9 1.25 21.15 1.5 21.15C1.6 21.15 1.65 21.1 1.75 21.1C3.1 20.45 5.05 20 6.5 20C8.45 20 10.55 20.4 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5M10 18.41C8.75 18.09 7.5 18 6.5 18C5.44 18 4.18 18.19 3 18.5V7.13C3.91 6.73 5.14 6.5 6.5 6.5C7.86 6.5 9.09 6.73 10 7.13V18.41Z" />
- </Canvas>
- </Viewbox>
- </Button>
-
- <Button Classes="actions"
- Command="{Binding SponsorProjectCommand, Mode=OneTime}"
- ToolTip.Tip="Do you like QuestPDF? Please consider sponsoring the project. It really helps!">
- <Viewbox Width="24" Height="24">
- <Canvas Width="24" Height="24">
- <Path Fill="White" Data="M12,21.1L10.5,22.4C3.9,16.5 0.5,13.4 0.5,9.6C0.5,8.4 0.9,7.3 1.5,6.4C1.5,6.6 1.5,6.8 1.5,7C1.5,11.7 5.4,15.2 12,21.1M13.6,17C18.3,12.7 21.5,9.9 21.6,7C21.6,5 20.1,3.5 18.1,3.5C16.5,3.5 15,4.5 14.5,5.9H12.6C12,4.5 10.5,3.5 9,3.5C7,3.5 5.5,5 5.5,7C5.5,9.9 8.6,12.7 13.4,17L13.5,17.1M18,1.5C21.1,1.5 23.5,3.9 23.5,7C23.5,10.7 20.1,13.8 13.5,19.8C6.9,13.9 3.5,10.8 3.5,7C3.5,3.9 5.9,1.5 9,1.5C10.7,1.5 12.4,2.3 13.5,3.6C14.6,2.3 16.3,1.5 18,1.5Z" />
- </Canvas>
- </Viewbox>
- </Button>
- </StackPanel>
-
- <ScrollBar Grid.Row="1" Grid.Column="1"
- Orientation="Vertical"
- AllowAutoHide="False"
- Minimum="0" Maximum="1"
- IsVisible="{Binding VerticalScrollbarVisible, Mode=OneWay}"
- Value="{Binding CurrentScroll, Mode=TwoWay}"
- ViewportSize="{Binding ScrollViewportSize, Mode=OneWay}"></ScrollBar>
- </Grid>
- </Panel>
- </Window>
|