How can merge two xaml file exported by telerik control

2 posts, 0 answers
  1. Saurabh
    Saurabh avatar
    2 posts
    Member since:
    Apr 2012

    Posted 20 Oct 2013 Link to this post

    Hi,
    I have exported two files in  xaml format.Now i want to merge those two files in one.how can it will possible?
    Here my code example:
    string _xaml1=exported xaml;
    string _xaml2=exported xaml data;
      XamlFormatProvider _provider = new XamlFormatProvider();
                    Telerik.Windows.Documents.Model.RadDocument _t = new RadDocument();

    XamlFormatProvider xamlProvider = new XamlFormatProvider();
                      _t = _provider.Import(_xaml1);
                       _n = _provider.Import(_xaml2);
                                            foreach (Telerik.Windows.Documents.Model.Section section in _n.Sections)
                                            {
                                                Section copySection = section.CreateDeepCopy() as Section;
                                                _n.Sections.Remove(section);
                                                _t.Sections.Add(copySection);
                                            }
        BUT HERE I am getting error while using import method.
    Please give me any idea for that.
    Thanks,
  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 23 Oct 2013 Link to this post

    Hi,

    Generally, the recommended approach when merging documents together is to insert them one after the other as demonstrated in this SDK example. If you do not want to actually show a RadRichTextBox for this purpose you can use a RadDocumentEditor instance in your application.

    Additionally, please note that the CreateDeepCopy() methods of document elements are intended for internal purposes mostly and they might not always produce the result you expect, which is why we do not recommend using them.

    When it comes to the error you are observing - would you mind sharing more details on the issue? If possible, please provide us with a XAML file that replicates the issue, so that we can investigate it on our side.

    I'm looking forward to your reply.

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top