Exemplo n.º 1
0
        public App()
        {
            InitializeComponent();

            HtmlPreview.Init();

            bootstrapper = new AppBootstrapper();
        }
Exemplo n.º 2
0
        public App()
        {
            InitializeComponent();

            bootstrapper = new AppBootstrapper();

            HtmlPreview.Init(bootstrapper.GetEventAggregator());
        }
Exemplo n.º 3
0
        private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            HtmlPreview htmlPreview = ((ShellViewModel)DataContext).MDI.HtmlPreview;

            if (htmlPreview != null)
            {
                htmlPreview.Close();
            }
        }
Exemplo n.º 4
0
        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);
        }