Using reference, SVG style RRS feed

  • Question

  • Hello, I would like to know if Silverlight could use a principle of reference block, for example:

    <symbol id="block_NomDuBloc">
    … contenu de bloc …
    //Réutilisation du symbol
    <use xlink:href="#bloc_NomDuBloc"
    style=”stroke: couleur C2;
    stroke-dasharray: type T2;
    stroke-width: épaisseur E2"
    Thank you in advance
    Tuesday, September 23, 2008 3:38 AM


  • Must be in Resources.

    <UserControl.Resources> or in App.xaml <Application.Resources>

    Tuesday, September 23, 2008 9:07 AM

All replies

  • Can you explain the principle?

    As it has been said look at my article on developpez.com, maybe it's what you want Stick out tongue

    Tuesday, September 23, 2008 6:15 AM
  • The aim would be to have such a rectangle with its style and willingness to recall just by changing its position. To avoid redefine the rectangle with the same property.

    I look at the templates.
    En français :
    Le but serai d'avoir par exemple un rectangle avec son style défini et de le rappeler à volonté en modifiant juste sa position. Pour éviter de redéfinir le rectangle avec les mêmes propriété.

    La je regarde les templates.
    Tuesday, September 23, 2008 6:22 AM
  • Ok so it's style


    You define a style for a Rectangle (properties you want) and after you use your style.

    Something like that


        <Style x:Key="MyRectangleStyle" TargetType="Rectangle">
            <Setter Property="Width" Value="50"/>
            <Setter Property="Height" Value="20"/>
            <Setter Property="Fill" Value="Red" />
    <Rectangle Style="{StaticResource MyRectangleStyle}" ... />


    Tuesday, September 23, 2008 6:28 AM
  • But i've this error :

    ParserError- Canvas does not support Style as content.
    Tuesday, September 23, 2008 8:41 AM
  • Must be in Resources.

    <UserControl.Resources> or in App.xaml <Application.Resources>

    Tuesday, September 23, 2008 9:07 AM