« first day (2281 days earlier)      last day (1868 days later) » 

1:25 PM
WpfFarmer.GenerateTumbleweeds(5);
* * * * *
 
1:59 PM
Morning folks!
Discussion: I have class ChildClass that inherits ParentClass. Now a thing happens in in the ParentClass, that I want to handle in the ChildClass. Which of all the options should I go for?
Delegate?
or do I just do a virtual function that I overwrite in the child?
 
The traditional thing would be a virtual function, yeah. It's the normal way to go. You can always call the base class implementation in the derived implementation
and just do whatever you want to do in the child class to handle it before or after the base class implementation runs (whichever is appropriate)
You could also do a delegate-based implementation, but that's easier to get 'wrong'
 
2:16 PM
Agree with Zarenor. I've used virtuals and they're a pretty solid solution for this
 
The thing that happens in the Parent is that a Property is set.
in an implemented setter
there's no way to overwrite the setter from the child?
 
i think we'd need more context
 
Properties can be marked virtual - they're just syntax sugar for argumentless getter methods and single-argument setters.
 
And in that case, would I run the something like base to also call the implementation of in the parent?
 
but I think the whole property has to be overridden at once. It still may be possible to call the base implementation.
 
2:23 PM
better to have an virtual empty function then?
that is called in the setter
 
But if I were writing it? And I needed this flexibility in derived classes? I'd have private virtual methods that are .... exactly
 
Do you need a default impl?
 
private?
 
protected
You can make them take and return the property's type if you need them to do something to the value, is what I was saying
And I always write private, and then remember that private virtual doesn't make sense and is forbidden by the compiler as a result.
 
No it's ok. So what I'm actually trying to do... Both classes is part if a view model. And in the parent class a property is set - indirectly - by the gui. Now I want to call the RaiseCanExecuteChanged in the child class
 
2:32 PM
Interesting there are these questions about classes. Had one in the MVC room earlier
 
I think it's because so much of programming work (nowadays) is writing JS-based web frontend. That mostly comes out event-driven and imperative looking, doesn't it? I wouldn't actually know. I'm all desktop.
 
@Zarenor there are ways to avoid imperative front end work... ;)
 
Hehe. I've managed it so far, is my point. XD
 
@Alex is it interesting because it's so low level?
 
Yeah, and it's all about good practices
 
2:40 PM
@ReedCopsey working east-coast time these days, eh?
 
I mean that's the hard part to learn. Not how to do it in anyway, but how you do it the best way.
And I'm not sure that if I were to do it like a delegate, that I would realize that that way is not as good
 
How to deal with life and challenges...
 
:)
 
foreach(var day in life){
        try{
            day.DoMyBest();
        }
        catch(Exception e){
            life.LearnLesson(e);
        }
        finally{
            life.Rest();
        }
}
Lately, though, I keep hitting the exception block so much
 
for some reason I'm having problem that my compiler or runtime, doesn't hit the finally... instead it has inserted a watch tv too late during the nights
 
2:48 PM
YouTube is my weakness
 
yes
I use my tv as a computer monitor
what do you watch? :)
 
Don't laugh... old TV shows
 
give an example
jeopardy from 92?
 
"Wild Wild West", "Hogan's Heroes", "Are You Being Served?", "Twilight Zone",
 
@LynnCrumbling Living in Maine now :)
 
2:51 PM
But now days also Robin Williams' interviews on David Letterman
Those were amazing
 
Hogan's heroes :) that sounds like a quality show! :)
 
Believe it or not, the writing/acting were impeccable
 
oh sorry I thought is was something with hulk hogan... or is that hoogan maybe?
 
Something entirely different
 
yes I googled it
Anyway.. Glad I have someone to ask to help with those DoMyBest
oh free private repos at github... that's nice!
 
3:07 PM
Ooo! Where in Maine? I've got family out in Bar Harbor.
 
@Zarenor Closer to Portland - but I love Bar Harbor
 
@Markus :)
 
3:40 PM
@ReedCopsey Cool. Well, next time you're in bar harbor, check out the Trailhead Cafe, downtown. They're cousins of mine. I need to make my way back up there. It's a lovely spot for vacationing.
 
4:01 PM
@ReedCopsey Wow! When did you relocate?
 
posted on January 17, 2019 by Olia Gavrysh [MSFT]

Windows Desktop applications are coming to .NET Core. The recently released .NET Core 3.0 Preview 1 version includes WinForms and WPF support. To make .NET Core 3.0 viable for as many of you as possible, we have created a survey to understand the types of desktop applications you want to build with .NET Core. Based on the... Read more

 
 
1 hour later…
5:25 PM
@LynnCrumbling This summer
 
5:38 PM
is event aggregator a good solution for communication between views?
 
yes, it is a recommended pattern
component A raises an event
component B reacts to event
neither component knows about the other
 
erot, if you're using MVVM Light, it comes with an event aggregator built in: Messenger
Very easy to use
 
6:06 PM
maybe I could take a look, but we aren't using any mvvm frameworks
 
6:40 PM
erot, I agree with Alex. It's also fairly straightforward to roll your own aggregator that raises events.
 
maverik linked a lib a while ago that was just a bare bones messenger implemntation
cant find the link tho
 
I removed those b/c they have a lot of dependencies on MVVM light stuff
You can get another event ag lib: github.com/NimaAra/Easy.MessageHub
 
There's also the Mediator design pattern
 
^ good point
BTW, whatever became of @franssu?
 
Last I heard was haskell, risky business, modans
 
6:53 PM
Julien, I searched and couldn't find the lib Mav had linked (at least in the starred items)
 
what lib?
 
12 mins ago, by Julien
maverik linked a lib a while ago that was just a bare bones messenger implemntation
 
ah, did not see the link so dunno what to search for
there is also the option to avoid communication and inject a shared thing
may or may not be a solution
 
 
5 hours later…
11:27 PM
I always like Johan's option :)
arbiter when I can't do that
haven't had much need for an aggregator
 

« first day (2281 days earlier)      last day (1868 days later) »