question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Render problem with "Grid.ColumnDefinitions" on runtime

See original GitHub issue

I have using SharpVector library in my project (WPF Core) to showing SVG images and this is the my reference " < PackageReference Include=“SharpVectors.Reloaded” Version=“1.8.1” / > " The problem is happening if i use the svg image in grid with column definations. SVG image is render and showing while desing time with column defination but if i go to debug and runtime, it doesn’t render and show. Everyting works normal without column defination. I put the xaml codes and screenshots below

With Grid.ColumnDefinitions

<Grid>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50*" />
            <RowDefinition Height="350*" />
            <RowDefinition Height="100*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="700*" />
            <ColumnDefinition Width="50*" />
        </Grid.ColumnDefinitions>
        <Button Style="{DynamicResource ResourceKey=TransparentButton}" 
                Grid.Column="0"
                Grid.Row="0"
                Grid.RowSpan="3"
                Background="Transparent" >
            <Image Source="{svgc:SvgImage /CustomControls/images/left-arrow.svg}" Margin="15" RenderTransformOrigin="0.5,0.5"/>
        </Button>
    </Grid>
</Grid>

Without Grid.ColumnDefinitions

<Grid>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50*" />
            <RowDefinition Height="350*" />
            <RowDefinition Height="100*" />
        </Grid.RowDefinitions>
        <Button Style="{DynamicResource ResourceKey=TransparentButton}" 
                Grid.Column="0"
                Grid.Row="0"
                Grid.RowSpan="3"
                Background="Transparent" >
            <Image Source="{svgc:SvgImage /CustomControls/images/left-arrow.svg}" Margin="15" RenderTransformOrigin="0.5,0.5"/>
        </Button>
    </Grid>
</Grid>

Screenshot

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cemalgulbeyazcommented, Oct 27, 2022

@paulushub Ok i figured it by sertting MinWidth for CloumnDefination. Thanks for helping

0reactions
paulushubcommented, Oct 28, 2022

Please try https://github.com/GioviQ/SharpVectors.Wpf.1.8.1.bug

@GioviQ Fix the source Uri. With 1.8.1 there are several improvements and fixes in the support for the Uri to make it work in both design mode and runtime. For the sample given, simply change the Uri to Source="/check-mark.svg" and it will work in both design mode and runtime.

The Uri Source="/WpfApp1;Component/check-mark.svg" is for a resource file in referenced assembly, see Using Pack URIs in Markup. The design mode still tries to make it work, since it scans several possible sources, but it fails in runtime, which does not need all the additional scanning to work if the Uri is valid.

Also, SharpVectors adds support for assembly name with the AppName property, and it this case it will be AppName="WpfApp1".

Read more comments on GitHub >

github_iconTop Results From Across the Web

Buttons custom content is not rendering at runtime
Grid is a container, not a ContentControl. Try to wrap the Grid inside a ContentControl and name the ContentControl with the 'AllGreenIcon' key, ......
Read more >
How to: Manipulate Columns and Rows by Using ...
Learn how to use methods in the ColumnDefinitionCollection and RowDefinitionCollection classes to perform actions like adding, clearing, ...
Read more >
Binding and Updating Column Definitions in ag-Grid
Binding column definitions​​ Binding and updating column definitions in Angular is handled by the ag-grid-angular component Input columnDefs .
Read more >
Humanising Grids In Xamarin.Forms
This has a few problems: We can accidentally use an index not declared in the RowDefinitions/ColumnDefinitions of the grid, creating a rendering ......
Read more >
Using a Grid as the Panel for an ItemsControl
In this blog post I look at how to use a Grid as the ItemsPanel for an ItemsControl, solving a few of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found