Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1090417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:22:13+00:00 2026-05-16T23:22:13+00:00

Paragraph p = new Paragraph(); void Function(var inline) { var r = (inline); string

  • 0
Paragraph p = new Paragraph();

void Function(var inline)
{
    var r = (inline);
    string rSer = XamlWriter.Save(r);
    var inl1 = XamlReader.Parse(rSer);
    p.Inlines.Add(inl1); // error The best overloaded method match for System.Windows.Documents.InlineCollection.Add(System.Windows.UIElement)' has some invalid arguments    
}

inline type can be System.Windows.Documents.Run or System.Windows.Documents.Span.

How do I know the type of inline and lead to it?

I need something like this:

Type t = Type.GetType(inline.GetType().ToString()); // results in t == null 
p.Inlines.Add(inline as t);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:22:14+00:00Added an answer on May 16, 2026 at 11:22 pm

    Since System.Windows.Documents.Run and System.Windows.Documents.Span both derive from System.Windows.Documents.Inline it could be as simple as:

    // untested
    void Function(Inline inline1)
    {
        string rSer = XamlWriter.Save(inline1);
        var inline2 = XamlReader.Parse(rSer) as Inline;
        p.Inlines.Add(inline2); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

static void Main(string[] args) { string saveFileAs = D:\\Hello.pdf; Program p = new Program();
I would like to add some paragraphs or new lines or words dynamically but
I am using Regex to retrieve a paragraph. My paragraph in my string variable
Here's the code: public void PrintBoletin(int studentId, int gradeParaleloId) { StudentRepository studentRepo = new
have a look at this code please: public void BindElements<T>(IEnumerable<T> dataObjects) { Paragraph para
Hey, I have a richtextbox. To add content I do this Paragraph p =
In this example: Document document=new Document(); PdfWriter.getInstance(document,new FileOutputStream(hello.pdf)); document.open(); Paragraph paragraph = new Paragraph();
Paragraph 7.3.3. of C++2003 standard states that Using declaration for a class member shall
I have a big paragraph of text that is divided into subparagraphs with <br>
I have a paragraph of text below that I want to use an input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.