Răsfoiți Sursa

增加新建节点的对话框

tanghai 14 ani în urmă
părinte
comite
0d1712acb0

+ 9 - 0
CSharp/View/BehaviorNodeDialog.xaml

@@ -0,0 +1,9 @@
+<Window x:Class="Egametang.BehaviorNodeDialog"
+			 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" 
+			 mc:Ignorable="d" 
+			 d:DesignHeight="300" d:DesignWidth="300">
+	<Grid></Grid>
+</Window>

+ 29 - 0
CSharp/View/BehaviorNodeDialog.xaml.cs

@@ -0,0 +1,29 @@
+using System.Windows;
+
+namespace Egametang
+{
+	/// <summary>
+	/// BehaviorNodeDialog.xaml 的交互逻辑
+	/// </summary>
+	public partial class BehaviorNodeDialog : Window
+	{
+		private BehaviorNode node;
+
+		public BehaviorNode Node
+		{
+			get 
+			{ 
+				return node; 
+			}
+			set 
+			{ 
+				node = value; 
+			}
+		}
+
+		public BehaviorNodeDialog()
+		{
+			InitializeComponent();
+		}
+	}
+}

+ 1 - 1
CSharp/View/BehaviorTreeView.xaml.cs

@@ -15,7 +15,7 @@ namespace Egametang
 
 		private void newMenuItem_Click(object sender, RoutedEventArgs e)
 		{
-
+			BehaviorNodeDialog dlg = new BehaviorNodeDialog();
 		}
 
 		private void copyMenuItem_Click(object sender, RoutedEventArgs e)

+ 7 - 0
CSharp/View/View.csproj

@@ -55,6 +55,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Page Include="BehaviorNodeDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="BehaviorTreeView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -67,6 +71,9 @@
       <DependentUpon>App.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="BehaviorNodeDialog.xaml.cs">
+      <DependentUpon>BehaviorNodeDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="BehaviorTreeView.xaml.cs">
       <DependentUpon>BehaviorTreeView.xaml</DependentUpon>
     </Compile>

+ 0 - 3
CSharp/ViewModel/BehaviorTreeViewModel.cs

@@ -11,9 +11,6 @@ namespace Egametang
 
 		public BehaviorTreeViewModel()
 		{
-			root.Name = "root";
-			root.Type = 1;
-			children.Add(new BehaviorNodeViewModel(root, null));
 		}
 
 		public ObservableCollection<BehaviorNodeViewModel> Children