我有这门课
public class Tooth
{
public string Id {get;set;}
}
Run Code Online (Sandbox Code Playgroud)
而这个custrom控制
public partial class ToothUI : UserControl
{
public ToothUI()
{
InitializeComponent();
}
public Tooth Tooth
{
get { return (Tooth)GetValue(ToothProperty); }
set
{
SetValue(ToothProperty, value);
NombrePieza.Text = value.Id.Replace("_",String.Empty);
}
}
public static readonly DependencyProperty ToothProperty =
DependencyProperty.Register("Tooth", typeof(Tooth), typeof(ToothUI), new PropertyMetadata(0));
}
Run Code Online (Sandbox Code Playgroud)
我的问题是在Add Tooth依赖项属性之后,发生此错误
默认值类型与属性的类型不匹配
这个错误究竟是什么意思?目前设置此方法的方式是什么DP
我有一个Linq查询,用于获取实体及其某些导航属性.
context.MyEntity
.AsNoTracking()
.Include(i=> i.Nav1)
.Include(i=> i.Nav2)
.Where(x=> x.Prop1==1)
.FirstOrDefault();
Run Code Online (Sandbox Code Playgroud)
我的问题是:
以上查询是否足以不跟踪MyEntity
导航属性NAv1
和/ Nav2
或我必须AsNoTracking
为每个导航属性添加?
像这样:
context.MyEntity
.AsNoTracking()
.Include(i=> i.Nav1)
.AsNoTracking()
.Include(i=> i.Nav2)
.AsNoTracking()
.Where(x=> x.Prop1==1)
.FirstOrDefault();
Run Code Online (Sandbox Code Playgroud) 我上了这堂课
public class fooBase
{
public List<MethodsWithCustAttribute> MethodsList;
public bool fooMethod([CallerMemberName]string membername =""))
{
//This returns a value depending of type and method
}
public void GetMethods()
{
// Here populate MethodsList using reflection
}
}
Run Code Online (Sandbox Code Playgroud)
而这个属性类
// This attribute get from a database some things, then fooMethod check this attribute members
public class CustomAttribute
{
public string fullMethodPath;
public bool someThing ;
public bool CustomAttribute([CallerMemberName]string membername ="")
{
fullMethodPath = **DerivedType** + membername
// I need here to get …
Run Code Online (Sandbox Code Playgroud) 我至少已经阅读了4个小时,并且似乎是列表类型,但我有一个情况:
具有集合属性的ObservableCollection.
我定义了第一个DataGrid,并在该部分中
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<!-- second Datagrid here, binding to Level2 property of my Observable collection -->
</DataTemplate>
<DataGrid.RowDetailsTemplate>
Run Code Online (Sandbox Code Playgroud)
一切顺利,屏幕上的所有内容都如我所料......但是:
'EditItem' is not allowed for this view
我错过了什么?
这是我的模特:
public partial class Level1
{
public Level1()
{
this.Level2 = new HashSet<Level2>();
}
public decimal IdLevel1 { get; set; }
public decimal IdLevel2 { get; set; }
public string StrDescripcionTipoAsociado {get;set;}
public virtual Level2 Level2{ get; set; }
}
public partial class Level2
{
public decimal IdLevel1 { …
Run Code Online (Sandbox Code Playgroud) 我有这样的课
public class Foo
{
public string prop1 {get;set;}
public string prop1 {get;set;}
}
Run Code Online (Sandbox Code Playgroud)
和一个带有a的视图模型List<Foo>
,这个列表被用作Bind
一个DataGrid
,然后在代码隐藏中我需要获取 Datagrid.SelectedItems
集合并将其转换为List<Foo>
我尝试过的事情:
List<Foo> SelectedItemsList= (List<Foo>)DataGrid.SelectedItems;
// OR
object p = DataGrid.SelectedItems;
List<Foo> SelectedItemsList= ((IList)p).Cast<Foo>().ToList();
Run Code Online (Sandbox Code Playgroud)
所有这些方式编译但在运行时抛出异常.
施放它的正确方法是什么?
注意:基本类型DataGrid
是这ObservableCollection
是否有所不同?
我安装了tfs服务器,它允许我连接,但是当尝试创建团队项目时,它会显示此消息.
TF30172: You do not have permission to create a new team project.
Run Code Online (Sandbox Code Playgroud)
我目前所有的许可都已确定,或至少我认为如此.
我还能检查什么?
我有这个枚举:
/// <summary>
/// Accoun types enumeration
/// </summary>
public enum AcoountTypeTransaction
{
[Description("Account type debit")]
Debit = 0,
[Description("Account type Credit")]
Credit = 1
}
Run Code Online (Sandbox Code Playgroud)
我想展示我的intellisense的描述,这只是一个样本,我有许多必须解释的枚举.有一种方法可以做到这一点
我有这两个实体
public partial class Suscriptores
{
public Suscriptores()
{
this.Publicacion = new HashSet<Publicacion>();
}
[Key]
public int IdSuscriptor { get; set; }
public string LogoSuscriptor { get; set; }
public string Identificacion { get; set; }
public string Nombre { get; set; }
public string Direccion { get; set; }
public string Telefono { get; set; }
public string Email { get; set; }
public string Fax { get; set; }
public string Home { get; set; }
public virtual …
Run Code Online (Sandbox Code Playgroud) 我正在面对jquery的一些跨浏览器问题,经过一些研究我发现我的应用程序正在使用jquery 1.8.11或者至少我是这么认为的.
我的项目是一个带有c#的MVC4 asp.net应用程序.
实际上我正在尝试禁用 - 启用一些按钮,它在IE上工作正常,但不在chrome/firefox/safari中.
<ul class="ui-grid-d">
<li class="ui-block-a"><a id="MostrarDetallePedido" class="ui-btn ui-btn-up-a" disabled="disabled" href="/Documentos/Docs/DocsDetalle?StrIdDocumento=01500___00000000000000041" data-role="button" data-theme="a" data-ajax="false"><span aria-hidden="true" class="ui-btn-inner"><span class="ui-btn-text">Detalle</span></span></a></li>
<li class="ui-block-b"><a id="ItemCondiciones" class="ui-state-disabled ui-btn ui-btn-up-b" disabled="disabled" href="/Documentos/Docs/DocsDetalle?StrIdDocumento=01500___00000000000000041" data-role="button" data-theme="b" data-ajax="false"><span aria-hidden="true" class="ui-btn-inner"><span class="ui-btn-text">Condiciones</span></span></a></li>
<li class="ui-block-c"><a id="ItemEliminar" class="ui-state-disabled ui-btn ui-btn-up-c" disabled="disabled" href="/Documentos/Docs/DocsDetalle?StrIdDocumento=01500___00000000000000041" data-role="button" data-theme="c" data-ajax="false"><span aria-hidden="true" class="ui-btn-inner"><span class="ui-btn-text">Eliminar</span></span></a></li>
<li class="ui-block-d"><a id="ItemAdiciones" class="ui-state-disabled ui-btn ui-btn-up-d" disabled="disabled" href="/Documentos/Docs/DocsDetalle?StrIdDocumento=01500___00000000000000041" data-role="button" data-theme="d" data-ajax="false"><span aria-hidden="true" class="ui-btn-inner"><span class="ui-btn-text">Adiciones</span></span></a></li>
<li class="ui-block-e"><a id="ItemComponentes" class="ui-state-disabled ui-btn ui-btn-up-e" disabled="disabled" href="/Documentos/Docs/DocsDetalle?StrIdDocumento=01500___00000000000000041" data-role="button" data-theme="e" data-ajax="false"><span aria-hidden="true" class="ui-btn-inner"><span class="ui-btn-text">Componentes</span></span></a></li>
</ul>?
Run Code Online (Sandbox Code Playgroud)
我试过了 …
我有一个名为'mySolution'的解决方案,有两个项目:
ProjectA包含名为"mySolutionResources.resx"的资源文件.
ProjectB引用projectA,但无法访问mySolutionResources中的资源.
经过一些研究,我发现:"资源类都标记为内部".
我现在的问题是:
如果我只想维护一个'mySolutionResources.resx',我怎样才能从projectB访问它?如果不可能,还有另一种方法吗?
c# ×8
wpf ×3
datagrid ×2
.net ×1
asp.net-mvc ×1
casting ×1
enums ×1
jquery ×1
linq ×1
tfs ×1
tfs2010 ×1
tfs2012 ×1
wpf-controls ×1
wpfdatagrid ×1
xaml ×1