-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
152 lines (150 loc) · 10.6 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<Window x:Class="notebook.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:notebook"
mc:Ignorable="d"
Title="datapack notepad" Height="680" Width="1250" WindowStyle="None" AllowsTransparency="True" WindowStartupLocation="CenterScreen" SizeChanged="Window_SizeChanged" >
<Grid>
<!-- Ui designer - Bridge Grain-->
<Canvas HorizontalAlignment="Left" VerticalAlignment="Top" Background="#FFF9F9F9" Height="32" Width="1250" MouseDown="Canvas_MouseDown" >
<Canvas.Effect>
<DropShadowEffect Color="#FFC9C9C9" BlurRadius="10"></DropShadowEffect>
</Canvas.Effect>
<Button x:Name="BtnClose" Canvas.Left="1221" Canvas.Top="8" Width="18" Height="18" Click="BtnClose_Click">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid Margin="-1,1,1,-1">
<Grid x:Name="Uc_Grid" VerticalAlignment="Center" Height="12" Width="12">
<Path x:Name="Uc_Path1" Stroke="#FF0081FF" StrokeThickness="2" Data="M0,0 L16,16" VerticalAlignment="Center" HorizontalAlignment="Center"></Path>
<Path x:Name="Uc_Path2" Stroke="#FF0081FF" StrokeThickness="2" Data="M16,0 L0,16" VerticalAlignment="Center" HorizontalAlignment="Center"></Path>
<Grid.RenderTransform>
<RotateTransform x:Name="Uc_Transform" Angle="0" CenterY="12.5" CenterX="12.5"></RotateTransform>
</Grid.RenderTransform>
</Grid>
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"></ContentPresenter>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Uc_Path1" Property="Data" Value="M0,0 L16,16"></Setter>
<Setter TargetName="Uc_Path2" Property="Data" Value="M16,0 L0,16"></Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Uc_Path1" Property="Data" Value="M0,0 L16,16"></Setter>
<Setter TargetName="Uc_Path2" Property="Data" Value="M16,0 L0,16"></Setter>
</Trigger>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard HandoffBehavior="SnapshotAndReplace">
<Storyboard TargetName="Uc_Transform" TargetProperty="Angle">
<DoubleAnimation From="0" To="1" Duration="0:0:0.1"></DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Label Content="数据包编辑器" Height="26" Canvas.Left="5" Canvas.Top="4" Width="85" Foreground="#FF333333" Background="{x:Null}"/>
<Button x:Name="Minimize" Canvas.Left="1181" Canvas.Top="8" Width="18" Height="18" Click="Minimize_Click">
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<Grid Margin="-1,1,1,-1">
<Grid x:Name="Uc_Grid" VerticalAlignment="Center" Height="12" Width="12">
<Grid.RenderTransform>
<RotateTransform x:Name="Uc_Transform" Angle="0" CenterY="12.5" CenterX="12.5"/>
</Grid.RenderTransform>
<Path x:Name="Uc_Path1" Stroke="#FF0081FF" StrokeThickness="2" Data="M16,0 L0,0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Uc_Path1" Property="Data" Value="M0,0 L16,16"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Uc_Path1" Property="Data" Value="M0,0 L16,16"/>
</Trigger>
<EventTrigger RoutedEvent="UIElement.MouseEnter">
<BeginStoryboard HandoffBehavior="SnapshotAndReplace">
<Storyboard Storyboard.TargetName="Uc_Transform" Storyboard.TargetProperty="Angle">
<DoubleAnimation From="0" To="1" Duration="0:0:0.1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<!--放大按钮-->
<Button x:Name="BtnClose_Copy1" Canvas.Left="1202" Canvas.Top="8" Width="18" Height="18">
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<Grid Margin="-1,1,1,-1">
<Grid x:Name="Uc_Grid" VerticalAlignment="Center" Height="12" Width="12">
<Grid.RenderTransform>
<RotateTransform x:Name="Uc_Transform" Angle="0" CenterY="12.5" CenterX="12.5"/>
</Grid.RenderTransform>
<Path x:Name="Uc_Path1" Stroke="#FF0081FF" StrokeThickness="2" Data="M0,0L16,0" VerticalAlignment="Stretch" HorizontalAlignment="Left"/>
<Path x:Name="Uc_Path2" Stroke="#FF0081FF" StrokeThickness="2" Data="M0,16L0,0" VerticalAlignment="Stretch" HorizontalAlignment="Left"/>
<Path x:Name="Uc_Path3" Stroke="#FF0081FF" StrokeThickness="2" Data="M0,0L0,16" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
<Path x:Name="Uc_Path4" Stroke="#FF0081FF" StrokeThickness="2" Data="M0,12L12,12" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
</Grid>
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Uc_Path1" Property="Data" Value="M0,0 L16,16"/>
<Setter TargetName="Uc_Path2" Property="Data" Value="M16,0 L0,16"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Uc_Path1" Property="Data" Value="M0,0 L16,16"/>
<Setter TargetName="Uc_Path2" Property="Data" Value="M16,0 L0,16"/>
</Trigger>
<EventTrigger RoutedEvent="UIElement.MouseEnter">
<BeginStoryboard HandoffBehavior="SnapshotAndReplace">
<Storyboard Storyboard.TargetName="Uc_Transform" Storyboard.TargetProperty="Angle">
<DoubleAnimation From="0" To="1" Duration="0:0:0.1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</Canvas>
<!--编辑器-->
<TextBox x:Name="TextBox_Edit" HorizontalAlignment="Left" Height="623" Margin="64,57,0,0" TextWrapping="Wrap" AcceptsReturn="True" Text="#include <stdio.h>

