From 4596417a0b8838e1de961a437bbda005ef75c48b Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 23 Oct 2014 07:18:49 -0700 Subject: [PATCH] remove PhoneDirect3DXamlAppComponent namespace. Updated edit text code --- .../proj.wp8-xaml/App/MainPage.xaml.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/MainPage.xaml.cs b/templates/cpp-template-default/proj.wp8-xaml/App/MainPage.xaml.cs index 2a85cc1144..5643c2e096 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/MainPage.xaml.cs +++ b/templates/cpp-template-default/proj.wp8-xaml/App/MainPage.xaml.cs @@ -16,7 +16,6 @@ using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Controls; -using PhoneDirect3DXamlAppComponent; using System.Threading; using System.Diagnostics; using System.Threading.Tasks; @@ -27,7 +26,7 @@ using Microsoft.Phone.Info; using Windows.Graphics.Display; using Microsoft.Phone.Tasks; -namespace PhoneDirect3DXamlAppInterop +namespace cocos2d { public partial class MainPage : PhoneApplicationPage { @@ -141,13 +140,15 @@ namespace PhoneDirect3DXamlAppInterop public void OnKeyUp(object sender, KeyEventArgs e) { - m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text); - m_textBox.Text = ""; } public void OnTextChanged(object sender, TextChangedEventArgs e) { - m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text); + if (m_textBox.Text.Length > 0) + { + m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text); + m_textBox.Text = ""; + } } // Called by the Cocos2d-x C++ engine to display a MessageBox @@ -181,7 +182,6 @@ namespace PhoneDirect3DXamlAppInterop m_textBox.TextChanged += OnTextChanged; DrawingSurfaceBackground.Children.Add(m_textBox); } - m_textBox.Text = text; m_textBox.SelectionLength = 0; m_textBox.SelectionStart = int.MaxValue; m_textBox.Focus();