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

  • Home
  • SEARCH
  • 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 6247135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:48:53+00:00 2026-05-24T12:48:53+00:00

Why does the following C# code not produce the equivalent of my Silverlight code?

  • 0

Why does the following C# code not produce the equivalent of my Silverlight code?

XAML

    <Border CornerRadius="8" BorderBrush="White" Height="70" BorderThickness="4">
        <StackPanel Orientation="Horizontal">
            <Border Margin="5,0,0,0" BorderBrush="White" Height="45" Width="45" BorderThickness="2" CornerRadius="2" Background="White">
                <Image Source="/Crystal%20Cloud;component/Resources/Images/weapons/swords/sword_0.png" />
            </Border>
            <StackPanel Margin="10,0,0,0">
                <TextBlock Text="Wooden Dagger" FontFamily="Comic Sans MS" />
                <TextBlock Text="DPS: 1" FontFamily="Comic Sans MS" FontSize="16" Margin="15,0,0,0" />
            </StackPanel>
        </StackPanel>
    </Border>

C#

    private Border CreateListItem(Item item)
    {
        // Main border
        Border itemBorder = new Border();
        itemBorder.BorderThickness = new Thickness(4);
        itemBorder.CornerRadius = new CornerRadius(8);
        itemBorder.BorderBrush = new SolidColorBrush(Colors.White);
        itemBorder.Height = 70;

        // Main stack panel
        StackPanel mainPanel = new StackPanel();
        mainPanel.Orientation = Orientation.Horizontal;
        itemBorder.Child = mainPanel;

        // The item's image border
        Border imageBorder = new Border();
        imageBorder.Margin = new Thickness(5, 0, 0, 0);
        itemBorder.BorderThickness = new Thickness(2);
        itemBorder.CornerRadius = new CornerRadius(2);
        itemBorder.BorderBrush = new SolidColorBrush(Colors.White);
        itemBorder.Background = new SolidColorBrush(Colors.White);
        itemBorder.Height = 45;
        itemBorder.Width = 45;
        mainPanel.Children.Add(imageBorder);

        // The item's image
        Image image = new Image();
        image.Source = new BitmapImage(new Uri("/Crystal%20Cloud;component/Resources/Images/weapons/swords/sword_0.png"));
        imageBorder.Child = image;

        // The stack panel for the text
        StackPanel textPanel = new StackPanel();
        textPanel.Margin = new Thickness(10, 0, 0, 0);
        mainPanel.Children.Add(textPanel);

        // The title text block
        TextBlock titleText = new TextBlock();
        titleText.Text = "Wooden Dagger";
        titleText.FontFamily = new FontFamily("Comic Sans MS");
        textPanel.Children.Add(titleText);

        // The status text block
        TextBlock statusText = new TextBlock();
        statusText.Text = "DPS: 1";
        statusText.FontFamily = new FontFamily("Comic Sans MS");
        statusText.FontSize = 16;
        statusText.Margin = new Thickness(15, 0, 0, 0);
        textPanel.Children.Add(statusText);

        return itemBorder;
    }
  • 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-24T12:48:54+00:00Added an answer on May 24, 2026 at 12:48 pm

    Erg… just found the bug itemBorder should be changed to imageBorder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does the following code Graphics[Raster[{{Hue[1], Hue[1/3]}, {Hue[2/3], Hue[1/6]}}]] not produce any output? In
The following code does not produce the expected output. Why? wchar_t* wchar_t_printf_return(wchar_t* formatstring, ...){
Why does the following code not produce three lines, all with similar gradients? <html>
The following Common Lisp code does not produce the output I would expect it
Short and sweet: Why does the following block of Objective-C code not produce a
The following code does not produce an exception but instead passes the value 4
I've got the following code that does not produce an CA1804 warning (declared variable
Why does the following code not work as I was expecting? <?php $data =
Why does the following code NOT give an error, nor any type of a
The following code does not compile: public class GenericsTest { public static void main(String[]

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.