EDN Admin
Well-known member
Hi: I am getting more and more confused so I need help to insert a Geometry Drawing into a xaml file.
The point of all this is to insert paths the user draws that i have in code into the the xaml resource file.
Here is the resource original file:<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml
<DrawingBrush x:Key="HorizontalPipeOff" Stretch="Uniform
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<!-- Insert Geometry Drawing -->
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M 50.035,24.9931L 0.0350494,24.9931
<GeometryDrawing.Pen>
<Pen Thickness="3" LineJoin="Round" Brush="#FF000000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="HorizontalPipeOn" Stretch="Uniform
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<!-- Insert Geometry Drawing -->
<GeometryDrawing Brush="#FF0096FF" Geometry="F1 M 49.9581,25.0765L -0.0418854,25.0765
<GeometryDrawing.Pen>
<Pen Thickness="3" LineJoin="Round" Brush="#FF0096FF"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="HorizontalPipeAlarm" Stretch="Uniform
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<!-- Insert Geometry Drawing -->
<GeometryDrawing Brush="#FFFF0000" Geometry="F1 M 50.0419,25.0765L 0.0418828,25.0765
<GeometryDrawing.Pen>
<Pen Thickness="3" LineJoin="Round" Brush="#FFFF0000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</ResourceDictionary>
Here is the xaml I am trying to insert:<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M 25.0417,0.0766792L 25.0417,50.0767
<GeometryDrawing.Pen>
<Pen Thickness="3" LineJoin="Round" Brush="#FF000000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
Mike Gallinger C.Tech. Cutting Edge Computing Software Developer
Mike Gallinger C.Tech. Cutting Edge Computing Software Developer
View the full article
- Read the xaml resource file.
- Locate the DrawingGroup.Children. There are 3 of these in the file I am modifiing.
- Insert a Geometry Drawing into the 3 DrawingGroup.Children.
- Save and close the file.
The point of all this is to insert paths the user draws that i have in code into the the xaml resource file.
Here is the resource original file:<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml
<DrawingBrush x:Key="HorizontalPipeOff" Stretch="Uniform
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<!-- Insert Geometry Drawing -->
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M 50.035,24.9931L 0.0350494,24.9931
<GeometryDrawing.Pen>
<Pen Thickness="3" LineJoin="Round" Brush="#FF000000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="HorizontalPipeOn" Stretch="Uniform
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<!-- Insert Geometry Drawing -->
<GeometryDrawing Brush="#FF0096FF" Geometry="F1 M 49.9581,25.0765L -0.0418854,25.0765
<GeometryDrawing.Pen>
<Pen Thickness="3" LineJoin="Round" Brush="#FF0096FF"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="HorizontalPipeAlarm" Stretch="Uniform
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<!-- Insert Geometry Drawing -->
<GeometryDrawing Brush="#FFFF0000" Geometry="F1 M 50.0419,25.0765L 0.0418828,25.0765
<GeometryDrawing.Pen>
<Pen Thickness="3" LineJoin="Round" Brush="#FFFF0000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</ResourceDictionary>
Here is the xaml I am trying to insert:<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M 25.0417,0.0766792L 25.0417,50.0767
<GeometryDrawing.Pen>
<Pen Thickness="3" LineJoin="Round" Brush="#FF000000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
Mike Gallinger C.Tech. Cutting Edge Computing Software Developer
Mike Gallinger C.Tech. Cutting Edge Computing Software Developer
View the full article