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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:48:58+00:00 2026-05-11T20:48:58+00:00

I am trying to put as much properties of a Path element into a

  • 0

I am trying to put as much properties of a Path element into a Style, this works out ok, as longs as I don’t add Data to the Style setters:

<UserControl x:Class="Demo.Controls.SilverlightControl1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="400" Height="300">
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.Resources>
            <Style x:Name="PathStyle" TargetType="Path">
                <Setter Property="Data" Value="0,0 L1,0"></Setter>
                <Setter Property="Stroke" Value="Blue"></Setter>     
                <Setter Property="Stretch" Value="Fill"></Setter>
            </Style>

        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Path Grid.Row="0"
               Height="7"               
               Data="M0,0 L1,0"
               Stretch="Fill"
               Stroke="Black"/>
        <Path Grid.Row="1"
               Height="7"               
               Style="{StaticResource PathStyle}"/>
    </Grid>
</UserControl>

If you open this example, you’ll see that the first path gives no problems, but the second one results in an AG_E_UKNOWN_ERROR in Visual Studio 2008.

Is it possible to define the Data of a Path in a Style?

  • 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-11T20:48:58+00:00Added an answer on May 11, 2026 at 8:48 pm

    This should work:

    <Style x:Name="PathStyle" TargetType="Path">
        <Setter Property="Data" Value="M0,0 L1,0"/>
        <Setter Property="Stroke" Value="Blue"/>
        <Setter Property="Stretch" Value="Fill"/>
    </Style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying put an if statement directly into a select field in rails, with
I'm trying to put together a Java Webstart app, but don't want it to
I'm trying to put some simple jQuery code into the Wordpress header (usually just
I'm currently trying to put into place Jquery UI to enable drag and drop
I'm trying to put some C hooks into some code that someone else wrote
I'm having trouble trying to put a ProgressDialog into my app. In my GameEngine
I don't seem to be having much luck on this site, still forever the
I am trying to use Boost Test to add some much needed unit tests
I'm busy trying to put together a 3x3 magazine-style layout for the home page
I trying to put together an Android app that will take a picture and

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.