Questions tagged [weakeventmanager]

22 questions
1
vote
1 answer

emddudley's WeakEventManager's sample

I am trying to adapt Michael Dudley's sample code for my own implementation of a weak event manager: Example implementation of weak events using .NET's WeakEventManager I was wondering where would I put my user code for my own handler? I see…
Kevin
  • 11
  • 3
0
votes
0 answers

PropertyChangedEventManager will call a function but NOT a lambda. Why?

In my C# app (.NET 6) One of my class' constructors hooks up to a PropertyChanged notification of one of the arguments passed in. I did it like this: public ProfileSource(ISystemService sys, Routine routine, Aspect aspect) : base(sys) { …
Joe
  • 5,394
  • 3
  • 23
  • 54
0
votes
0 answers

C# Use Weak Event For FileSystemWatcher.Created Event

I am trying to make a program that watches a folder for file creation events and does some processing on the files. My current implementation works using: FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(); fileSystemWatcher.Created +=…
0
votes
1 answer

Is it possible to implement a WeakEventManager for UIElement.LayoutUpdated?

I have an application that consumes LayoutUpdated-events and need to register them weak. Here is the problem, I got stuck on, during implementation of the WeakEventManager internal class WeakLayoutUpdatedManager : WeakEventManager { [..] …
m e
  • 71
  • 4
0
votes
0 answers

WPF weakly subscribe to the IsEnabledChanged event

Is it possible to weakly subscribe to the UIElement.IsEnabledChanged event? Neither the WeakEventManager WeakEventManager .AddHandler(uie,…
wondra
  • 3,271
  • 3
  • 29
  • 48
0
votes
1 answer

WeakEventManager - event handler is not called

I am not able to reproduce the issue (and project is too big to post it here, plus I am not sure what are related parts to post) and I need ideas of what could go wrong here. I have abstract class with static event public abstract partial class A :…
Sinatr
  • 20,892
  • 15
  • 90
  • 319
0
votes
1 answer

C# Is it possible to use the weak event pattern with a static class?

I have a static class I was using because I didn't like the idea of passing around a gigantic settings file, but then I wished to be able to have instances subscribe to static events on the static class. I was looking into using the…
James Joshua Street
  • 3,259
  • 10
  • 42
  • 80
1
2