AllTreeView.xaml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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:Tree"
  6. x:Class="Tree.AllTreeView"
  7. mc:Ignorable="d"
  8. d:DesignHeight="800"
  9. d:DesignWidth="1280"
  10. d:DataContext="{d:DesignInstance Tree:AllTreeViewModel}">
  11. <DockPanel>
  12. <Menu DockPanel.Dock="Top" Height="24">
  13. <MenuItem Header="File">
  14. <MenuItem Header="打开" Click="MenuItem_Open" />
  15. <MenuItem Header="保存" Click="MenuItem_Save" />
  16. <MenuItem Header="新建" Click="MenuItem_New" />
  17. </MenuItem>
  18. </Menu>
  19. <Grid>
  20. <Grid.RowDefinitions>
  21. <RowDefinition></RowDefinition>
  22. <RowDefinition></RowDefinition>
  23. </Grid.RowDefinitions>
  24. <Grid.ColumnDefinitions>
  25. <ColumnDefinition Width="230"/>
  26. <ColumnDefinition Width="Auto"></ColumnDefinition>
  27. <ColumnDefinition />
  28. </Grid.ColumnDefinitions>
  29. <GroupBox Grid.Row="0" Grid.Column="0" Header="行为树列表:">
  30. <ListBox Name="lbTreeId" ItemsSource="{Binding TreeList}" VerticalAlignment="Stretch" >
  31. <ListBox.ItemTemplate>
  32. <DataTemplate DataType="Tree:TreeInfoViewModel">
  33. <StackPanel MouseLeftButtonDown="OnMouseLeftButtonDown" Orientation="Horizontal" Margin="1,0">
  34. <Label Content="{Binding Id}" VerticalAlignment="Stretch" Width="20" ></Label>
  35. <Label Content="{Binding Comment}" VerticalAlignment="Stretch" Width="150"></Label>
  36. </StackPanel>
  37. </DataTemplate>
  38. </ListBox.ItemTemplate>
  39. </ListBox>
  40. </GroupBox>
  41. <GroupBox Grid.Row="1" Grid.Column="0" Header="节点编辑:">
  42. <Tree:NodeDataEditor x:Name="nodeDataEditor" VerticalAlignment="Top" />
  43. </GroupBox>
  44. <GridSplitter Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Width="3" ShowsPreview="False" VerticalAlignment="Stretch"
  45. HorizontalAlignment="Stretch" />
  46. <Tree:TreeView x:Name="treeView" Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" />
  47. </Grid>
  48. </DockPanel>
  49. </UserControl>