Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue re-using XAML paths for use within Windows 8 Store App
    text
    copied!<p>I am trying to re-use a XAML <code>&lt;Path /&gt;</code> that I have made for an icon in my Windows 8 Store App, however when I attempt to re-use them more than once, it never displays?</p> <p>For example, both the initial instances are fine and my Tick/Cross path renders with this XAML code:</p> <pre><code>&lt;Path x:Name="TickGlyph" Style="{StaticResource TickGlyph}" Fill="#FF008500" Grid.Column="1" Width="48" Height="48" Margin="24,0,4,0" /&gt; &lt;Path x:Name="CrossGlyph" Style="{StaticResource CrossGlyph}" Fill="#FF850000" Grid.Column="1" Width="48" Height="48" Margin="24,0,4,0" /&gt; </code></pre> <p>As soon as I repeat that code with names like <code>TickGlyph1</code> etc, my subsequent paths are simply blank, could anybody explain what's going on here, or is this some weird limitation with XAML for Windows Store apps?</p> <p>My underlying Styles are as follows:</p> <pre><code>&lt;Style x:Key="TickGlyph" TargetType="Path"&gt; &lt;Setter Property="Data" Value="F1 M 45.12,5.49L 21.255,40.8L 20.4525,40.8L 0,23.2875L 5.775,15.7875L 19.2525,27.3L 37.695,-1.90735e-006L 45.12,5.49 Z "/&gt; &lt;Setter Property="Stretch" Value="Fill"&gt;&lt;/Setter&gt; &lt;/Style&gt; &lt;Style x:Key="CrossGlyph" TargetType="Path"&gt; &lt;Setter Property="Data" Value="F1 M 0,32.505L 13.4025,19.1025L 0,5.69249L 5.67,-7.62939e-006L 19.08,13.41L 32.505,-7.62939e-006L 38.205,5.67L 24.7725,19.1025L 38.205,32.535L 32.505,38.205L 19.08,24.795L 5.67,38.205L 0,32.505 Z "/&gt; &lt;Setter Property="Stretch" Value="Fill"&gt;&lt;/Setter&gt; &lt;/Style&gt; </code></pre> <p><hr> <strong>Update 2012-10-20:</strong> The strange thing is, if I replace <code>Style="{StaticResource TickGlyph}"</code> for <code>Data="F1 M 45.12,5.49L 21.255,40.8L 20.4525,40.8L 0,23.2875L 5.775,15.7875L 19.2525,27.3L 37.695,-1.90735e-006L 45.12,5.49 Z "</code> all my paths load ok, why won't the <code>Style</code> attribute honour? :(</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload