我正在尝试在Windows Phone 7中为我的应用程序创建"设置"页面.我创建了AppSettings类,并从我的MainPage.xaml中引用它.这是我的代码:
<phone:PhoneApplicationPage
x:Class="Shapes4Kids.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ShapesSettings;assembly=Shapes4Kids"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
<local:AppSettings x:Key="appSettings"></local:AppSettings>
</phone:PhoneApplicationPage.Resources>
Run Code Online (Sandbox Code Playgroud)
但是在我引用AppSettings(本地:AppSettings行)的行上,我收到一条错误消息,指出"无法创建AppSettings的实例".
这适用于WP7.我在列表框itemtemplate中有一个按钮.在关联的ViewModel中,我有RelayCommand,它已经绑定到Button的Click事件(使用MVVMLight EventToCommand).我想要的只是在单击按钮时传入ListBox的ListItem.
有任何想法吗?
我正在使用jQuery Validation插件,用于我的jQuery移动网站.验证正在进行,但它没有显示错误消息.找出问题所在需要帮助.这是我的代码.
<script language="javascript" type="text/javascript" >
$(document).ready(function () {
$("#LoginForm").validate();
});
</script>
<form id="LoginForm" class="validate" action="~/Home/Search" method="get">
<ul data-role="listview" data-inset="true">
<li data-role="list-divider"><div class="center-wrapper">Secure Login</div></li>
<li data-role="fieldcontain">
<label for="FirmKey">FirmKey</label>
<input type="text" id="FirmKey" name="FirmKey" class="required" />
</li>
<li data-role="fieldcontain">
<label for="UserName">User Name</label>
<input type="text" id="UserName" name="UserName" class="required" />
</li>
<li data-role="fieldcontain">
<label for="Password">Password</label>
<input type="password" id="Password" name="Password" class="required" />
</li>
<li data-role="fieldcontain">
<input type="submit" id="submit" value="LOGIN" />
</li>
</ul>
</form>
Run Code Online (Sandbox Code Playgroud)
CSS:
label.error {
float: none;
color: red;
font-size: 16px;
font-weight: normal;
line-height: …Run Code Online (Sandbox Code Playgroud)