1 Star 0 Fork 1

Ernest Cui/Spacecraft-Launching-Demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MainWindow.xaml 35.70 KB
一键复制 编辑 原始数据 按行查看 历史
ec000 提交于 2022-10-22 23:19 +08:00 . Add project files.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
<Window x:Class="SpacecraftLaunching.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:SpacecraftLaunching"
mc:Ignorable="d"
Title="高中物理 - 航天器发射轨迹演示"
ResizeMode="CanMinimize"
WindowStartupLocation="CenterScreen"
SizeToContent="WidthAndHeight">
<Window.Background>
<ImageBrush ImageSource="/uires/stars.png"/>
</Window.Background>
<DockPanel
x:Name="dpMain"
LastChildFill="True"
Width="1200"
Height="675">
<!--左侧面板-->
<DockPanel
x:Name="dpAnimation"
Height="{Binding ElementName=dpMain,Path=Height}"
Width="1000">
<!--下方解说文本标签-->
<Label
Name="lblState"
DockPanel.Dock="Bottom"
Content=" "
FontSize="45"
HorizontalContentAlignment="Center"
Foreground="LightYellow"/>
<!--上方画布-->
<Canvas x:Name="cvAnimation"
DockPanel.Dock="Top"
Loaded="cvAnimation_Loaded">
<!--一次变轨路径第一部分-->
<Path x:Name="pthOneTrackChangePart1"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,52.31 A 95 126 0 0 0 0,-200">
<!--下面变换数据必须在代码中初始化修改-->
<Path.RenderTransform>
<TranslateTransform x:Name="ttPathCommom"
X="500"
Y="303.925"/>
</Path.RenderTransform>
</Path>
<!--一次变轨路径第二部分-->
<Path x:Name="pthOneTrackChangePart2"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,-200 A 200 200 0 1 0 4.19,-199.96">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommom,Path=X}"
Y="{Binding ElementName=ttPathCommom,Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--二次变轨路径第一部分-->
<Path x:Name="pthTwoTrackChangePart1"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,60 A 60 60 0 1 0 -3.06,59.92">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommom,Path=X}"
Y="{Binding ElementName=ttPathCommom,Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--二次变轨路径第二部分-->
<Path x:Name="pthTwoTrackChangePart2"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,60 A 90 117.48 0 1 0 0,-250">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommom,Path=X}"
Y="{Binding ElementName=ttPathCommom,Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--二次变轨路径第三部分-->
<Path x:Name="pthTwoTrackChangePart3"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,-250 A 250 250 0 1 0 3.94,-249.97">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommom,Path=X}"
Y="{Binding ElementName=ttPathCommom,Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--同步卫星路径第一部分-->
<Path x:Name="pthSyncSimPart1"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,60 A 60 60 0 1 0 -3.06,59.92">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommom,Path=X}"
Y="{Binding ElementName=ttPathCommom,Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--同步卫星路径第二四部分-->
<Path x:Name="pthSyncSimPart24"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,60 A 90 117.48 0 1 0 0,-250">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommom,Path=X}"
Y="{Binding ElementName=ttPathCommom,Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--同步卫星路径第三部分-->
<Path x:Name="pthSyncSimPart3"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,-250 A 90 117.48 0 1 0 0,60">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommom,Path=X}"
Y="{Binding ElementName=ttPathCommom,Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--同步卫星路径第五部分-->
<Path x:Name="pthSyncSimPart5"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,-250 A 250 250 0 1 0 3.94,-249.97">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommom,Path=X}"
Y="{Binding ElementName=ttPathCommom,Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥一号路径第一部分-->
<Path x:Name="pthCE1SimPart1"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,78.74 A 104.55 123.59 0 1 0 0,-168.44">
<!--下面变换数据必须在代码中初始化修改-->
<Path.RenderTransform>
<TranslateTransform x:Name="ttPathCommomLeft"
X="250"
Y="303.925"/>
</Path.RenderTransform>
</Path>
<!--嫦娥一号路径第二部分-->
<Path x:Name="pthCE1SimPart2"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,-168.44 A 104.55 123.59 0 1 0 0,78.74">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥一号路径第三部分-->
<Path x:Name="pthCE1SimPart3"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,79.96 A 129.58 164.98 0 1 0 0,-250">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥一号路径第四部分-->
<Path x:Name="pthCE1SimPart4"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 0,-250 A 104.55 123.59 0 1 0 0,79.96">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥一号路径第五部分-->
<Path
x:Name="pthCE1SimPart5"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2">
<Path.Data>
<PathGeometry>
<PathFigure
x:Name="pfCE1SimPart5"
StartPoint="0,79.96 ">
<PolyLineSegment
x:Name="plsCE1SimPart5"
Points="36.16,79.67 62.18,78.07 87.13,72.77
113.67,62.68 143.76,44.63 168.12,25.78
200.75,-6.85 273.84,-84.99 305.26,-110.44
330.92,-121.78 358.55,-126.73 395.79,-127.02
440.99,-119.83 477.72,-108.53 505.18,-91.69
527.11,-77.64 545.78,-53.52 552.16,-27.69
553.34,-1.14"/>
</PathFigure>
</PathGeometry>
</Path.Data>
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥一号路径第六部分-->
<Path x:Name="pthCE1SimPart6"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 553.35,0 A 127.11 86.66 0 1 1 299.12,0">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥一号路径第七部分-->
<Path x:Name="pthCE1SimPart7"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 299.12,0 A 127.11 86.66 0 1 1 553.35,0">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥一号路径第八部分-->
<Path x:Name="pthCE1SimPart8"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 553.02,0 A 79.12 58.95 0 1 1 394.78,0">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥一号路径第九部分-->
<Path x:Name="pthCE1SimPart9"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 394.78,0 A 79.12 58.95 0 1 1 553.02,0">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥⑤号路径第一部分-->
<Path
x:Name="pthCE5SimPart1"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2">
<Path.Data>
<PathGeometry>
<PathFigure
x:Name="pfCE5SimPart1"
StartPoint="0.59,79.96">
<PolyLineSegment
x:Name="plsCE5SimPart1"
Points="36.16,79.67 62.18,78.07 87.13,72.77
113.67,62.68 143.76,44.63 168.12,25.78
200.75,-6.85 280,-80 312.09,-103.87
338.84,-116.57 371.46,-125.46 407.58,-129.3
444.81,-125.22 481.32,-112.39 508.93,-95.47
528.25,-84.04 543.62,-62.35 551.89,-30.52
554.41,-1.28"/>
</PathFigure>
</PathGeometry>
</Path.Data>
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥五号路径第二部分-->
<Path x:Name="pthCE5SimPart2"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 554.42,0 A 132.11 95.13 0 1 1 290.2,0">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥五号路径第三部分-->
<Path x:Name="pthCE5SimPart3"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 290.2,0 A 132.11 95.13 0 1 1 554.42,0">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥五号路径第四部分-->
<Path x:Name="pthCE5SimPart4"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 554.05,0 A 97.31 65.22 0 1 1 359.43,0">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥五号路径第五部分-->
<Path x:Name="pthCE5SimPart5"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Data="M 359.43,0 A 97.31 65.22 0 1 1 554.05,0">
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--嫦娥五号路径第六部分-->
<Path x:Name="pthCE5SimPart6"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2">
<Path.Data>
<EllipseGeometry Center="500,0"
RadiusX="54.42"
RadiusY="54.42"/>
</Path.Data>
<Path.RenderTransform>
<TranslateTransform X="{Binding ElementName=ttPathCommomLeft, Path=X}"
Y="{Binding ElementName=ttPathCommomLeft, Path=Y}"/>
</Path.RenderTransform>
</Path>
<!--地球图形-->
<Image
x:Name="imgEarth"
Source="/uires/earth.png"
Width="50"
Height="50"
Canvas.Left="0"
Canvas.Top="0">
<Image.Triggers>
<EventTrigger
RoutedEvent="Drop">
<BeginStoryboard>
<Storyboard
x:Name="sbEarthMove">
<DoubleAnimation
x:Name="animEarthMoveHeight"
To="0.0"
Duration="0:0:1"
Storyboard.TargetName="imgEarth"
Storyboard.TargetProperty="Height">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation
x:Name="animEarthMoveWidth"
To="0.0"
Duration="{Binding ElementName=animEarthMoveHeight, Path=Duration}"
Storyboard.TargetName="imgEarth"
Storyboard.TargetProperty="Width">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation
x:Name="animEarthMoveLeft"
To="0.0"
Duration="{Binding ElementName=animEarthMoveHeight, Path=Duration}"
Storyboard.TargetName="imgEarth"
Storyboard.TargetProperty="(Canvas.Left)">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation
x:Name="animEarthMoveTop"
To="0.0"
Duration="{Binding ElementName=animEarthMoveHeight, Path=Duration}"
Storyboard.TargetName="imgEarth"
Storyboard.TargetProperty="(Canvas.Top)">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
<!--月球图形-->
<Image
x:Name="imgMoon"
Opacity="0"
Source="/uires/moon.png"
Width="70"
Height="70"
Canvas.Left="0"
Canvas.Top="0">
<Image.Triggers>
<EventTrigger RoutedEvent="Drop">
<BeginStoryboard>
<Storyboard x:Name="sbMoonShowHide"
Storyboard.TargetName="imgMoon"
Storyboard.TargetProperty="Opacity">
<DoubleAnimation Name="animMoonShowHide"
Duration="0:0:1"
To="1.0"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
<!--卫星图形-->
<Image
x:Name="imgSat"
Source="/uires/sat.png"
Width="50"
Height="50"
Visibility="Hidden"
Canvas.Left="0"
Canvas.Top="0">
<Image.RenderTransform>
<TranslateTransform x:Name="ttSat"
X="-25"
Y="-25">
</TranslateTransform>
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="Drop">
<BeginStoryboard>
<Storyboard x:Name="sbSatMove" Completed="sbSatMove_Completed">
<DoubleAnimationUsingPath Name="animSatMoveLeft"
Storyboard.TargetName="imgSat"
Storyboard.TargetProperty="(Canvas.Left)"
Source="X"
Duration="0:0:5"
RepeatBehavior="Forever">
</DoubleAnimationUsingPath>
<DoubleAnimationUsingPath Name="animSatMoveTop"
Storyboard.TargetName="imgSat"
Storyboard.TargetProperty="(Canvas.Top)"
Source="Y"
Duration="0:0:5"
RepeatBehavior="Forever">
</DoubleAnimationUsingPath>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
<!--圆和椭圆路径-->
<Path
x:Name="pthEllipse"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Canvas.Left="0"
Canvas.Top="0">
<Path.Data>
<EllipseGeometry x:Name="egEllipse"/>
</Path.Data>
<Path.Triggers>
<EventTrigger RoutedEvent="Drop">
<BeginStoryboard>
<Storyboard x:Name="sbEllipseShowHide"
Storyboard.TargetName="pthArc"
Storyboard.TargetProperty="Opacity"
Completed="sbEllipseShowHide_Completed">
<DoubleAnimation Name="animEllipseShowHide"
To="1.0"
Duration="0:0:0.3"
FillBehavior="Stop"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Path.Triggers>
</Path>
<!--圆弧路径-->
<Path
x:Name="pthArc"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Canvas.Left="0"
Canvas.Top="0"
Data="">
</Path>
<!--多点线路径(模拟V<V1时的掉落曲线)-->
<Path
x:Name="pthPolyLine"
Opacity="0"
Stroke="LightYellow"
StrokeThickness="5"
StrokeDashCap="Round"
StrokeDashArray="3 2"
Canvas.Left="0"
Canvas.Top="0">
<Path.Data>
<PathGeometry>
<PathFigure
x:Name="pfPolyLine"
StartPoint="0,0">
<PolyLineSegment
x:Name="plsPolyLine"
Points="0,0"/>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
</Canvas>
</DockPanel>
<!--右侧面板-->
<DockPanel
x:Name="dpPanel"
DockPanel.Dock="Right">
<!--上方包含速度标签和滑动条的面板-->
<StackPanel
x:Name="spControlDisplay"
DockPanel.Dock="Top"
Orientation="Vertical"
Margin="0,10,0,10">
<Label
Name="lblSpeed"
Content="7.9km/s"
FontSize="40"
Foreground="LawnGreen"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"/>
<Slider
x:Name="sldSpeed"
Margin="10,20,10,0"
Maximum="20"
Value="7.9"
ValueChanged="sldSpeed_ValueChanged"/>
</StackPanel>
<!--加减速按钮网格-->
<Grid
x:Name="grdSpeedControlButtons"
DockPanel.Dock="Top"
Height="50">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button
x:Name="btnSpeedDown"
Grid.Column="0"
Margin="10"
Content="←" Click="btnSpeedDown_Click"
Style="{StaticResource AllButtonStyle}"/>
<Button
x:Name="btnSpeedUp"
Grid.Column="1"
Margin="{Binding ElementName=btnSpeedDown, Path=Margin}"
Content="→" Click="btnSpeedUp_Click"
Style="{StaticResource AllButtonStyle}"/>
</Grid>
<!--三个宇宙速度选择网格-->
<Grid
x:Name="grdCosmicSpeedsButtons"
DockPanel.Dock="Top"
Height="50">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button
x:Name="btnCosmicSpeed1"
Grid.Column="0"
Margin="10,10,10,5"
Content="一" Click="btnCosmicSpeed1_Click"
Style="{StaticResource AllButtonStyle}"/>
<Button
x:Name="btnCosmicSpeed2"
Grid.Column="1"
Margin="{Binding ElementName=btnCosmicSpeed1, Path=Margin}"
Content="二" Click="btnCosmicSpeed2_Click"
Style="{StaticResource AllButtonStyle}"/>
<Button
x:Name="btnCosmicSpeed3"
Grid.Column="2"
Margin="{Binding ElementName=btnCosmicSpeed1, Path=Margin}"
Content="三" Click="btnCosmicSpeed3_Click"
Style="{StaticResource AllButtonStyle}"/>
</Grid>
<!--包含下部内容的网格-->
<Grid
x:Name="grdButtons">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>
<!--上方发射按钮-->
<Button
Grid.Row="0"
x:Name="btnLaunch"
Content="发射"
FontSize="30"
Margin="10,10,10,10"
Style="{StaticResource AllButtonStyle}"
Click="btnLaunch_Click"/>
<!--下方按钮网格-->
<Grid
x:Name="grdLButtons"
Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Button
Grid.Row="0"
x:Name="btnOneTrackChange"
Content="一次变轨模型示意"
FontSize="{Binding ElementName=btnSyncSim, Path=FontSize}"
Margin="{Binding ElementName=btnSyncSim, Path=Margin}"
Click="btnOneTrackChange_Click"
Style="{StaticResource AllButtonStyle}"/>
<Button
Grid.Row="1"
x:Name="btnTwoTrackChange"
Content="两次变轨模型示意"
FontSize="{Binding ElementName=btnSyncSim, Path=FontSize}"
Margin="{Binding ElementName=btnSyncSim, Path=Margin}"
Click="btnTwoTrackChange_Click"
Style="{StaticResource AllButtonStyle}"/>
<Button
Grid.Row="2"
x:Name="btnSyncSim"
Content="同步卫星发射示意"
FontSize="18"
Margin="10,5,10,5" Click="btnSyncSim_Click"
Style="{StaticResource AllButtonStyle}"/>
<Button
Grid.Row="3"
x:Name="btnCE1Sim"
Content="嫦娥一号发射示意"
FontSize="{Binding ElementName=btnSyncSim, Path=FontSize}"
Margin="{Binding ElementName=btnSyncSim, Path=Margin}"
Click="btnCE1Sim_Click"
Style="{StaticResource AllButtonStyle}"/>
<Button
Grid.Row="4"
x:Name="btnCE5Sim"
Content="嫦娥五号发射示意"
FontSize="{Binding ElementName=btnSyncSim, Path=FontSize}"
Margin="{Binding ElementName=btnSyncSim, Path=Margin}"
Click="btnCE5Sim_Click"
Style="{StaticResource AllButtonStyle}"/>
<Button
Grid.Row="5"
x:Name="btnAbout"
Content="关于"
FontSize="{Binding ElementName=btnSyncSim, Path=FontSize}"
Margin="{Binding ElementName=btnSyncSim, Path=Margin}"
Style="{StaticResource AllButtonStyle}" Click="btnAbout_Click"/>
</Grid>
</Grid>
</DockPanel>
</DockPanel>
</Window>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/ecui/Spacecraft-Launching-Demo.git
git@gitee.com:ecui/Spacecraft-Launching-Demo.git
ecui
Spacecraft-Launching-Demo
Spacecraft-Launching-Demo
master

搜索帮助