Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF store layout in resources
    text
    copied!<p>I have application where default Window's borders switched off</p> <p>Window tag definition looks like this:</p> <pre><code>&lt;Window x:Class="TEA.UI.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Title" WindowStyle="None" AllowsTransparency="True" Background="Transparent"&gt; </code></pre> <p>Inside Window tag, there is Grid panel, it contains several Rectangle shapes and few other grids.</p> <p>It looks like this:</p> <pre><code>&lt;Grid&gt; &lt;!-- WINDOW BACKGROUND --&gt; &lt;Rectangle Stroke="#FF214E80" RadiusX="3" RadiusY="3" ClipToBounds="True"&gt; &lt;Rectangle.Fill&gt; &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt; &lt;GradientStop Color="#FF193C6C" Offset="0"/&gt; &lt;GradientStop Color="#FF2A65A4" Offset="1"/&gt; &lt;/LinearGradientBrush&gt; &lt;/Rectangle.Fill&gt; &lt;/Rectangle&gt; &lt;!-- // WINDOW BACKGROUND --&gt; &lt;!-- HEADER HIGHLIGHT2 --&gt; &lt;Rectangle HorizontalAlignment="Stretch" Margin="2,2,2,0" VerticalAlignment="Top" Height="62" RadiusX="2" RadiusY="2"&gt; &lt;Rectangle.Fill&gt; &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt; &lt;GradientStop Color="#00193C6C" Offset="1"/&gt; &lt;GradientStop Color="#4C96ABC3" Offset="0"/&gt; &lt;/LinearGradientBrush&gt; &lt;/Rectangle.Fill&gt; &lt;/Rectangle&gt; &lt;!-- // HEADER HIGHLIGHT2 --&gt; &lt;Grid&gt; .... &lt;/Grid&gt; </code></pre> <p></p> <p>These rectangle shapes are used in other window dialogs as well. </p> <p>My questions are:</p> <p>How would it be possible to store these recatangles inside WPF resource dictionary? </p> <p>How would I be able to reference them?</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