Note that there are some explanatory texts on larger screens.

plurals
  1. POCombining Metro Studio 2 Vector XAML with MahApps MetroCircleButton
    primarykey
    data
    text
    <p>I'm currently working on an App that uses <a href="http://mahapps.com/MahApps.Metro/" rel="nofollow">MahApps</a> as WPF extension to create a Win8 Metro style.</p> <p>MahApps features a MetroCircleButton Style for buttons, however the documentation is a bit short on how to get own vector graphics displayed in the button. I'm using <a href="http://www.syncfusion.com/downloads/metrostudio" rel="nofollow">Metro Studio 2</a> to design the button icons for my app, and it outputs me XAML resource code in the following form:</p> <pre><code>&lt;Viewbox x:Key="xx"&gt; &lt;Grid Width="48" Height="48" Visibility="Visible"&gt; &lt;Grid Visibility="Visible"&gt; &lt;Rectangle Fill="#FF000000" Visibility="Visible" /&gt; &lt;Ellipse Fill="#FF000000" Visibility="Collapsed" /&gt; &lt;Path Data="..." Stretch="Fill" Fill="#FF000000" Visibility="Collapsed" /&gt; &lt;/Grid&gt; &lt;Path Data=".." Stretch="Uniform" Fill="#FFFFFFFF" Width="26" Height="26" Margin="0,0,0,0" /&gt; &lt;/Grid&gt; &lt;/Viewbox&gt; </code></pre> <p>so far so good. However MahApps suggests to use a VisualBrush to display own Vector Graphics:</p> <pre><code>&lt;Rectangle Fill="Black"&gt; &lt;Rectangle.OpacityMask&gt; &lt;VisualBrush Visual="{StaticResource appbar_add}" Stretch="Fill" /&gt; &lt;/Rectangle.OpacityMask&gt; </code></pre> <p></p> <p>I looked through their repo to see what format they are using, its a bit different:</p> <pre><code>&lt;Canvas Width="48.0067" Height="48.0067" Clip="F1 M 0,0L 48.0067,0L 48.0067,48.0067L 0,48.0067L 0,0" x:Key="appbar_alien"&gt; &lt;Path Width="22.005" Height="16.0048" Canvas.Left="12.9999" Canvas.Top="16.9998" Stretch="Fill" Fill="{DynamicResource BlackBrush}" Data="..." /&gt; &lt;/Canvas&gt; </code></pre> <p>Now my question is: can i somehow use the format that Metro Studio gives me to get my icon displayed int the button, keeping the mouseover animation of the circlebutton without having to manually convert all the buttons to the right format (and loosing data possibly)?</p> <p>Regards, Xaser</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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