I'm starting out on WPF and can't seem to find anything on this method. I'm most likely do not know the proper wording, so asking here.
I have a Button that I have formatted how I needed in XAML. I have it rendered in window properly, except the Image. Since the image will be called every time via code (as buttons will spawn as user needs them), the image was left blank in XAML.
In the Code portion, I'm having issues calling "imgIco" the name of the Image in the XAML Button Template created; "button.imgIco" does not seem to be working. ;)
Thank you in advance and here is the snippets of code interacting with each other.
XAML
<Setter.Value>
<ControlTemplate TargetType ="{x:Type Button}">
<Grid>
<Ellipse Name ="UXbg" Fill ="Transparent" Stroke="White" StrokeThickness="1"/>
<Ellipse Name ="UXbg2" Width="40" Height="40" Fill="White"/>
<Image Name="UXid" Width="32" Height="32">
<Image.Clip>
<EllipseGeometry Center="16,16" RadiusX="16" RadiusY="16"/>
</Image.Clip>
</Image>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property ="IsMouseOver" Value ="True">
<Setter TargetName ="UXbg" Property ="Stroke" Value ="Orange"/>
<Setter TargetName ="UXbg2" Property ="Fill" Value ="Orange"/>
</Trigger>
<Trigger Property ="IsPressed" Value ="True">
<Setter TargetName ="UXbg" Property ="Stroke" Value ="White"/>
<Setter TargetName ="UXbg2" Property ="Fill" Value ="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
C#.cs
ImageBrush iBrush = new ImageBrush();
iBrush.ImageSource = new BitmapImage(new Uri(@"/Resources/32start.png", UriKind.Relative));
aStart.UXid = iBrush;