tesrt
Topic Author
Posts: 7
Joined: 08 Mar 2020, 15:17

How to connect a slider event

07 Apr 2020, 09:58

How can I connect a slider event in C# to Noesis ?
The code I have bellow
        
        protected override bool ConnectEvent(object source, string eventName, string handlerName)
        {
            if (eventName == "ValueChanged" && handlerName == "Slider_ValueChanged")
            {
                ((Slider)source).ValueChanged += this.Slider_ValueChanged;
                return true;
            }

            return false;
        }
says
No overload for 'Slider_ValueChanged' matches delegate 'RoutedPropertyChangedEventHandler<float>'

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: How to connect a slider event

07 Apr 2020, 14:09

In Noesis our properties use float instead of double compared to WPF.
As you can see in our BlendTutorial sample we define the appropriate type depending on the compilation target, Noesis or Blend:
#if NOESIS
using Noesis;
using Float = System.Single;
#else
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Float = System.Double;
#endif
Then use that define in the function signature:
private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<Float> e)

Who is online

Users browsing this forum: No registered users and 0 guests