Render problem with "Grid.ColumnDefinitions" on runtime
See original GitHub issueI 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:
- Created a year ago
- Comments:12 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@paulushub Ok i figured it by sertting MinWidth for CloumnDefination. Thanks for helping
@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 beAppName="WpfApp1"
.