XamlFormatProvider missing reference ??

3 posts, 1 answers
  1. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 03 Apr 2012 Link to this post

    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. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 04 Apr 2012 Link to this post

    For anyone interested i found the ref i need it is:

    Telerik.Windows.Documents.FormatProviders.Xaml
  3. DevCraft banner
  4. Answer
    Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 05 Apr 2012 Link to this post

    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 >>
Back to Top