locked
inserting an image into c# ITEM_CONTENT string RRS feed

  • Question

  • Hi!
    i'm very new to coding - how do i add an image in between my text in an ITEM_CONTENT String?
    I am using Visual Studio 2012 in C Sharp, using a XAML template. I'm playing around with the templates and inserting my own content, but have no idea how to insert an image.

    It currently looks something like

    String ITEM_CONTENT = ("text text");

    how do i add a picture in between the two text? anything i type in between the " " simply come up as text - i am unfamiliar on how to use image_path etc, do i need to define anything, or is there something really simple and basic like using <image source= ..../> in html?


     
    Thanks!

    Sunday, September 8, 2013 1:45 PM

Answers

  • Hi John,

    Images can be only added into a RichTextBlock/RichTextBox, you could use InlineUIContainer to add a image.

    The XAML looks below:

    <RichTextBlock>
        <Paragraph>
            <Italic>This is an inline image.</Italic>
            <InlineUIContainer>
                <Image Source="Assets/SmallLogo.png" Height="30" Width="30"/>
            </InlineUIContainer>
     
            Mauris auctor tincidunt auctor.
        </Paragraph>
    </RichTextBlock>

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, September 9, 2013 4:10 AM
    Moderator