public App() { InitializeComponent(); HtmlPreview.Init(); bootstrapper = new AppBootstrapper(); }
public App() { InitializeComponent(); bootstrapper = new AppBootstrapper(); HtmlPreview.Init(bootstrapper.GetEventAggregator()); }
private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e) { HtmlPreview htmlPreview = ((ShellViewModel)DataContext).MDI.HtmlPreview; if (htmlPreview != null) { htmlPreview.Close(); } }
protected override void ChangeActiveItem(IScreen newItem, bool closePrevious) { base.ChangeActiveItem(newItem, closePrevious); CurrentDocument = (DocumentViewModel)newItem; if (HtmlPreview == null) { var view = (MdiView)GetView(); HtmlPreview = new HtmlPreview { Margin = new Thickness(10, 0, 10, 10), HorizontalAlignment = HorizontalAlignment.Stretch, }; HtmlPreview.SetBinding(HtmlPreview.HtmlProperty, new Binding("CurrentDocument.Render")); HtmlPreview.SetBinding(HtmlPreview.FileNameProperty, new Binding("CurrentDocument.MarkpadDocument.Title")); HtmlPreview.SetBinding(HtmlPreview.BrowserFontSizeProperty, new Binding("CurrentDocument.FontSize")); HtmlPreview.SetBinding(HtmlPreview.ScrollPercentageProperty, new Binding("CurrentDocument.View.ScrollPercentage")); view.previewHost.Child = HtmlPreview; } NotifyOfPropertyChange(() => CurrentDocument); }