A WPF rectangle can only have one colour which is defined by the Fill property.
You could write a User Control which consists of three rectangles. e.g.
SpecialRectangle.xaml:
<UserControl x:Class="WpfApplication9.SpecialRectangle"
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"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Fill="Blue"></Rectangle>
<Rectangle Grid.Column="1" Fill="Red"></Rectangle>
<Rectangle Grid.Column="2" Fill="Green"></Rectangle>
</Grid>
</UserControl>
You could then use this on any window like this:
MainWindow.xaml:
<Window x:Class="WpfApplication9.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication9"
Title="MainWindow" Height="400" Width="525">
<Grid>
<local:SpecialRectangle></local:SpecialRectangle>
</Grid>
</Window>