目前我的解决方案A包含一个域层基础和解决方案B,它引用了解决方案A中的二进制文件.有没有一种方法可以直接从一个调试到另一个,同时打开两个visual studio实例(每个解决方案一个).我已经读过你可以将解决方案A中的现有项目添加到解决方案B.还有其他解决方案吗?我已经尝试直接将解决方案A附加到解决方案B中正在运行的可执行文件但它不会让我将多个调试器附加到同一个应用程序.
我应该注意,当我进入它的一部分时,会自动从解决方案A的Visual Studio实例中调出解决方案A中的代码.我想这是可以接受的,但你不能只设置任意断点并等待代码以这种方式击中它们.
谢谢
我已经搜索了很长一段时间,但未能找到答案.
我正在使用asp.net MVC 3进行不显眼的验证.我的模型与数据注释绑定,用于简单验证(必填字段,正则表达式等).但是,我在服务器上进行了更复杂的验证.我正在做一个ajax帖子,它返回来自我的域模型的验证add'l消息.我想要做的就是将表单上的验证消息放在现有表单的位置.我不想使用部分视图,因为我真正得到的是消息回来,并且不需要刷新整个视图.另外,我没有在表单中添加新规则或新输入,因此$ .validator.unobtrusive.parse将无效.这些只是我想要放在表单上的消息.$ .post调用返回一个消息列表,该字段受影响的字段和验证消息.
这就是我想要做的事情
$.post(url, { someData}, function (data) {
for (message in data.Messages) {
$("#form").validate().addMessage(message.Field, message.Text);
}
});
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助
根据请求,这里是返回JSON的示例,它非常简单.
{"id":0,"messages":["Level":0,"Message":"Style is required","Name":"Style"}],"operationResult":false}
Run Code Online (Sandbox Code Playgroud)
messages是包含严重性级别,错误所属属性和错误消息的对象列表.我将使用messages对象中的名称来匹配表单上的所需位置.
我搜索高低,无法找到答案.我有两个问题
这是我在资源字典中尝试过的,但都不起作用
<ItemsControl x:Key="stateList">
<sys:String>AL</sys:String>
<sys:String>CA</sys:String>
<sys:String>CN</sys:String>
</ItemsControl>
<ItemsControl x:Key="stateList2">
<ComboBoxItem>AL</ComboBoxItem>
<ComboBoxItem>CA</ComboBoxItem>
<ComboBoxItem>CN</ComboBoxItem>
</ItemsControl>
Run Code Online (Sandbox Code Playgroud)
这就是我如何绑定它
<ComboBox SelectedValue="{Binding Path=State}" ItemsSource="{Binding Source={StaticResource stateList2}}" >
</ComboBox>
Run Code Online (Sandbox Code Playgroud)
编辑:更新
我得到了第一部分以这种方式工作
<col:ArrayList x:Key="stateList3">
<sys:String>AL</sys:String>
<sys:String>CA</sys:String>
<sys:String>CN</sys:String>
</col:ArrayList>
Run Code Online (Sandbox Code Playgroud)
但是,我宁愿不使用数组列表,我想使用通用列表,所以如果有人知道如何请让我知道.
编辑更新:我猜XAML对泛型的支持非常有限,所以也许数组列表是我现在能做的最好的,但是我仍然希望第二个问题的帮助,如果有人有一个anser
第2位.我尝试在我的XAML中引用合并的资源字典并遇到问题,因为在Window.resources下我不仅仅是字典,所以它要求我添加x:Key.添加密钥后,系统将无法再找到资源字典中的项目.我不得不将合并的字典移动到Grid.Resources.理想情况下,我想在app.xaml中引用合并的字典,但我有同样的问题
这是一些示例代码.第一部分需要一个x:key来编译,因为我有转换器并且它抱怨每个项目必须有一个键,如果有多个
<UserControl.Resources>
<win:BooleanToVisibilityConverter x:Key="VisibilityConverter" />
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ResourcesD.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
Run Code Online (Sandbox Code Playgroud)
我不得不改变它
<UI:BaseStep.Resources>
<win:BooleanToVisibilityConverter x:Key="VisibilityConverter" />
</UI:BaseStep.Resources>
<Grid>
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ResourcesD.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Grid.Resources>
</Grid>
Run Code Online (Sandbox Code Playgroud)
谢谢
我试过上下搜索但找不到任何东西.我在listview中有一个组合框.listview绑定到通过datacontext绑定的控制器公开的对象列表.列表中项目的一个属性是字符串.我试图将该值绑定到组合框中的内容.
这是我的列表视图的片段
<ListView ItemsSource="{Binding Path=OrderLines}" >
<ListView.View>
<GridView>
<GridViewColumn Header="Item Type" Width="Auto">
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox Width="100" SelectedItem="{Binding Path=LineType,ValidatesOnDataErrors=True}" >
<ComboBoxItem>Type1</ComboBoxItem>
<ComboBoxItem>Type2</ComboBoxItem>
<ComboBoxItem>Type3</ComboBoxItem>
<ComboBoxItem>Type4</ComboBoxItem>
</ComboBox>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
Run Code Online (Sandbox Code Playgroud)
在控制器中,我有一个名为OrderLines的属性
private List<OrderLine> orderLines;
public List<OrderLine> OrderLines
{
get { return orderLines; }
set
{
if (value == orderLines)
return;
orderLines= value;
OnPropertyChanged("OrderLines");
}
}
Run Code Online (Sandbox Code Playgroud)
OrderLine只有一个名为LineType的属性,它是一个包含该值的字符串.
private string lineType;
public string LineType
{
get { return lineType; }
set
{
lineType= value;
OnPropertyChanged("LineType ");
}
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助解释为什么没有设置所选的项目/值.这与我的内容硬编码有关吗?谢谢你的帮助.