我这里有三排.第一个下拉列表应显示所有名称.如果我从第一个下拉列表中选择一个名称,则下一个下拉列表不应包含在第一个下拉列表中选择的名称.
例如.如果我有{Peter,John,Michael},首先应该显示所有三个选项.如果我在第一个下拉列表中选择Peter,则下一行下拉列表应仅显示{John,Michael}.如果我在第二个下拉列表中选择John,则最终下拉列表应仅包含Michael.
<table>
<tbody data-bind="foreach: Items">
<tr>
<td>
<select data-bind="options: $root.Persons, optionsText: 'name', event :{ change: $parent.SelectionChanged }" />
</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud) 我有一个以nullable int为参数的类.
public class Test
{
public Test(int? p)
{
// ......
}
// ......
}
Run Code Online (Sandbox Code Playgroud)
如何使用unity解析它(将null作为参数传递)?
myContainer.RegisterType<Test>(new InjectionConstructor(10));
Run Code Online (Sandbox Code Playgroud)
这可以传递10作为值,但如果我传递null,它会抛出异常.