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 6581327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:08:19+00:00 2026-05-25T16:08:19+00:00

I am using Silverlight 4 and Expression Blend 4. I am styling a MenuItem

  • 0

I am using Silverlight 4 and Expression Blend 4.

I am styling a MenuItem with a path as Icon.

<Style x:Key="1234" TargetType="Controls:MenuItem">
        <Setter Property="Header" Value="Cancel" />
        <Setter Property="Icon">
            <Setter.Value>
                <Path Fill="#FF2B2B2B"
                      Width="14.3775"
                      Height="14"
                      Canvas.Left="0.311264"
                      Canvas.Top="0.500005"
                      Stretch="Fill"
                      Data="F1 M 111.2,-85.6L 124.2,-85.6L 124.2,-72.6L 111.2,-72.6L 111.2,-85.6 Z M 117.791,-82.3439L 117.791,-80.4506L 112.685,-80.4506L 112.685,-77.8084L 117.791,-77.8084L 117.791,-75.8748L 121.025,-79.1094L 117.791,-82.3439 Z M 121.657,-84.0222L 121.657,-74.0222L 122.657,-74.0222L 122.657,-84.0222L 121.657,-84.0222 Z " />
            </Setter.Value>
        </Setter>
    </Style>

But this gives an exception expression blend when I try to open this.

Exception Message: Error HRESULT E_FAIL has been returned from a call to a COM component
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cdData)

This also gives exception at runtime when I add this style to a ContextMenu’s item.

  • 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-25T16:08:20+00:00Added an answer on May 25, 2026 at 4:08 pm

    Put the styling in control template:

    <ControlTemplate x:Key="CancelIcon">
          <Canvas>
            <Path Fill="#FF2B2B2B"
                              Width="14.3775"
                              Height="14"
                              Canvas.Left="0.311264"
                              Canvas.Top="0.500005"
                              Stretch="Fill"
                              Data="F1 M 111.2,-85.6L 124.2,-85.6L 124.2,-72.6L 111.2,-72.6L 111.2,-85.6 Z M 117.791,-82.3439L 117.791,-80.4506L 112.685,-80.4506L 112.685,-77.8084L 117.791,-77.8084L 117.791,-75.8748L 121.025,-79.1094L 117.791,-82.3439 Z M 121.657,-84.0222L 121.657,-74.0222L 122.657,-74.0222L 122.657,-84.0222L 121.657,-84.0222 Z " />
          </Canvas>
        </ControlTemplate>
    

    Then for menu try the following

    <MenuItem Header="Cancel" >
      <MenuItem.Icon>
        <ContentControl Template="{StaticResource CancelIcon}" />
      </MenuItem.Icon>
    </MenuItem>
    

    Hope this will work out 🙂

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

Sidebar

Related Questions

I'm building a prototype using Expression Blend 3 and SketchFlow (a Silverlight SketchFlow application
I currently have a silverlight app designed mainly in expression blend, using a border
I am a bit confused about the difference between Silverlight and Expression Blend. From
Okay. I want to transfer a number of templates from an Expression Blend Silverlight
I'm working on a custom control for Silverlight 4 in VS2010 and Expression Blend
So I created a layout in Expression Blend 4 for my Silverlight application. Now
When viewing a Silverlight 5 project in blend if you are using System.Windows.Interactivity you
Using Silverlight 3 with RIA: What's the difference between the LoadOperation.Completed event and using
I have just started using silverlight 2 beta and cannot find how to or
I'm using Silverlight 3 in Visual Studio 2008. Unfortunately I can't seem to get

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.