I'm writing Avatar for the contact list. The design is like this, if I can get the contact's image then I display the image. If not I need to show capital letter of the last name with random color. I know how to display round image
<Button>
<Button.Content>
<Ellipse>
<Ellipse.Fill>
<ImageBrush ImageSource="{Binding Image}"/>
</Ellipse.Fill>
</Ellipse>
</Button.Content>
</Button>
I'm wondering what is the direction to display those without image and I have to display letter of last name and fill the ellipse with random color. My idea is that in the Image's getter write some conditional code to decide what to display. But how to make the image with given letter and random color.