126 lines
5.4 KiB
XML
126 lines
5.4 KiB
XML
<hc:Window x:Class="YY.Admin.Views.Print.PrintPreviewWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
|
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
|
|
Width="1200" Height="760"
|
|
MinWidth="900" MinHeight="560"
|
|
WindowStartupLocation="CenterOwner"
|
|
ResizeMode="CanResize"
|
|
Background="White"
|
|
BorderBrush="#f0f0f0"
|
|
BorderThickness="1"
|
|
Title="打印预览">
|
|
|
|
<Window.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
|
|
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary>
|
|
</Window.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="50"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- 顶部工具栏 -->
|
|
<Border Grid.Row="0"
|
|
Background="#fafafa"
|
|
BorderBrush="#f0f0f0"
|
|
BorderThickness="0,0,0,1">
|
|
<Grid Margin="16,0">
|
|
<StackPanel VerticalAlignment="Center">
|
|
<TextBlock x:Name="TbTemplateName"
|
|
FontSize="14" FontWeight="SemiBold"
|
|
Foreground="#333333"/>
|
|
<TextBlock x:Name="TbTemplateCode"
|
|
FontSize="11" Foreground="#888888" Margin="0,1,0,0"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"
|
|
VerticalAlignment="Center">
|
|
<TextBlock x:Name="TbStatus"
|
|
FontSize="12" Foreground="#888888"
|
|
VerticalAlignment="Center" Margin="0,0,16,0"/>
|
|
<Button Content="关闭" Click="CloseButton_Click"
|
|
Width="72" Height="30" FontSize="13"
|
|
Style="{StaticResource ButtonDefault}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="360"/>
|
|
<ColumnDefinition Width="8"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- 左侧参数 JSON 区 -->
|
|
<Border Grid.Column="0"
|
|
BorderBrush="#f0f0f0"
|
|
BorderThickness="0,0,1,0"
|
|
Background="#fafafa"
|
|
Padding="10">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock Text="参数JSON"
|
|
FontSize="13"
|
|
FontWeight="SemiBold"
|
|
Foreground="#333333"/>
|
|
|
|
<StackPanel Grid.Row="1"
|
|
Orientation="Horizontal"
|
|
Margin="0,8,0,8">
|
|
<Button Content="根据画布生成"
|
|
Click="GenerateMockJson_Click"
|
|
Height="28"
|
|
Padding="10,0"
|
|
FontSize="12"
|
|
Style="{StaticResource ButtonDefault}"/>
|
|
<Button Content="重新渲染"
|
|
Click="RenderByParamJson_Click"
|
|
Margin="8,0,0,0"
|
|
Height="28"
|
|
Padding="10,0"
|
|
FontSize="12"
|
|
Style="{StaticResource ButtonPrimary}"/>
|
|
</StackPanel>
|
|
|
|
<TextBox x:Name="TbParamJson"
|
|
Grid.Row="2"
|
|
AcceptsReturn="True"
|
|
AcceptsTab="True"
|
|
VerticalScrollBarVisibility="Auto"
|
|
HorizontalScrollBarVisibility="Auto"
|
|
FontFamily="Consolas"
|
|
FontSize="12"
|
|
TextWrapping="NoWrap"
|
|
BorderBrush="#d9d9d9"
|
|
BorderThickness="1"/>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<GridSplitter Grid.Column="1"
|
|
Width="8"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
ResizeBehavior="PreviousAndNext"
|
|
ShowsPreview="True"
|
|
Background="#f0f0f0"
|
|
Cursor="SizeWE"/>
|
|
|
|
<!-- 右侧 WebView2 预览区 -->
|
|
<wv2:WebView2 Grid.Column="2" x:Name="WebView" DefaultBackgroundColor="Transparent"/>
|
|
</Grid>
|
|
</Grid>
|
|
</hc:Window>
|