Reputation: 81
I am trying to add this method to the grid and place it in a cell in the grid. Im guessing the error is im getting is because I cant convert: private void BarCode()
into the System.Windows.Controls.UIElementCollection
any ideas on how can I get around this?
myGrid.Children.Add(BarCode());
Upvotes: 0
Views: 686
Reputation: 688
You can write your BarCode
function like this
private UIElement BarCode()
{
Image myBarCode = new Image();
myBarCode.Source = new BitmapImage(new Uri("bitmap.png", UriKind.RelativeOrAbsolute));
return myBarCode;
}
Upvotes: 0