我正在开发一个WP7应用程序,应用程序需要在给定请求状态的情况下更改应用程序栏上按钮的图标.我试过了:
if (App.Servers[index].ServerState == "Enabled")
{
DetailsAppBar.btnStart.IconUri = new Uri("/AppBar/appbar.stop.rest.png");
}
else
{
DetailsAppBar.btnStart.IconUri = new Uri("/AppBar/appbar.transport.play.rest.png");
}
Run Code Online (Sandbox Code Playgroud)
这不会给我一个错误的代码,但它无法编译....任何提示这样做是赞赏:)
谢谢
我面临着列出多个表单的问题,包括提交按钮.单击第一个按钮时,它会正确发布,但是当我单击第二个提交按钮时,它会提交一个空集合...下面是我的代码:
Index.cshtml
@model MVCFormsSubmitting.Models.FormsRepository
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Index</h2>
@for (int i = 0; i < Model.UserInfo.Count; i++)
{
using (Html.BeginForm("Index", "Forms", FormMethod.Post, new {name = "Form" + @i}))
{
<b>@Html.EditorFor(m => m.UserInfo[i].Name)</b>
<input name="button @i" type="submit" class="left btn btn-primary" value="Ret navne">
<br/>
}
}
Run Code Online (Sandbox Code Playgroud)
Formsrepository.cs
namespace MVCFormsSubmitting.Models
{
public class Info
{
public int Id { get; set; }
public string Name { get; set; }
public string Age { get; set; }
public string …
Run Code Online (Sandbox Code Playgroud)