Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
845
ActualHeight and ActualWidth not set correctly
posted

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

Parents
  • 2406
    posted

    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;
    }

Reply Children