On any of the barcde controls the ActualHeight and ActualWidth properties aren't set correctly.
I'm writing a control to layout items on a label (Description, Price, Barcode, etc.) I've got some code that allows the items to be moved, scaled and rotated on the canvas but it requires that the ActualHeight and ActualWidth values be set.
For the XamInterleaved2Of5Barcode and others these values aren't set so the object I create that displays the drag, resize and rotate handles is the wrong size. It's too small and can't be easily picked.
I'm using v11.2 of the toolkit on Silverlight 5
I'm glad you found the problem.
Good luck with your work!
I realised this morning that the problem isn't in the barcode.
I'd forgotten that the barcode is inside a grid and it's the grid's ActualHeight and ActualWidth that aren't set.
Sorry to have misled you.
The `Stretch` value is the default. Here's the code I'm using to define the Barcodes:
<ig:XamInterleaved2Of5Barcode Data="{Binding Sku}" BarsFillMode="FillSpace" MinHeight="50" MinWidth="50"/>
The only other difference is that the barcode is inside a Grid on a Canvas.
The code I'm using sets the Height and Width directly and while I'm resizing the handles fit around the barcode correctly.
Hi Chris,
What is the Stretch value of the barcode you are using?
I have tried to reproduce it with the default settings and the following code and it seem's to me that it works properly.
Here is the xaml and the cs code as i'm using a red rectangle of 300px to see if on changing the size of the image, the size of the barcode is acurate comparing to it.
<Grid x:Name="LayoutRoot" SizeChanged="LayoutRoot_SizeChanged"> <Grid.RowDefinitions> <RowDefinition Height="20" /> <RowDefinition /> </Grid.RowDefinitions> <Rectangle Fill="Red" Width="300" /> <StackPanel Grid.Row="1"> <TextBlock x:Name="BarcodeSize" /> <Barcodes:XamInterleaved2Of5Barcode x:Name="Barcode" Data="123" MouseLeftButtonDown="XamCode128Barcode_MouseLeftButtonDown" /> </StackPanel> </Grid> // the code behind:private void LayoutRoot_SizeChanged(object sender, SizeChangedEventArgs e){ BarcodeSize.Text = "ActualHeight: " + Barcode.ActualHeight + "; ActualWidth: " + Barcode.ActualWidth;}