load the CodeBlock
This commit is contained in:
parent
eeae7379e6
commit
4ff072ba06
3 changed files with 13 additions and 3 deletions
|
|
@ -20,7 +20,7 @@
|
|||
<PackageVersion Include="Live.Avalonia" Version="1.4.2" />
|
||||
<PackageVersion Include="Mapsui" Version="5.1.0" />
|
||||
<PackageVersion Include="Mapsui.Avalonia12" Version="5.1.0" />
|
||||
<PackageVersion Include="MarkdownViewer.Core" Version="1.0.5" />
|
||||
<PackageVersion Include="MarkdownViewer.Core" Version="1.0.6-47" />
|
||||
<PackageVersion Include="Material.Avalonia" Version="3.21.0" />
|
||||
<PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.3" />
|
||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2" />
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Avalonia.Controls;
|
|||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Styling;
|
||||
using Avalonia.Threading;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using PostIt.Services;
|
||||
using PostIt.ViewModels;
|
||||
|
|
@ -200,7 +201,8 @@ public partial class App : Application, ILiveView, IVMPusherApp
|
|||
|
||||
public void ConfigureRootView(MainView rootView)
|
||||
{
|
||||
rootView.AttachedToVisualTree += async (_, _) => await BootOnceAsync();
|
||||
rootView.AttachedToVisualTree += (_, _) =>
|
||||
Dispatcher.UIThread.Post(() => _ = BootOnceAsync());
|
||||
|
||||
var sessionStatus = ServiceProvider!.GetRequiredService<SessionStatusViewModel>();
|
||||
sessionStatus.LogoutCompleted += () =>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,15 @@ public partial class BlogsViewModel : ViewModelBase, IActionStatusViewModel
|
|||
}
|
||||
|
||||
OnPropertyChanging(nameof(DraftArticle));
|
||||
DraftArticleDocument = value is not null ? new TextDocument(value) : null;
|
||||
try
|
||||
{
|
||||
DraftArticleDocument = value is not null ? new TextDocument(value) : null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
StatusMessage = $"Error setting DraftArticleDocument: {ex.Message}";
|
||||
// Handle any exceptions that might occur when setting the DraftArticleDocument
|
||||
}
|
||||
OnPropertyChanged(nameof(DraftArticle));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue