Note that there are some explanatory texts on larger screens.

plurals
  1. POEntryPointNotFound when subscribe an event via IObservable
    primarykey
    data
    text
    <p>I tried to make a Drag and drop in a WPF application using Rx and when I tried to Subscrive a EntryPointNotFindException was throwed....can anyone help me with this?</p> <p>WPF Application Code</p> <pre><code>&lt;Window x:Class="RxDragDropPOC.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="300" Width="300"&gt; &lt;Canvas Name="canvas"&gt; &lt;TextBlock Name="textBlock" Text="Test" /&gt; &lt;Image Canvas.Left="0" Canvas.Top="25" Height="100" Name="image" Width="100" Source="C:/Users/guilherme.dias/Desktop/images.jpg" /&gt; &lt;/Canvas&gt; </code></pre> <p></p> <p>C# code</p> <pre><code>public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); var mouseDown = from evt in Observable.FromEvent&lt;MouseButtonEventArgs&gt;(image, "MouseLeftButtonDown") select evt.EventArgs.GetPosition(this); var mouseUp = from evt in Observable.FromEvent&lt;MouseButtonEventArgs&gt;(image, "MouseLeftButtonUp") select evt.EventArgs.GetPosition(this); var mouseMove = from evt in Observable.FromEvent&lt;MouseEventArgs&gt;(image, "MouseMove") select evt.EventArgs.GetPosition(this); var q = from start in mouseDown from pos in mouseMove.StartWith(start).TakeUntil(mouseUp). Let(mm =&gt; mm.Zip(mm.Skip(1), (prev, cur) =&gt; new { X = cur.X - prev.X, Y = cur.Y - prev.Y })) select pos; //THIS IS THE LINE THAT THROWS EntryPointNotFound q.ObserveOnDispatcher().Subscribe(value =&gt; { Canvas.SetLeft(image, Canvas.GetLeft(image) + value.X); Canvas.SetTop(image, Canvas.GetTop(image) + value.Y); }); } } </code></pre> <p>EDIT 1</p> <p>Exception details</p> <pre><code>System.EntryPointNotFoundException was caught Message=Entry point was not found. Source=mscorlib TypeName="" StackTrace: at System.IObservable`1.Subscribe(IObserver`1 observer) at System.ObservableExtensions.Subscribe[TSource](IObservable`1 source, Action`1 onNext, Action`1 onError, Action onCompleted) at System.Linq.Observable.&lt;&gt;c__DisplayClass3dd`2.&lt;Select&gt;b__3db(IObserver`1 observer) at System.Collections.Generic.AnonymousObservable`1.&lt;&gt;c__DisplayClass1.&lt;Subscribe&gt;b__0() at System.Concurrency.CurrentThreadScheduler.EnsureTrampoline(Action action) at System.Collections.Generic.AnonymousObservable`1.Subscribe(IObserver`1 observer) at System.ObservableExtensions.Subscribe[TSource](IObservable`1 source, Action`1 onNext, Action`1 onError, Action onCompleted) at System.Linq.Observable.&lt;&gt;c__DisplayClass3dd`2.&lt;Select&gt;b__3db(IObserver`1 observer) at System.Collections.Generic.AnonymousObservable`1.&lt;&gt;c__DisplayClass1.&lt;Subscribe&gt;b__0() at System.Concurrency.CurrentThreadScheduler.EnsureTrampoline(Action action) at System.Collections.Generic.AnonymousObservable`1.Subscribe(IObserver`1 observer) at System.ObservableExtensions.Subscribe[TSource](IObservable`1 source, Action`1 onNext, Action`1 onError, Action onCompleted) at System.Linq.Observable.&lt;&gt;c__DisplayClass2e5`1.&lt;Merge&gt;b__2de(IObserver`1 observer) at System.Collections.Generic.AnonymousObservable`1.&lt;&gt;c__DisplayClass1.&lt;Subscribe&gt;b__0() at System.Concurrency.CurrentThreadScheduler.EnsureTrampoline(Action action) at System.Collections.Generic.AnonymousObservable`1.Subscribe(IObserver`1 observer) at System.ObservableExtensions.Subscribe[TSource](IObservable`1 source, Action`1 onNext, Action`1 onError, Action onCompleted) at System.Linq.Observable.&lt;&gt;c__DisplayClass27b`1.&lt;ObserveOn&gt;b__274(IObserver`1 observer) at System.Collections.Generic.AnonymousObservable`1.&lt;&gt;c__DisplayClass1.&lt;Subscribe&gt;b__0() at System.Concurrency.CurrentThreadScheduler.EnsureTrampoline(Action action) at System.Collections.Generic.AnonymousObservable`1.Subscribe(IObserver`1 observer) at System.ObservableExtensions.Subscribe[TSource](IObservable`1 source, Action`1 onNext, Action`1 onError, Action onCompleted) at System.ObservableExtensions.Subscribe[TSource](IObservable`1 source, Action`1 onNext) at RxDragDropPOC.MainWindow..ctor() in C:\Semantic Framework\POC\RxDragDropPOC\RxDragDropPOC\MainWindow.xaml.cs:line 46 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload