按钮的触发效果

This commit is contained in:
zxd 2019-01-04 12:19:25 +08:00
parent 1e69baaf9d
commit 32b60bb059
4 changed files with 30 additions and 18 deletions

View File

@ -98,12 +98,13 @@ namespace Plane.FormationCreator.Formation
int copterIndex = SingleCopterInfos.IndexOf(info); int copterIndex = SingleCopterInfos.IndexOf(info);
var copter = info.Copter; var copter = info.Copter;
await copter.UnlockAsync();
//等待起飞时间 //等待起飞时间
while ((int)ts.TotalMilliseconds < (int)info.TakeOffWaitTime * 1000) while ((int)ts.TotalMilliseconds < (int)info.TakeOffWaitTime * 1000)
{ {
if (_flightTaskManager.IsPaused == true) if (_flightTaskManager.IsPaused == true)
{ {
await copter.UnlockAsync();
await info.Copter.HoverAsync(); await info.Copter.HoverAsync();
return; return;
} }

View File

@ -31,6 +31,7 @@
RecognizesAccessKey="True" /> RecognizesAccessKey="True" />
</Grid> </Grid>
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" <Trigger Property="IsMouseOver"
Value="True"> Value="True">
@ -39,25 +40,33 @@
<Setter Property="Background" <Setter Property="Background"
Value="{StaticResource BackgroundHighlighted}" /> Value="{StaticResource BackgroundHighlighted}" />
</Trigger> </Trigger>
<Trigger Property="IsPressed" <Trigger Property="IsPressed"
Value="True"> Value="True">
<Setter Property="Background"
Value="{StaticResource BackgroundNormal}" />
<Setter Property="BorderBrush"
Value="{StaticResource BorderBrushNormal}" />
</Trigger>
<Trigger Property="IsEnabled"
Value="False">
<Setter Property="Background"
Value="Transparent" />
</Trigger>
<Trigger Property="IsFocused"
Value="true">
<Setter Property="BorderBrush" <Setter Property="BorderBrush"
Value="{StaticResource BorderBrushHighlighted}" /> Value="{StaticResource BorderBrushHighlighted}" />
<Setter Property="Background" <Setter Property="Background"
Value="{StaticResource BackgroundHighlighted}" /> Value="{StaticResource BackgroundNormal}" />
</Trigger> </Trigger>
<Trigger Property="IsEnabled"
Value="False">
<Setter Property="Background"
Value="{StaticResource BackgroundNormal}" />
</Trigger>
<MultiTrigger >
<MultiTrigger.Conditions>
<Condition Property="IsFocused" Value="True"/>
<Condition Property="IsPressed" Value="False"/>
<Condition Property="IsEnabled" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="BorderBrush"
Value="{StaticResource BorderBrushHighlighted}" />
<Setter Property="Background"
Value="Transparent" />
</MultiTrigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>

View File

@ -112,10 +112,10 @@
<!--General--> <!--General-->
<SolidColorBrush x:Key="BackgroundHighlighted" <SolidColorBrush x:Key="BackgroundHighlighted"
Color="#54545C" Color="#4682B4"
options:Freeze="True" /> options:Freeze="True" />
<SolidColorBrush x:Key="BorderBrushHighlighted" <SolidColorBrush x:Key="BorderBrushHighlighted"
Color="#6A6A75" Color="#6495ED"
options:Freeze="True" /> options:Freeze="True" />
<SolidColorBrush x:Key="BackgroundSelected" <SolidColorBrush x:Key="BackgroundSelected"
Color="#007ACC" Color="#007ACC"

View File

@ -66,8 +66,10 @@
</StackPanel.Resources> </StackPanel.Resources>
<StackPanel> <StackPanel>
<TextBlock Margin="5" Text="航点任务"/> <TextBlock Margin="5" Text="航点任务"/>
<Button Content="导入航点" Command="{Binding ImportWayPointCommand}" /> <Button Content="导入航点" Command="{Binding ImportWayPointCommand}"
<Button Content="优化路线" Command="{Binding OptimizeRouteCommand}" /> Visibility="Collapsed"/>
<Button Content="优化路线" Command="{Binding OptimizeRouteCommand}"
Visibility="Collapsed"/>
</StackPanel> </StackPanel>
<Separator Margin="0,1"/> <Separator Margin="0,1"/>