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;
No overload for 'Slider_ValueChanged' matches delegate 'RoutedPropertyChangedEventHandler<float>'
User avatar
Site Admin
Posts: 2615
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:
using Noesis;
using Float = System.Single;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Float = System.Double;
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 1 guest