This is a migrated thread and some comments may be shown as answers.

XamlFormatProvider missing reference ??

2 Answers 149 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrew
Top achievements
Rank 1
Andrew asked on 03 Apr 2012, 10:13 AM
I am trying to load a document into radtextbox so i can print it out.

I used some code from your sample.

private const string TemplateDocumentPath = "Template Files/bt_timesheet_print.xaml";
 
        private RadDocument LoadDocument()
        {
            RadDocument document = new RadDocument();
 
            using (Stream stream = Application.GetResourceStream(GetResourceUri(TemplateDocumentPath)).Stream)
            {
                document = new XamlFormatProvider().Import(stream);
                document.LayoutMode = DocumentLayoutMode.Flow;
            }
 
            return document;
        }
 
        private Uri GetResourceUri(string resource)
        {
            AssemblyName assemblyName = new AssemblyName(this.GetType().Assembly.FullName);
            string resourcePath = "/" + assemblyName.Name + ";component/" + resource;
            Uri resourceUri = new Uri(resourcePath, UriKind.Relative);
            return resourceUri;
        }


But am getting an error on XamlFormatProvider , i don't know what namespace and reference i need for this.
Inteli sense from Visual Studio is not recognising it.

2 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 04 Apr 2012, 11:50 AM
For anyone interested i found the ref i need it is:

Telerik.Windows.Documents.FormatProviders.Xaml
0
Accepted
Iva Toteva
Telerik team
answered on 05 Apr 2012, 09:00 AM
Hello Andrew,

You are right, XamlFormatProvider is contained in Telerik.Windows.Documents.FormatProviders.Xaml.

All assembly references that RadRichTextBox needs along with its default UI, the format providers and the spell-checking dictionary are listed here.

Kind regards,
Iva Toteva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
RichTextBox
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or