AllTreeView.xaml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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="lbTrees" ItemsSource="{Binding TreeViewModels}" >
  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. <MenuItem Header="路径" Click="MenuItem_Path" />
  32. </ContextMenu>
  33. </ListBox.ContextMenu>
  34. <ListBox.ItemTemplate>
  35. <DataTemplate DataType="Tree:TreeViewModel">
  36. <StackPanel MouseLeftButtonDown="ListBoxItem_OnMouseLeftButtonDown"
  37. Orientation="Horizontal" Margin="1,0">
  38. <Label Content="{Binding Id}" VerticalAlignment="Stretch" Width="30"/>
  39. <Label Content="{Binding Comment}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
  40. </StackPanel>
  41. </DataTemplate>
  42. </ListBox.ItemTemplate>
  43. </ListBox>
  44. </GroupBox>
  45. <GroupBox Grid.Row="1" Grid.Column="0" Header="节点编辑:" Height="220" VerticalAlignment="Bottom">
  46. <Tree:NodeDataEditor x:Name="nodeDataEditor" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" />
  47. </GroupBox>
  48. <GridSplitter Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Width="3" ShowsPreview="False" VerticalAlignment="Stretch"
  49. HorizontalAlignment="Stretch" />
  50. <Tree:TreeView x:Name="treeView" Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" />
  51. </Grid>
  52. </DockPanel>
  53. </UserControl>