正在修改航点的自定义命名
This commit is contained in:
parent
9aabdfc0e9
commit
b88ed4486e
@ -45,6 +45,7 @@ namespace Plane.FormationCreator.Formation
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public int TaskTypeIndex
|
||||
{
|
||||
@ -60,20 +61,21 @@ namespace Plane.FormationCreator.Formation
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
private string _TaskName = "";
|
||||
public string TaskCnName
|
||||
{
|
||||
get
|
||||
{
|
||||
string CnName = "";
|
||||
switch (TaskType)
|
||||
{
|
||||
case FlightTaskType.TakeOff: CnName = (TaskIndex + 1).ToString() + ".起飞"; break;
|
||||
case FlightTaskType.FlyTo: CnName = (TaskIndex + 1).ToString() + ".航点"; break;
|
||||
case FlightTaskType.Land: CnName = (TaskIndex + 1).ToString() + ".降落"; break;
|
||||
case FlightTaskType.TakeOff: _TaskName = "起飞"; break;
|
||||
case FlightTaskType.FlyTo: _TaskName = _TaskName == "" ? "航点" : _TaskName; break;
|
||||
case FlightTaskType.Land: _TaskName = "降落"; break;
|
||||
}
|
||||
return CnName;
|
||||
_TaskName = (TaskIndex + 1).ToString() + "." + _TaskName;
|
||||
return _TaskName;
|
||||
}
|
||||
set { Set(nameof(TaskCnName), ref _TaskName, value); }
|
||||
}
|
||||
|
||||
public int TaskTypeIndex
|
||||
|
@ -96,6 +96,7 @@
|
||||
BorderThickness="1"
|
||||
BorderBrush="Black"
|
||||
Effect="{Binding IsSelected, Converter={StaticResource FlightTaskIsSelectedToEffectConverter}}"
|
||||
MouseLeftButtonDown="TaskLeftButtonDown"
|
||||
MouseLeftButtonUp="SelectTask"
|
||||
MouseRightButtonUp="HideTask">
|
||||
|
||||
@ -104,7 +105,8 @@
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="12"
|
||||
Foreground="White"
|
||||
Text="{Binding TaskCnName}" />
|
||||
Text="{Binding TaskCnName}"
|
||||
/>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
@ -32,6 +32,17 @@ namespace Plane.FormationCreator.Views
|
||||
|
||||
private FlightTaskManager _flightTaskManager = ServiceLocator.Current.GetInstance<FlightTaskManager>();
|
||||
|
||||
public void TaskLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ClickCount > 1)
|
||||
{
|
||||
var elem = sender as FrameworkElement;
|
||||
var task = elem.DataContext as FlightTask;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SelectTask(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var elem = sender as FrameworkElement;
|
||||
|
Loading…
Reference in New Issue
Block a user