我想将字符串绑定到WP7中ApplicationBarIconButton中的Text属性.在这样做时,我收到了一个错误
设置属性'Microsoft.Phone.Shell.ApplicationBarIconButton.Text'引发了异常.
堆栈跟踪:
在System.Reflection.RuntimeMethodInfo.InternalInvoke在System.Reflection.RuntimePropertyInfo.InternalSetValue(的PropertyInfo thisProperty,对象OBJ,对象的值(对象OBJ,的BindingFlags invokeAttr,粘结剂粘结剂,对象[]参数,CultureInfo的文化,StackCrawlMark&stackMark),对象[]索引,StackCrawlMark&stackMark)在System.Reflection.RuntimePropertyInfo.SetValue(对象OBJ,对象的值,在MS.Internal.XamlMemberInfo.SetValue(对象目标,对象的值)在MS.Internal.XamlManagedRuntimeRPInvokes.SetValue(XamlTypeToken对象[]索引)法菜单,XamlQualifiedObject&inObj,XamlPropertyToken inProperty,XamlQualifiedObject&inValue)在MS.Internal.XcpImports.Application_LoadComponentNative(IntPtr的pContext,IntPtr的P-分量,UInt32的cUriStringLength,字符串uriString中,UInt32的cXamlStrLength,BYTE*pXamlStr,UInt32的cAssemblyStrLength,字符串assemblyStr)在MS.Internal. XcpImports.Application_LoadComponent(IManagedPeerBase componentAsDO,String resourceLocator,UnmanagedMemoryStr EAM流,UInt32的numBytesToRead,字符串assemblyString)在System.Windows.Application.LoadComponent(对象部件,乌里resourceLocator)在Syncfusion.Phone.Tools.Controls.TimeSpanPickerPage.InitializeComponent()在Syncfusion.Phone.Tools.Controls.TimeSpanPickerPage .. System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object obj)中的System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo rtci,BindingFlags invokeAttr,Binder binder,Object parameters,CultureInfo culture,Boolean isBinderDefault,Assembly caller,Boolean verifyAccess,StackCrawlMark&stackMark)中的ctor() ,的BindingFlags invokeAttr,粘结剂粘结剂,在System.Activator.CreateInstance(类型类型)在System.Windows.Navigation对象[]参数,CultureInfo的文化,StackCrawlMark&stackMark)在System.Activator.InternalCreateInstance(类型类型,布尔非公开,StackCrawlMark&stackMark) .PageResourceContentLoader.BeginLoad_OnUIThread(AsyncCallback userCallback,PageResourceContentLoaderAsyncRe sult结果)在System.Windows.Navigation.PageResourceContentLoader.<> c_ DisplayClass4.b _0(Object args)在System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi,Object obj,BindingFlags invokeAttr,Binder binder,Object parameters,CultureInfo culture,布尔isBinderDefault,装配呼叫者,布尔verifyAccess,StackCrawlMark&stackMark)在System.Reflection.RuntimeMethodInfo.InternalInvoke(对象OBJ,的BindingFlags invokeAttr,粘结剂粘结剂,在System.Reflection.MethodBase.Invoke对象[]参数,CultureInfo的文化,StackCrawlMark&stackMark)(在System.Windows.Threading的System.Delegate.DynamicInvoke(Object [] args)的System.MulticastDelegate.DynamicInvokeImpl(Object [] args)的System.Delegate.DynamicInvokeOne(Object [] args)中的Object obj,Object []参数) System.Windows.Hosting.Cal上System.Windows.Threading.Dispatcher.OnInvoke(Object context)的System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)中的.DispatcherOperation.Invoke()lbackCookie.Invoke(对象[]参数)在System.Windows.Hosting.DelegateWrapper.InternalInvoke(对象[]参数)在System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr的pHandle,的Int32 nParamCount,ScriptParam [] pParams,ScriptParam&pResult)
解决方案: ApplicationBar是一个特殊元素,未在Silverlight中实现,不能与数据绑定一起使用.您必须直接更新C#中的Text属性.Peter Torr在此解释:Peter Torr的博客> 为什么ApplicationBar对象不是FrameworkElements?
我有一个Android应用程序,我想停止在Tablet中安装此应用程序。我搜索了许多网站。我有一些想法,并遵循了。但这并不限制。
这是我访问过的一些站点。
http://android-developers.blogspot.in/2011/09/preparing-for-handsets.html
我尝试将supports-screens
应用程序安装在平板电脑中。这该怎么做?
注意:我的应用程序的minsdkversion = 8,targetsdkversion = 17
编辑1:我已经使用以下代码来查找屏幕大小
xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp
WindowManager wm=getWindowManager();
DisplayMetrics dm=new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
deviceWidth=dm.widthPixels;
deviceHeight=dm.heightPixels;
if((deviceHeight< 640 && deviceWidth<480)|| (deviceHeight<480 && deviceWidth< 640))
{
//large screen - TABLET
}
Run Code Online (Sandbox Code Playgroud)
但是我不知道where to put this code to restricts installation and …
在我的Visual Studio 2013中,在" Visual C# "和" 其他项目类型 " 下找不到可扩展性项目模板.你能指导我用Visual Studio启用这个项目类型吗?
嗨,我正在创建MaskedTextBox.我想得到文本形式的剪辑板.如果我正在使用Clipboard.gettext(),则抛出SecurityException.有没有办法从WP7中的剪贴板中获取文本?
我想显示webview,admob和导航栏,其中包含编辑文本和同一页面中的2个按钮.但页面会自动进入webview(如在浏览器中)隐藏活动中定义的其他元素....代码如下:请提出宝贵意见......提前谢谢......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
<include android:id="@+id/nav_bar_layout" layout="@layout/nav_bar" android:layout_above="@+id/web_view" />
<WebView android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/web_view" android:layout_centerInParent="true" />
<include android:id="@+id/admob_layout" layout="@layout/admob_layout" android:layout_below="@+id/web_view" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 我Cordova-2.7.0.jar file and js
在此链接中给出的PhoneGap应用程序中添加了文件.但现在我收到了这个错误.如何解决这个错误?
有没有<SupportedCultures><SupportedCultures>
在Windows Phone中动态添加的选项???