-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
135 lines (129 loc) · 9.37 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
<Window x:Class="ManaTranslation.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="410" Width="320" Icon="image/22.ico" Style="{StaticResource for_noresize_window}" WindowStyle="None" AllowsTransparency="True" ResizeMode="NoResize" Background="WhiteSmoke">
<Window.Resources>
<ControlTemplate x:Key="ButtonTemplate" TargetType="{x:Type Button}">
<Border Name="Border" BorderBrush="{TemplateBinding Button.Foreground}" BorderThickness="{TemplateBinding Button.BorderThickness}"
CornerRadius="2" Background="{TemplateBinding Button.Background}" TextBlock.Foreground="{TemplateBinding Button.Foreground}"
Margin="{TemplateBinding Button.Padding}">
<ContentPresenter RecognizesAccessKey="True" HorizontalAlignment="{TemplateBinding Button.HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"></ContentPresenter>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Border" Property="Background" Value="#04ba19"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Border" Property="Background" Value="#60d86e"/>
<Setter TargetName="Border" Property="BorderBrush" Value="#60d86e"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!--动画-->
<Storyboard x:Key="Storyboard1">
<DoubleAnimationUsingPath Duration="0:0:0:0.5" Source="X" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="_221" RepeatBehavior="1x">
<DoubleAnimationUsingPath.PathGeometry>
<PathGeometry Figures="M-2.283,0.783 L24.717,0.783"/>
</DoubleAnimationUsingPath.PathGeometry>
</DoubleAnimationUsingPath>
<DoubleAnimationUsingPath Duration="0:0:0:0.5" Source="Y" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="_221" RepeatBehavior="1x">
<DoubleAnimationUsingPath.PathGeometry>
<PathGeometry Figures="M-2.283,0.783 L24.717,0.783"/>
</DoubleAnimationUsingPath.PathGeometry>
</DoubleAnimationUsingPath>
</Storyboard>
<Storyboard x:Key="Storyboard2">
<DoubleAnimationUsingPath Duration="0:0:0:0.5" Source="X" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="m1">
<DoubleAnimationUsingPath.PathGeometry>
<PathGeometry Figures="M4.151,0.783 L-23.849,1.783"/>
</DoubleAnimationUsingPath.PathGeometry>
</DoubleAnimationUsingPath>
<DoubleAnimationUsingPath Duration="0:0:0:0.5" Source="Y" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="m1">
<DoubleAnimationUsingPath.PathGeometry>
<PathGeometry Figures="M4.151,0.783 L-23.849,1.783"/>
</DoubleAnimationUsingPath.PathGeometry>
</DoubleAnimationUsingPath>
</Storyboard>
<!--动画-->
</Window.Resources>
<Grid>
<StackPanel MouseMove="window_Move" Background="#414141" Height="65" VerticalAlignment="Bottom" Orientation="Horizontal">
<Button Margin="15,10,0,0" x:Name="yuyan_btn" Click="yuyan_Click" Template="{StaticResource ButtonTemplate}" Background="#FF17FD00" Width="50" Height="20" HorizontalAlignment="Left">
<TextBlock Margin="10,0,5,0" ForceCursor="True" Foreground="#414141" Text="语 言"/>
</Button>
<Button Margin="15,27.5,0,17.499" x:Name="yin_btn" Click="yin_Click" Template="{StaticResource ButtonTemplate}" Background="#FF17FD00" Width="50" Height="20" HorizontalAlignment="Left">
<TextBlock Margin="10,0,5,0" ForceCursor="True" Foreground="#414141" Text="发 音"/>
</Button></StackPanel>
<Grid Margin="15,15,15,72">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Canvas Margin="0,10,0,0">
<TextBlock VerticalAlignment="Center" Foreground="#414141" HorizontalAlignment="Center" Text="F C B
TRANSLATION" FontSize="18" FontWeight="Bold" Canvas.Left="0" Canvas.Top="5">
<TextBlock.Effect>
<DropShadowEffect BlurRadius="10" Opacity="0.4" Direction="320" ShadowDepth="2"/>
</TextBlock.Effect>
</TextBlock>
<Ellipse Name="tu" MouseDown="Close_btn" Width="66" Height="66" Canvas.Right="10" Canvas.Left="194" Canvas.Top="-7.5">
<Ellipse.Effect>
<DropShadowEffect ShadowDepth="1"/>
</Ellipse.Effect>
<Ellipse.Fill>
<ImageBrush ImageSource="image/1.jpg" Stretch="UniformToFill"></ImageBrush>
</Ellipse.Fill>
</Ellipse>
</Canvas>
<StackPanel Grid.Row="1">
<TextBox Name="yuan_txt" Background="Transparent" GotFocus="textbox_gotFocus" PreviewMouseLeftButtonDown="textbox_Buttondown" Foreground="Black" TextWrapping="Wrap" Width="Auto" FontSize="15" VerticalAlignment="Bottom" VerticalContentAlignment="Bottom" MaxLines="3" BorderThickness="0" Height="54"></TextBox>
<Line X1="0" Y1="4" X2="280" Y2="4" Stroke="Gray" StrokeThickness="1"></Line>
</StackPanel>
<StackPanel Grid.Row="2">
<TextBox Name="yi_txt" TextWrapping="Wrap" GotFocus="textbox2_gotfocus" PreviewMouseLeftButtonDown="textbox_Buttondown" Background="Transparent" Foreground="Black" Width="Auto" FontSize="15" FontWeight="Bold" VerticalAlignment="Bottom" VerticalContentAlignment="Bottom" MaxLines="3" BorderThickness="0" Height="54"></TextBox>
<Line X1="0" Y1="4" X2="280" Y2="4" Margin="0,2,0,10" Stroke="Gray" StrokeThickness="1"></Line>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="3">
<TextBlock Margin="0,43,0,0" FontSize="15" x:Name="TimerText"/>
<TextBlock HorizontalAlignment="Right" Margin="50,43,0,0" FontSize="15" Name="month"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="4" Name="stackpanel1">
<!--开关-->
<Button x:Name="fanyi_btn" Click="fanyi_Click" IsDefault="True" Template="{StaticResource ButtonTemplate}" Background="#414141" Width="50" Height="20" HorizontalAlignment="Left" Margin="0,20,0,15">
<TextBlock Margin="10,0,5,0" ForceCursor="True" Foreground="#ffffff" Text="翻 译"/>
</Button>
<!--开关-->
<Grid Margin="20,0,0,0" Width="200">
<TextBlock Text="显示背景图像" Margin="79,26,42,1"></TextBlock>
<Rectangle Fill="#FF9DF594" x:Name="rect1" HorizontalAlignment="Left" Height="11.598" Margin="161,27.41,0,0" Stroke="#FF17FD00" VerticalAlignment="Top" Width="35" RadiusX="5" RadiusY="5"/>
<Path Data="M225,174 L252,174" Fill="Transparent" HorizontalAlignment="Left" Height="1" Margin="165.5,33.5,0,0" Stretch="Fill" Stroke="Transparent" VerticalAlignment="Top" Width="28"/>
<Ellipse x:Name="_221" MouseDown="btn221" Fill="#FF17FD00" HorizontalAlignment="Left" Height="16.566" Margin="160,24.934,0,0" Stroke="#FF17FD00" VerticalAlignment="Top" Width="16.566" RenderTransformOrigin="0.5,0.5">
<Ellipse.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
<Path x:Name="___Path2_" Data="M250.5,174 L222.5,174" Fill="Transparent" HorizontalAlignment="Left" Height="1" Margin="164.5,33.5,0,0" Stretch="Fill" Stroke="Transparent" VerticalAlignment="Top" Width="29"/>
<Ellipse x:Name="m1" MouseDown="btn2212" Fill="#FF17FD00" HorizontalAlignment="Left" Height="16.566" Margin="181.566,24.934,0,0" Stroke="#FF17FD00" VerticalAlignment="Top" Width="16.566" RenderTransformOrigin="0.5,0.5">
<Ellipse.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
</Grid>
<!--开关-->
</StackPanel>
</Grid>
</Grid>
</Window>