예제 #1
0
        public MainWindow()
        {
            InitializeComponent();
#if Framework4_0
            //Enables touch manipulation.
            rte.IsManipulationEnabled = true;
#endif
            rte.FileOpening += (sender, e) =>
            {
                rte.Document = DocxImporting.ConvertToDocumentAdv(e.DocumentStream, e.FormatType);
                PageCount    = rte.Viewer.Pages.Count;
            };

            rte.FileSaving += (sender, e) =>
            {
                DocxExporting.ConvertToDocument(rte.Document, e.DoucmentStream, e.FormatType);
            };

            rte.Loaded += (sender, e) =>
            {
                PageCount = rte.Viewer.Pages.Count;
            };
            rte.LayoutUpdated += (sender, e) =>
            {
                PageCount = rte.Viewer.Pages.Count;
            };
            rte.OpenFailed       += rte_OpenFailed;
            rte.SaveFailed       += rte_SaveFailed;
            rte.RequestNavigate  += rte_RequestNavigate;
            DataContext           = rte;
            pagecount.DataContext = this;
            SkinStorage.SetVisualStyle(this, "Office2013");
        }
예제 #2
0
        protected override void Invoke(object parameter)
        {
            FileOpeningEventArgs args = parameter as FileOpeningEventArgs;

            if (args != null)
            {
                ((RichTextBoxAdv)Target).Document = DocxImporting.ConvertToDocumentAdv(args.DocumentStream, args.FormatType);
            }
        }