Wanderer
Topic Author
Posts: 168
Joined: 08 May 2017, 18:36

Slider ValueChanged Args can't be double?

07 Dec 2018, 18:21

I want connect event when slider change value. I have this in C# generated by VisualStudio when I add event in WPF
        private void ValueChanged_MSpeed(object sender, RoutedPropertyChangedEventArgs<double> e)
        {

        }
I create C++ code
bool ConnectEvent(Noesis::BaseComponent* source, const char* event, const char* handler) override
	{
		// ...
		NS_CONNECT_EVENT(Noesis::Slider, ValueChanged, ValueChanged_MSpeed);
		return false;
	}
void grid_UrhoControl::ValueChanged_MSpeed(Noesis::BaseComponent * object, const Noesis::RoutedPropertyChangedEventArgs<double>& args);
But in compile time it throw lot of errors, where is mentioned float. Then I decide change double in to float, and now it compile without error. Why is there used float instead double?
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: Slider ValueChanged Args can't be double?

07 Dec 2018, 20:01

In Noesis all properties are float for performance reasons.
You can see that in FrameworkElement's Width and Height, RangeBase Value, and many others.

So you will need some conditional code there to use the appropriate signature for Noesis and WPF.

Sorry for the inconveniences.
 
Wanderer
Topic Author
Posts: 168
Joined: 08 May 2017, 18:36

Re: Slider ValueChanged Args can't be double?

07 Dec 2018, 20:28

Ok, thanks for explanation. Maybe it should be mentioned in Documentation.

Who is online

Users browsing this forum: Ahrefs [Bot] and 8 guests