"Native type is not registered" when using Value converter
Hi
When I use a value converter inside the Width of a GridColumn i get "InvalidOperationException: Native type is not registered"
and BoolToStarLengthConverter always returns "1*".
When I remove the converter the error does not appear any more.
Am I doing something wrong?
Thanks
Ivan
When I use a value converter inside the Width of a GridColumn i get "InvalidOperationException: Native type is not registered"
Code: Select all
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="ResourceSample" >
<Page.Resources>
<BoolToStarLengthConverter x:Key="BoolToStarLengthConverter" />
</Page.Resources>
<Grid >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="{Binding ElementName=HideColumn, Path=IsChecked, Converter={StaticResource BoolToStarLengthConverter}}"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Background="Blue">Button 1</Button>
<Button Grid.Column="1" Background="Red">Button 1</Button>
</Grid>
<Button Content="Right-click me!" x:Name="Button" VerticalAlignment="Center" HorizontalAlignment="Center" Background="Green">
<Button.ContextMenu>
<ContextMenu>
<MenuItem >
<CheckBox x:Name="HideColumn" IsChecked="True">Hide column</CheckBox>
</MenuItem>
</ContextMenu>
</Button.ContextMenu>
</Button>
</Grid>
</Page>
When I remove the converter the error does not appear any more.
Am I doing something wrong?
Thanks
Ivan
-
-
sfernandez
Site Admin
- Posts: 3203
- Joined:
Re: "Native type is not registered" when using Value convert
Hi,
There is nothing wrong in your side, it is a known bug in our C# API, that doesn't expose the GridLength type correctly. As you can see in our Trello board: https://trello.com/c/mvAxcWoI, this issue is going to be fixed for the following release.
Sorry for the inconvinience.
There is nothing wrong in your side, it is a known bug in our C# API, that doesn't expose the GridLength type correctly. As you can see in our Trello board: https://trello.com/c/mvAxcWoI, this issue is going to be fixed for the following release.
Sorry for the inconvinience.
Who is online
Users browsing this forum: Google [Bot] and 10 guests