เรามีชุด SVG ที่จัดเก็บไว้ในพจนานุกรมทรัพยากร
ตัวอย่าง:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DrawingImage x:Key="Bell">
<DrawingImage.Drawing>
<DrawingGroup Opacity="1">
<DrawingGroup.Children>
<DrawingGroup Opacity="1">
<DrawingGroup.Children>
<DrawingGroup Opacity="1">
<DrawingGroup.Children>
<GeometryDrawing Brush="#FF000000" Pen="{x:Null}">
<GeometryDrawing.Geometry>
<PathGeometry FillRule="Nonzero" Figures="........." />
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</ResourceDictionary>
หากคุณสังเกตเห็นว่า Geometry Drawing Brush ถูกตั้งค่าเป็น #ff000000 (สีดำ) ปัญหาที่เราเผชิญคือการอนุญาตให้มุมมองแสดง SVG นี้และกำหนดสีขณะรันไทม์ (ผ่านการผูก)
หน้าต่างของเรา (มุมมอง) มีพจนานุกรมทรัพยากรพร้อมไอคอนภายใน Window.Resources
เรากำลังมองหาวิธีแก้ปัญหาดังนี้:
<Image Source="{StaticResource Bell}" Fill="#FF884422"/>