0
有沒有人有任何想法爲什麼我的列表框不會在非Visual Studio調試版本中運行時填充?在調試版本(F5)中運行時,它完全沒有任何斷點,但是當我在非調試(Ctrl + F5)下運行時,它不會被填充。列表框不在非調試
我甚至不知道從哪裏開始,因爲谷歌顯示沒有用,我不能使用調試器,因爲它在調試時工作正常。
public partial class ErrorLog: Window
{
/// <summary>
/// Collection of all errors
/// </summary>
public static SafeObservable<ErrorMessage> ErrorList
{
get {
return ErrorLog.errorList;
}
set
{
ErrorLog.errorList = value;
}
} private static SafeObservable<ErrorMessage> errorList = new SafeObservable<ErrorMessage>();
/// <summary>
/// Default constrcutor
/// </summary>
public ErrorLog()
{
InitializeComponent();
}
private void Clear_Click(object sender, RoutedEventArgs e)
{
//ErrorLog.ErrorList.Clear();
}
}
甲SafeObservable類只是一個擴展到正常ObservableColleciton類利用所述調度器的必要時調用從一個不同的線程更新UI。我在大約12個不同的地方使用這個集合來完成我的項目,並且它工作得很好。但在這個單一的情況下,它並沒有。
Link to SafeObservable is here
的XAML代碼如下
<Window x:Class="Dashboard.ErrorLog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Dashboard"
Title="ErrorLog" Height="448" Width="822" WindowStyle="ToolWindow">
<Grid Background="#222222">
<ListBox Name="Error_listBox" ItemsSource="{Binding Source={x:Static local:ErrorLog.ErrorList}}" Margin="12,12,12,41" IsSynchronizedWithCurrentItem="True" />
<Button Height="23" HorizontalAlignment="Left" Margin="12,0,0,12" Name="Clear" VerticalAlignment="Bottom" Width="75" Click="Clear_Click">Clear</Button>
</Grid>
</Window>
任何幫助高度讚賞。
是否有任何數據文件或任何與您的調試目錄有關的目錄結構相關的數據文件? – 2010-02-22 17:26:15
不,Debug目錄是空的,我不認爲它使用調試目錄,因爲它正在運行發佈版本,但附帶有一個調試器。 – 2010-02-22 17:32:07
您是否嘗試過將值硬編碼到您的集合中,以確保某些內容在那裏? – 2010-02-22 18:02:31