2012-03-29 8 views
6

Dizeyi WP7'deki ApplicationBarIconButton'daki Text Property öğesine bağlamak istiyorum. Bunu yaparken , benWP7'de ApplicationBarIconButton ile Text özelliğini ciltle bağlama

Set mülkiyet 'Microsoft.Phone.Shell.ApplicationBarIconButton.Text' gibi bir hata var bir istisna attı.

StackTrace:

System.Reflection.RuntimeMethodInfo.InternalInvoke (nesne obj, BindingFlags invokeAttr, bağlayıcı bağlayıcı, [] nesne parametreleri, Cultureınfo kültürü, StackCrawlMark & stackMark) System.Reflection de .RuntimePropertyInfo.InternalSetValue (PropertyInfo thisProperty, Object obj, Nesne değeri, Object [] dizin, StackCrawlMark & stackMark) at System.Reflection.RuntimePropertyInfo.SetValue (Object obj, Object) değeri, MS.Internal.XamlManagedRuntimeRPInvokes.SetValue (XamlTypeToken INTYPE, XamlQualifiedObject & inObj, XamlPropertyToken inProperty, XamlQualifiedObject & invalue) de) MS.Internal.XamlMemberInfo.SetValue (Nesne hedef, nesne değeri) de [] endeksi Nesne MS.Internal.XcpImports.Application_LoadComponentNative (IntPtr pContext, ıntptr pComponent, Uınt32 cUriStringLength string uriString, Uınt32 cXamlStrLength, Byte * pXamlStr, Uınt32 cAssemblyStrLength, dize assemblyStr) MS.Internal.XcpImports.Application_LoadComponent de (IManagedPeerBase componentAsDO de , String resourceLocator, YönetilmeyenMemoryStrea Syncfusion.Phone.Tools.Controls m akımı Syncfusion.Phone.Tools.Controls.TimeSpanPickerPage.InitializeComponent de System.Windows.Application.LoadComponent (Obje bileşeni, Uri resourceLocator) de Uınt32 numBytesToRead, dize assemblyString) () System.Reflection.RuntimeConstructorInfo.InternalInvoke at .TimeSpanPickerPage..ctor() (RuntimeConstructorInfo rtci, BindingFlags invokeAttr, bağlayıcı bağlayıcı, Nesne parametreleri, Cultureınfo kültürü, Boole isBinderDefault, Montaj arayan, Boole verifyAccess, StackCrawlMark & stackMark) de System.Reflection.RuntimeConstructorInfo.InternalInvoke (Object obj, BindingFlags invokeAttr, B inder bağlayıcı, System.Windows de System.Activator.CreateInstance (Tip tipi) de System.Activator.InternalCreateInstance (Tip tipi, Boole halka açıklanmamış, StackCrawlMark & stackMark) de [] parametreleri, Cultureınfo kültürü, StackCrawlMark & stackMark) Nesne .Navigation.PageResourceContentLoader.BeginLoad_OnUIThread (AsyncCallback userCallback, PageResourceContentLoaderAsync Sonuç sonucu) System.Windows.Navigation.PageResourceContentLoader adresindeki . <> c_ DisplayClass4.b _0 (Object args) System.Reflection.RuntimeMethodInfo.InternalInvoke (RuntimeMethodInfo rtmi, Nesne obj, BindingFlags invokeAttr, Bağlayıcı bağlayıcı de , parametreleri, Cultureınfo kültürü, Boole isBinderDefault Meclis arayan Nesne , System.Reflection.RuntimeMethodInfo'da, Boolean verifyAccess, StackCrawlMark & stackMark) .InternalInvoke System.Delegate.DynamicInvokeOne de ([] parametreleri nesne, nesne obj) System.Reflection.MethodBase.Invoke de (Obje obj BindingFlags invokeAttr, bağlayıcı bağlayıcı, [] parametreleri, Cultureınfo kültürü, StackCrawlMark & stackMark Nesne) ([] argümanlarımdan Object) System.Delegate.DynamicInvoke de System.MulticastDelegate.DynamicInvokeImpl (Object [] args) de System.Windows.Threading.DispatcherOperation.Invoke() de System.Windows de ([] argümanlarımdan Object) System.Windows.Threading.Dispatcher.OnInvoke (Object context) , System.Windows.Hosting adresinde .Threading.Dispatcher.Dispatch (DispatcherPriority önceliği) . System.Windows.Hosting.DelegateWrapper.InternalInvoke de CallbackCookie.Invoke (Object [] args) (Obje [] args) System.Windows.RuntimeHost.ManagedHost.InvokeDelegate (ıntptr pHandle de , ınt32 nParamCount, ScriptParam [] pParams, ScriptParam & pResult)

Çözüm: ApplicationBar Silverlight uygulanmadı ve veri bağlama ile kullanılamaz özel bir unsurdur. C# içindeki Text özelliğini doğrudan güncellemeniz gerekir. Peter Torr buradan açıklıyor: Peter Torr Blogu, nasıl olsa bağlanma verileri ApplicationBar mümkün Why are the ApplicationBar objects not FrameworkElements? O zaten cevabı biliyorum bana öyle geliyor

cevap

7

değil>, gerçi zamanında uygulama çubuğu oluşturabilirsiniz, yapmanız mümkün olabilir oradan bir şey. ApplicationBarIconButton At Runtime

+1

Bundan hoşlanmadım, burada soru sordum ve bu zamana kadar burada yayınlanan yanıtları aramaya devam ettim. Teşekkür ederim. – Ponmalar

+0

Sevindim :). Ancak çalışma zamanı oluşturmayı düşünmelisiniz. –

+1

Evet, beklediğim şeyi aldım. Teşekkür ederim. – Ponmalar

İlgili konular