Not sure why it looks like you are using the Fill
property of a Rectangle
and not showing a ColorCanvas
, but the ColorCanvas.SelectedColor
is a Color not a Brush. So something like this should work(My ColorCanvas has x:Name of colorCanvas).
colorCanvas.SelectedColor = Color.FromArgb(255, 0, 0, 255); //Your Color Value
if you are trying to get the color from a SolidColorBrush
like the Fill Property of a Rectangle(Providing it is a SolidColorBrush), something like this should work.
colorCanvas.SelectedColor = ((SolidColorBrush)rect.Fill).Color;
If neither of these example is what you are asking please clarify your question, add more code that you have tried plus any and all errors that you may be getting.