AllTreeView.xaml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:Tree="clr-namespace:Modules.BehaviorTreeModule"
  6. x:Class="Modules.BehaviorTreeModule.AllTreeView"
  7. mc:Ignorable="d"
  8. d:DesignHeight="800"
  9. d:DesignWidth="1280"
  10. d:DataContext="{d:DesignInstance Tree:AllTreeViewModel}">
  11. <DockPanel>
  12. <Grid>
  13. <Grid.RowDefinitions>
  14. <RowDefinition/>
  15. <RowDefinition/>
  16. </Grid.RowDefinitions>
  17. <Grid.ColumnDefinitions>
  18. <ColumnDefinition Width="230"/>
  19. <ColumnDefinition Width="Auto"/>
  20. <ColumnDefinition />
  21. </Grid.ColumnDefinitions>
  22. <GroupBox Grid.Row="0" Grid.Column="0" Header="行为树列表:" Margin="0,0,0,289" Grid.RowSpan="2">
  23. <ListBox Name="lbTreeRoots" ItemsSource="{Binding RootList}" >
  24. <ListBox.ContextMenu>
  25. <ContextMenu>
  26. <MenuItem Header="打开" Click="MenuItem_Open" />
  27. <MenuItem Header="保存" Click="MenuItem_Save" />
  28. <MenuItem Header="新建" Click="MenuItem_New" />
  29. <MenuItem Header="删除" Click="MenuItem_Remove" />
  30. <MenuItem Header="克隆" Click="MenuItem_Clone" />
  31. </ContextMenu>
  32. </ListBox.ContextMenu>
  33. <ListBox.ItemTemplate>
  34. <DataTemplate DataType="Tree:TreeNodeViewModel">
  35. <StackPanel MouseLeftButtonDown="ListBoxItem_OnMouseLeftButtonDown" MouseLeftButtonUp="ListBoxItem_OnMouseLeftButtonUp"
  36. Orientation="Horizontal" Margin="1,0">
  37. <Label Content="{Binding TreeId}" VerticalAlignment="Stretch" Width="30"/>
  38. <Label Content="{Binding Comment}" VerticalAlignment="Stretch" Width="150"/>
  39. </StackPanel>
  40. </DataTemplate>
  41. </ListBox.ItemTemplate>
  42. </ListBox>
  43. </GroupBox>
  44. <GroupBox Grid.Row="1" Grid.Column="0" Header="节点编辑:" Margin="0,116,0,0">
  45. <Tree:NodeDataEditor x:Name="nodeDataEditor" VerticalAlignment="Top" />
  46. </GroupBox>
  47. <GridSplitter Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Width="3" ShowsPreview="False" VerticalAlignment="Stretch"
  48. HorizontalAlignment="Stretch" />
  49. <Tree:TreeView x:Name="treeView" Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" />
  50. </Grid>
  51. </DockPanel>
  52. </UserControl>