ivan_b
Topic Author
Posts: 87
Joined: 22 Jul 2015, 12:57

Strange DependencyProperty value

26 Jun 2018, 16:19

Hi,

I have created a UserControl to show images when provided an url but the strange thing is that sometimes for the value I get "Noesis::BaseComponent]", and before that I got ".?AVBaseComponent@Core@Noesis@@".
The xaml looks like this
<ItemsControl ItemsSource="{Binding SelectedArticle.PreviewUrl}">
	<ItemsControl.ItemsPanel>
		<ItemsPanelTemplate>
			<StackPanel/>
		</ItemsPanelTemplate>
	</ItemsControl.ItemsPanel>

	<ItemsControl.ItemTemplate>
		<DataTemplate>
			<Grid Margin="0, 6, 0, 6">
				<cv:ImagePreview ImageUrl="{Binding}"/>
			</Grid>
		</DataTemplate>
	</ItemsControl.ItemTemplate>
</ItemsControl>
where SelectedArticle.PreviewUrl is an array of strings.
I have a hack to avoid this but I was curious to see if this is a bug in my code or noesis.
The cv:ImagePreview is my user control to display the image.

The dependency property is defined like this
public static DependencyProperty ImageUrlProperty = DependencyProperty.Register("ImageUrl", typeof(string), typeof(ImagePreview),
	new FrameworkPropertyMetadata("", new PropertyChangedCallback(imageUrlChanged)));
I have an older version of Noesis 2.1.0rc2 but I didn't see something like this fixed in the release notes. But it could also be that I didn't read the release notes thoroughly :)
 
User avatar
sfernandez
Site Admin
Posts: 1973
Joined: 22 Dec 2011, 19:20

Re: Strange DependencyProperty value

27 Jun 2018, 18:50

Hi,

BaseComponent is the class we internally use to box strings in the native side, but that should be automatically converted back to strings when going back to the C# side.
Could you please create a ticket in our bugtracker and attach an example that reproduces the problem? We will take a look and will try to solve it as soon as possible.
 
User avatar
sfernandez
Site Admin
Posts: 1973
Joined: 22 Dec 2011, 19:20

Re: Strange DependencyProperty value

27 Jun 2018, 19:09

I just did a quick test and it seems to be working as expected with the latest version.
I receive objects of type string in the PropertyChangedCallback args, and the property ImageUrl is correctly updated with the corresponding string.

Could you try with the latest 2.1.0f1 version?
 
ivan_b
Topic Author
Posts: 87
Joined: 22 Jul 2015, 12:57

Re: Strange DependencyProperty value

28 Jun 2018, 09:19

I have tried with the new version and the problem is still there.
I will try to create a small project to reproduce the problem and submit it.
 
User avatar
sfernandez
Site Admin
Posts: 1973
Joined: 22 Dec 2011, 19:20

Re: Strange DependencyProperty value

29 Jun 2018, 16:29

I saw the report with the files, thank you.
We will investigate what is happening.

Who is online

Users browsing this forum: No registered users and 8 guests