I am using Caliburn.Micro and try to use MVVM; so my ViewModel and Views are separated; I've removed the xaml.cs from the View and run into an issue that my ListBox does not bind to a public ObservableCollection (And I am unable to figure out how)
Consider the following XAML:
<Controls:Tile Title="Track & Trace Reset"
Controls:ControlsHelper.MouseOverBorderBrush="{DynamicResource MahApps.Brushes.ThemeForeground}"
Width="155" Height="155"
HorizontalTitleAlignment="Center"
x:Name="Button" />
<ListBox x:Name="LogEntries" ItemsSource="{Binding LogEntries}"/>
and the following class:
public class DebugViewModel
{
public ObservableCollection<LogEntryModel> LogEntries = new ObservableCollection<LogEntryModel>(GlobalConfig.Connection.GetLogEntries());
public void Button()
{
GetLogEntries();
}
private void GetLogEntries() {
LogEntries = new ObservableCollection<LogEntryModel>(GlobalConfig.Connection.GetLogEntries());
//if filter exists, filter the list
return;
//Format based on Severity
}
}
The "Button"-binding works as intended; the ListBox however doesn't display anything (I at least expected some raw-text from the Model that it should display). The LogEntries gets filled (8 entries) - that also functions;
How can I troubleshoot the binding issue?