darthmaule2
Topic Author
Posts: 98
Joined: 23 Oct 2014, 19:54

ConnectEvent not being called in Noesis 2.2.2 / .NET 4.6.1 / Windows x64?

24 Apr 2019, 21:33

I recently noticed my breakpoint in ConnectEvent wasn't getting called, so,
I downloaded the latest tutorials from github and made only 1 change to "Buttons", which was to override ConnectEvent and set a break point when it's called:
namespace Buttons
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.Initialized += OnInitialized;
            this.InitializeComponent();
        }

#if NOESIS
        private void InitializeComponent()
        {
            Noesis.GUI.LoadComponent(this, "MainWindow.xaml");  // My breakpoint here is hit
        }
#endif

        private void OnInitialized(object sender, EventArgs args)
        {
            this.DataContext = new ViewModel();
        }

        protected override bool ConnectEvent(object source, string eventName, string handlerName)
        {
            return base.ConnectEvent(source, eventName, handlerName);  // I set my breakpoint here but it's not hit
        } 
    }
}
... but ConnectEvent is never called (or at least my break point is never hit). Everything else seems to work fine in the example.

This is in Windows x64.

This was working previously, but I'm not sure when.
 
darthmaule2
Topic Author
Posts: 98
Joined: 23 Oct 2014, 19:54

Re: ConnectEvent not being called in Noesis 2.2.2 / .NET 4.6.1 / Windows x64?

25 Apr 2019, 13:55

ok that's not a good example... I added an event to the XAML and now ConnectEvent is getting called. But, it's still not working in my other application... I'll have to come up with a better minimal example :)
 
darthmaule2
Topic Author
Posts: 98
Joined: 23 Oct 2014, 19:54

Re: ConnectEvent not being called in Noesis 2.2.2 / .NET 4.6.1 / Windows x64?

25 Apr 2019, 14:12

Ahh, nevermind. I was not explicitly assigning a SelectionChanged event for my ListView, which I thought was a built-in event. I must have taken that out myself at some point. It's working now.
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: ConnectEvent not being called in Noesis 2.2.2 / .NET 4.6.1 / Windows x64?

25 Apr 2019, 16:45

Sorry for the late answer, I was going to say that ConnectToEvent is only called if there is any event handler specified in the xaml like:
<Button Content="Start" Click="OnStartButtonClicked"/>
Glad you figure it out.

Who is online

Users browsing this forum: No registered users and 2 guests