XAML :
<ListBox x:Name="List">
<ListBox.ItemTemplate>
<DataTemplate>
// TextBlock to display Exception String... Here I Binded Using ErrorText String
<TextBlock Text="{Binding ErrorText}" TextWrapping="Wrap" Margin="0,0,0,15"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
C 번호 :
// Class to Store your String Exceptions
public class Errors
{
// String Exception Error
public string ErrorText { get; set; }
public Errors(string error)
{
this.ErrorText = error;
}
}
// Code to Add exception error to ListBox Itemssource. Before this create List that having Error like this.
List<Errors> ErrorsSource = new List<Errors>();
ErrorsSource.Add(new Errors("Error 1 Value of type 'System.IO.FileAccess' cannot be
converted to 'System.IO.IsolatedStorage.IsolatedStorageFile'"));
ErrorsSource.Add(new Errors("The exception (Operation not permitted on
IsolatedStorageFileStream.) occurs at _Play function while reading the file "));
List.ItemsSource = ErrorsSource;
나를 제대로 여부를이있어 여부를 알려주십시오.
하나의 큰 텍스트 블록 대신 예외 텍스트 블록을 넣는 목록을 사용하는 것이 좋습니다. – thumbmunkeys
조금 도와 주시겠습니까? 나는 초보자이고 전에 목록을 사용한 적이 없습니다. –
귀하의 텍스트 블록을 목록 상자로 대체하십시오. 'listbox.items'에 예외 문자열을 추가하십시오. – thumbmunkeys