Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions XamlStudio/Views/DataSources.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ private void DataSources_Loaded(object sender, RoutedEventArgs e)

public void Receive(ActiveDocumentViewModelChangedMessage message)
{
if (message.NewDocVM is null)
{
return;
}

// Update are shadow-copy based on MainViewModel
_activeDocument = message.NewDocVM.Document;
ActiveDataContext = _activeDocument.DataContext;
Expand Down
2 changes: 1 addition & 1 deletion XamlStudio/Views/Properties.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private void Properties_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
WeakReferenceMessenger.Default.RegisterAll(this);

// Check if there's a render and initialize our existing state
if (MainViewModel.ActiveDocumentViewModel.HasCompiled)
if (MainViewModel.ActiveDocumentViewModel?.HasCompiled ?? false)
{
Receive(new XamlRenderedMessage(MainViewModel.ActiveDocumentViewModel.Result));
}
Expand Down