Binding to Thumb.DragStarted event in Unity + NoesisGUI
Posted: 01 Sep 2018, 04:03
Hey, we are trying to bind to the Thumb.DragStarted event so we can know when the user starts dragging a slider. Here’s our XAML and Code Behind:
XAML:
Code Behind:
This code runs in a pure C# WPF app. But when we run in Unity using NoesisGUI, we get the following error:
However, this then results in the following new error:
XAML:
Code: Select all
<Slider Thumb.DragStarted="Slider_DragStarted" Width="200" VerticalAlignment="Center" Maximum="100" SmallChange="1" LargeChange="10" Value="{Binding SliderValue}" Margin="187.5,13.011,412.5,418.989"/>Code: Select all
private void Slider_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
{
// Debug.Log("Drag started");
}
We are able to avoid this error by changing the Slider_DragStarted method to:The type or namespace name `Controls' does not exist in the namespace` System.Windows'. Are you missing an assembly reference?
Code: Select all
private void Slider_DragStarted(object sender, object e)
{
// Debug.Log("Drag started");
}Do you have any recommendations on what we might be doing wrong here?NoesisException: Assets/UI/PlayerControls.xaml(11): 'KMotionMVVM.PlayerControls' does not contain a definition for 'Slider_DragStarted’