213 lines
9.8 KiB
XML
213 lines
9.8 KiB
XML
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:Plane.FormationCreator.Views"
|
|
xmlns:m="clr-namespace:Plane.FormationCreator.Formation"
|
|
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
|
|
x:Class="Plane.FormationCreator.Views.TaskBarView"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="156.968"
|
|
d:DesignWidth="500">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Button HorizontalAlignment="Left" Grid.Column="1"
|
|
Visibility="{Binding FlightTaskManager.IsPaused, Converter={StaticResource IsPausedToRunButtonVisibilityConverter}}"
|
|
Command="{Binding RunTasksCommand}">
|
|
<Button.Template>
|
|
<ControlTemplate>
|
|
<Grid Width="40"
|
|
Height="40"
|
|
Background="#00FFFFFF"
|
|
VerticalAlignment="Bottom">
|
|
<ed:RegularPolygon Fill="MidnightBlue"
|
|
InnerRadius="1"
|
|
PointCount="3"
|
|
Width="40"
|
|
Height="40"
|
|
Stretch="Fill"
|
|
Stroke="Gray">
|
|
<ed:RegularPolygon.RenderTransform>
|
|
<TransformGroup>
|
|
<ScaleTransform />
|
|
<SkewTransform />
|
|
<RotateTransform Angle="90" />
|
|
<TranslateTransform X="40" />
|
|
</TransformGroup>
|
|
</ed:RegularPolygon.RenderTransform>
|
|
</ed:RegularPolygon>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Button.Template>
|
|
</Button>
|
|
<Button HorizontalAlignment="Left" Grid.Column="1"
|
|
Background="#00FFFFFF"
|
|
Visibility="{Binding FlightTaskManager.IsPaused, Converter={StaticResource IsPausedToPauseButtonVisibilityConverter}}"
|
|
Command="{Binding PauseTasksCommand}">
|
|
<Button.Template>
|
|
<ControlTemplate>
|
|
<Grid Width="40"
|
|
Height="40"
|
|
VerticalAlignment="Bottom"
|
|
Background="#00FFFFFF">
|
|
<Rectangle Fill="Red"
|
|
HorizontalAlignment="Left"
|
|
Width="15"
|
|
Height="40"
|
|
Stroke="Gray" />
|
|
<Rectangle Fill="Red"
|
|
Margin="0,0,3,0"
|
|
HorizontalAlignment="Right"
|
|
Width="15"
|
|
Height="40"
|
|
Stroke="Gray" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Button.Template>
|
|
</Button>
|
|
|
|
<ItemsControl Grid.Column="0"
|
|
VerticalAlignment="Bottom"
|
|
ItemsSource="{Binding Tasks}"
|
|
Name="TasksControl">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid x:Name="itemgrid">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Border Background="{Binding Status, Converter={StaticResource FlightTaskStatusToFillConverter}}"
|
|
Width="90"
|
|
Height="19"
|
|
BorderThickness="1"
|
|
BorderBrush="Black"
|
|
Effect="{Binding IsSelected, Converter={StaticResource FlightTaskIsSelectedToEffectConverter}}"
|
|
MouseLeftButtonDown="TaskLeftButtonDown"
|
|
MouseLeftButtonUp="SelectTask"
|
|
MouseRightButtonUp="HideTask">
|
|
|
|
<WrapPanel VerticalAlignment="Center"
|
|
HorizontalAlignment="Center" >
|
|
<TextBlock Width="auto"
|
|
FontSize="12"
|
|
Margin="0,0,2,0"
|
|
Foreground="White"
|
|
Text="{Binding TaskNum}"/>
|
|
<TextBlock Width="auto"
|
|
FontSize="12"
|
|
Foreground="White"
|
|
Text="{Binding TaskCnName}"/>
|
|
</WrapPanel>
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<Grid Grid.Column="2">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition Height="28"/>
|
|
</Grid.RowDefinitions>
|
|
<StackPanel Height="100" Background="#FF2D2D2D" VerticalAlignment="Bottom">
|
|
|
|
<TextBlock x:Name="hintaddtask" Margin="0,25,0,0" Text="请添加或选择飞行任务" Visibility="Collapsed" FontSize="18" TextAlignment="Center"/>
|
|
|
|
<TabControl x:Name="tasktabcont"
|
|
DataContext="{Binding FlightTaskManager.SelectedTask}"
|
|
SelectedIndex="{Binding TaskTypeIndex,UpdateSourceTrigger=PropertyChanged}">
|
|
|
|
|
|
|
|
<TabItem Header="起飞" x:Name="takeoffpage">
|
|
<Grid Margin="10">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="起飞时间"/>
|
|
<TextBox Grid.Column="1" Margin="2"
|
|
Text="{Binding TakeOffTime, UpdateSourceTrigger=PropertyChanged}" />
|
|
</Grid>
|
|
|
|
</TabItem>
|
|
<TabItem Header="航点" x:Name="flytopage">
|
|
<Grid Margin="10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Row="0" Text="飞行时间: " />
|
|
<TextBox Grid.Column="1" Margin="2"
|
|
MaxLength="4"
|
|
Text="{Binding FlytoTime, UpdateSourceTrigger=PropertyChanged}" />
|
|
<TextBlock Grid.Row="1" Text="悬停时间: " />
|
|
<TextBox Grid.Row="1" Grid.Column="1" Margin="2"
|
|
MaxLength="4"
|
|
Text="{Binding LoiterTime, UpdateSourceTrigger=PropertyChanged}" />
|
|
</Grid>
|
|
</TabItem>
|
|
|
|
<TabItem Header="降落" x:Name="landpage">
|
|
<Grid Margin="10" >
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
</Grid>
|
|
</TabItem>
|
|
|
|
</TabControl>
|
|
</StackPanel>
|
|
<StackPanel Grid.Row="1"
|
|
Orientation="Horizontal"
|
|
VerticalAlignment="Bottom">
|
|
<Button Content="添加"
|
|
Background="#232323"
|
|
Command="{Binding AddTaskCommand}" />
|
|
<Button Content="清除"
|
|
Background="#232323"
|
|
Command="{Binding ClearTasksCommand}" />
|
|
<Button Content="重置"
|
|
Background="#232323"
|
|
Command="{Binding ResetTasksCommand}" />
|
|
|
|
<Button Content="更名"
|
|
Background="#232323"
|
|
Command="{Binding renametaskCommand}" />
|
|
<Button Content="设原点"
|
|
Background="#232323"
|
|
Command="{Binding SetOriginCommand}" />
|
|
<!--<Button Content="保存" />
|
|
<Button Content="取消" />-->
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
|
|
</Grid>
|
|
</UserControl>
|