| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <UserControl
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
- x:Class="BehaviorTree.BehaviorTreeView"
- mc:Ignorable="d"
- d:DesignHeight="600" d:DesignWidth="800">
- <UserControl.Resources>
- </UserControl.Resources>
- <UserControl.CommandBindings>
- <CommandBinding Command="ApplicationCommands.New" Executed="NewNode_Executed" />
- </UserControl.CommandBindings>
- <UserControl.ContextMenu>
- <ContextMenu Name="cm">
- <MenuItem Header="New Node" Command="ApplicationCommands.New"
- CommandTarget="{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}" />
- </ContextMenu>
- </UserControl.ContextMenu>
- <Grid>
- <ListBox Name="lstTree" ItemsSource="{Binding TreeNodes}" >
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <Canvas Background="Green"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemContainerStyle>
- <Style>
- <Setter Property="Canvas.Left" Value="{Binding Mode=TwoWay, Path=X}"/>
- <Setter Property="Canvas.Top" Value="{Binding Mode=TwoWay, Path=Y}"/>
- </Style>
- </ListBox.ItemContainerStyle>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <TextBlock FontWeight="Bold" TextAlignment="Center" Text="Node" />
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
- </UserControl>
|