int main()
{
 printf("Hello User!");
}" VerticalAlignment="Top" Width="1186" Background="White" BorderBrush="#FFE4E4E4" SelectionBrush="#FF008BFF" TextChanged="TextBox_Edit_TextChanged" Padding="0" FontSize="14" KeyDown="TextBox_Edit_KeyDown">
<TextBox.Effect>
<DropShadowEffect Color="#FFC9C9C9" BlurRadius="8" RenderingBias="Quality" Direction="100" ShadowDepth="2"/>
</TextBox.Effect>
</TextBox>
<Canvas HorizontalAlignment="Left" Height="31" Margin="977,649,0,0" VerticalAlignment="Top" Width="273" Background="#7AF8F8F8">
<Label Content="第1行" Height="31" Width="273"/>
</Canvas>
<Menu HorizontalAlignment="Left" Height="25" Margin="0,32,0,0" VerticalAlignment="Top" Width="1250" FontSize="16px" Background="#FFF8F8F8">
<MenuItem Header="File">
<!--菜单项为MenuItem,文字使用属性 Header-->
<MenuItem Name="menuOpen" Header="Open" Click="menuOpen_Click"></MenuItem>
<MenuItem Header="Save" Click="MenuItem_Click_saver"></MenuItem>
<MenuItem Header="Save as" Click="MenuItem_Click_saver_as"></MenuItem>
</MenuItem>
<MenuItem Header="Edit"></MenuItem>
<MenuItem Header="View"></MenuItem>
<MenuItem Header="About"></MenuItem>
</Menu>
<Grid HorizontalAlignment="Left" Height="623" Margin="0,57,0,0" VerticalAlignment="Top" Width="64">
<Grid.Effect>
<DropShadowEffect Color="#FFC9C9C9" BlurRadius="8" RenderingBias="Quality" Direction="100" ShadowDepth="2"/>
</Grid.Effect>
<Border
Grid.Column="0"
Name="imgBorder"
CornerRadius="100" Margin="6,10,10,565" Width="48" Height="48" >
<Border.Background>
<ImageBrush ImageSource="QQ图片20191223200358.jpg" Stretch="Uniform"/>
</Border.Background>
</Border>
</Grid>
</Grid>
</Window>