W3CError 형식의 개체 컬렉션을 WPF ListView 컨트롤에 바인딩하려고했습니다. .NET WPF XAML "BindingExpression path error : ... 속성을 찾을 수 없습니다."
그것은 그것은 작동하지 않았다Class W3CError Public Type As ErrorOrWarning Public Line As Integer Public Col As Integer Public Message As String Public MessageId As String Public Explanation As String Public Source As String Enum ErrorOrWarning ValidationError ValidationWarning End Enum End Class
... 좋은 작은 13 라인 클래스이었다. Visual Studio 출력 창에서 이러한 바인딩 오류가 발생했습니다.
System.Windows.Data Error: 39 : BindingExpression path error: 'Line' property not found on 'object' ''W3CError' (HashCode=...)'. BindingExpression:Path=Line; DataItem='W3CError' (HashCode=...); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
음, 아니요. 속성이 아닙니다. 단순히 공개 일뿐입니다. WPF 바인딩에 대해서는 충분하지 않다고 생각하십니까?
내가 속성 보일러의 추한 69 개 라인에 내 수업을 연장하여 일을 가지고 ...
Class W3CError Private _Type As ErrorOrWarning Private _Line As Integer Private _Col As Integer Private _Message As String Private _MessageId As String Private _Explanation As String Private _Source As String Enum ErrorOrWarning ValidationError ValidationWarning End Enum Public Property Type() As ErrorOrWarning Get Return _Type End Get Set(ByVal value As ErrorOrWarning) _Type = value End Set End Property Public Property Line() As Integer Get Return _Line End Get Set(ByVal value As Integer) _Line = value End Set End Property Public Property Col() As Integer Get Return _Col End Get Set(ByVal value As Integer) _Col = value End Set End Property Public Property Message() As String Get Return _Message End Get Set(ByVal value As String) _Message = value End Set End Property Public Property MessageId() As String Get Return _MessageId End Get Set(ByVal value As String) _MessageId = value End Set End Property Public Property Explanation() As String Get Return _Explanation End Get Set(ByVal value As String) _Explanation = value End Set End Property Public Property Source() As String Get Return _Source End Get Set(ByVal value As String) _Source = value End Set End Property End Class는 더 좋은 방법이 있나요?
아, 내 바인딩이 작동하지 않는 이유입니다! 감사. – Kieron
나는 너에게 어떤 좌절감을 덜어줬으면 좋겠다. –