I have two questions.
1: I have the second rectangle's size bound the first rectangle. How can I add additional padding to the size of the rectangle? For example
Width="{Binding Path=Height + 5,...
That would apply to both the width and height properties. So the rectangle borders the previous one.
2: Expose the color property 'green' so i can change the color each instance i create of this user control.
<UserControl x:Class="WpfApplication1.VNode"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfApplication1"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Canvas VerticalAlignment="Center" HorizontalAlignment="Center">
<Rectangle Name="Base" Fill="Green" Width="50" Height="50"/>
<Rectangle Name="Highlight"
Height="{Binding Path=Width, ElementName=Base, UpdateSourceTrigger=PropertyChanged}"
Width="{Binding Path=Height, ElementName=Base, UpdateSourceTrigger=PropertyChanged}"
Fill="Transparent"
Stroke="White"
StrokeThickness="2">
</Rectangle>
</Canvas>
</UserControl>