« first day (1315 days earlier)      last day (2834 days later) » 
07:00 - 16:0016:00 - 00:00

4:02 PM
Just created my first overloaded ctor for a VM. Whew! It was the only solution to a tricky problem
 
right. I'm going home, bye!
 
i go by the general rule of i usually won't say something in here that i wouldn't say at work. other people go by other rules, so bet it. we're all adults here, sticks and stones may break my bones but reading vulgar language on the internet won't hurt me.
safe travels, byeee
 
public Int64? GTIN
{
    get
    {
        if (this.selectedTradeItems == null)
            return null;

        // <= 0
        if (!this.selectedTradeItems.Any())
            return null;

        var first = this.selectedTradeItems.First();
        // = 1
        if (this.selectedTradeItems.Take(2).Count() == 1)
            return first.GTIN;

        // > 1
        return (this.selectedTradeItems.All(o => o.GTIN == first.GTIN) ? (Int64?)first.GTIN : null);
    }
    set
    {
        if (this.selectedTradeItems == null)
There we go. My "Many-to-One"ish binding.
Returns null if you select multiple items that have different values, else it returns the value.
And setting it allows you to batch change items.
 
Usually, properties shouldn't have so much logic in them. But then the question is, where should that logic go? I've heard that setters/getters should be clean, but then where would you implement this?
 
@Maverik, Your example with Expression has me thinking I could reduce it, so I have less boiler plate.
@Alex Yeah, they're pretty heavy, but I didn't see a better option myself, since I wanted them TwoWay bindable.
 
4:08 PM
@WilliamMariager Yeah, I'm not sure where else you could put that
I've cheated in the past and added code like this to my ctor:
PropertyChanged += (o, e) =>
{
	if (e.PropertyName == nameof(MyProperty))
	{
		// do something that would've gone in the setter
	}
}
But not crazy about it
It's all the same
 
Yeah, doesn't even change location, since the event will be invoked inside the setter.
 
sorry, going in meeting
 
Headed to lunch shortly
 
That's alright Maverik, I think I got this.
 
Kevin - i'll get back to you guys after the meeting
Btw William: try NOT to return null
the modern world tries to use non-null values wherever possible, especially with value types
 
4:16 PM
Yeah, I was thinking TryGet pattern.
 
that or use a flag value
like Int64.MinValue
 
any value that won't fall into your usable values can be used as flag
 
I'll keep that in mind. For GTIN and GLN it's easy, since they're always positive.
 
you can throw exceptions?
 
4:19 PM
What do you mean?
 
if you have invalid input, just throw new InvalidOperationException("You made a boo boo")
 
Yeah, I noticed that already. When adding text in the Int64 field, I get a nice error outline.
 
gone to meeting
 
@Maverik Excellent decision! Congrats @Alex!
 
5:20 PM
What's the simplest way to get things like colors from bindings?
Lets say I have a boolean IsModified, and I want to change the background color based on it.
 
5:34 PM
Williiam, look into Style.Triggers
you want a <DataTrigger>
(still in meeting)
 
the simplest way is to bind against a color
triggers will work but is more code
 
@LynnCrumbling Thanks, Lynn :)
 
Hi again
 
@WilliamMariager You can use a converter. If true, it would return a certain color, a different color if false: wpftutorial.net/ValueConverters.html
 
Yeah, I've used converters so far, but they seem kinda clunky in the long run.
 
5:47 PM
I've used converters for this purpose, though you can also use Triggers, as Maverik said
 
Hiya @Learning
 
And anything named BooleanToYellowWarningColor makes me shake my head.
 
why?
 
@WilliamMariager You could have both backgrounds present (as rectangles or borders or whatever), and just toggle visiblility via bool to visability converter...
There's a lot of approaches...
 
Why not BooleanToColor and have some properties on it so you can pass in the colors?
 
5:48 PM
Because next I'll have BooleanToGreenOKColor and BooleanToRedErrorColor and etc. :P
 
Is anybody here ever in a situations where you have been call by your boss to come on Sunday to provide support to client?
 
if you have one thing that needs one color, you only need one property
not sure what your approach is here
 
Yep, came in on weekend, paid for it, though
Or got comp time
 
@Learning I've done a support call from home on a sunday, but only because they were already in their next working day (it was monday morning)... and that was very few and far between... once every 3-4 years
 
Yeah, not often that weekend work comes up
 
5:50 PM
I've done work on Sundays, because of a customer deadline, but then took off on a day during that week.
 
One job, we'd apply updates on Sundays to our servers in coordination with sys admin
 
But it is really frustrating to work on weekends
 
You do what you have to
And if it becomes really annoying, start submitting resumes
 
I was recently in this situation I.e have to work on sunday
 
If it's once in a while, roll with it. It can improve how your boss sees you when it comes time for promotion, etc.
And it shows you're flexible
But you have to find that line between flexibility and being abused
 
5:54 PM
Yeah right
How much working hours you guys have
 
Overseas, I had 44 hours min per week
Here, it's supposed to be 40 but often goes over. Just because I can't leave the code alone
If you really want to excel, it will be over 40 -- even if you don't report it on the timesheet
 
But actually I have to travel 100 kms from my hometown and get the train so sometimes it is really hard for me to stay late due to train problems
 
Telecommute if that's an option; connect remotely to your machine
 
And due to this complex task I am doing lots of overtime and reaching my home sometimes at 11 -11 30 pm
Sometimes I really feel like life of software developer really suck
 
See the end in the beginning. Are you doing this just for a paycheck? Will it advance your career? What is your goal? Vision? Those are things you need to think about moving forward
Software development isn't easy but it can be rewarding
No matter how bad something is, I know it will end some day. But that doesn't mean I sit idly by and do nothing
 
6:06 PM
I dont get any pay for doing overtime
 
@Learning As far as I've understood, you're an entry level developer. Things will get better, you just have to prove that you're worth it.
 
^ Agree
 
@WilliamMariager yes right
 
Get experience
 
I just hope so
 
6:07 PM
idk, putting in > 12 hour days is not right IMO
 
Learn as much as you can
And, start looking for other work
Like Kevin said, that ain't right
 
i lived that life, pulled all nighters... etc. its not good for your health and i would take those hours back if i could.
 
A stressful job is often the best motivator to submit those resumes
 
@Kevin It's his own decision to pick a 100km commute though.
 
But don't drop a job until you find something else. It's like jumping ship... you gotta have something to jump to
Just my two cents. Ultimately, it's your decision because it's your life
 
6:11 PM
100km isn't too bad. i have a friend that does it. i'm assuming start time is 9AM, not getting home until 1130PM means you're leaving at 10, that's 13 hours of work and 3 hours of commute.
 
thats so silly. if you have unreasonable deadlines, don't meet them
 
No I leave my home at 7
Am
 
i coudln't imagine staying that late
 
I wake up at 6 am daily
 
OK I'm out of meeting
and the Binding appoach makes me sad
i'm gonna go kill some kittens
 
6:13 PM
Poor kittens
What was the question on binding? Can't remember
 
dirtee Mav
 
@Maverik Seems a bit excessive :P
 
goes and butchers a few kittens very very slowly
William, you will use an Enum property to say whats the status
then you will use Triggers to sort colors, it's the right approach for this particular problem
binding to color, is just wrong.. you're making your viewmodel reference a view based library
you've broken basic mvvm
and yes we do that from time to time, but in this case there's no real need to do it
 
hehe. we've had this discussion before
 
Oh
I've got some refactoring to do then
 
6:16 PM
one of the best things about triggers is they can work together
you can create a group of triggers that change colours
and then another group of triggers that could change a different property for the same object based off a different trigger value
and from personal experience, INPC breaks at times in WPF when using it heavily for triggering purposes
 
i'd argue that the reason for binding to color is that it can be significantly less code
maybe it's not pure mvvm, but i don't see any negatives other then non-pure
 
Alex: (and anybody else relatively new to mvvm), if you have to add a using System.Windows.*; to your viewmodel, you've broken mvvm
it can be even less code if we shove it all in code behind
model pocos can be half the size if we get rid of INPC cruft
 
err not really feasible if you are dealing with dynamically generated content
 
the point of patterns is rarely to save on LoC
 
i have trouble agreeing with philosophies that revolve around being pure for purity's sake
 
6:19 PM
more often than not, they have extra overhead at least immediately
nope, this isn't purity sake.. you know from your time here that I've broken mvvm myself for practical reasons
but binding to Color, no that's not a good enough reason for that
 
setting a color in a view model is way easier then writing a handful of triggers to manipulate it
especially when you get into multi triggers
 
but its pure view state
 
sure. and thats purity for purity's sake
 
sigh, well i guess we'll have to agree to disagree
 
I don't agree to that :)
 
6:21 PM
but the important thing is, this discussion is here and people can make their own informed choices
 
agreed
 
Reminded me of an episode of Simpsons... teachers are on strike. Ned is trying to find common ground and says, "Well, I guess we'll have to agree to disagree." Skinner says, "I don't agree to that," followed by Ms. Krabappel, "Neither do I."
 
mm i vaguely recall that
nope, i'm recalling family guy
haven't seen simpsons in forever
 
Same ep. has the one of the best lines of entire series: "Lisa, in this house, we obey the laws of thermodynamics!"
 
best simpsons moment : youtube.com/watch?v=h5yjhF0Bjbo
 
6:34 PM
Good choice
 
 
2 hours later…
8:31 PM
best futurama moment: imgur.com/gallery/uoKqLRm
 
Love that!
Wish they would make another Futurama movie at some point. The show ended well, but would love to see the cast again
 
Coffee Coffee Coffee Coffee Coffee
100: ding
 
"Good news, everyone!"
In the last season, even Dr. Zoidberg found love
 
Ever see "Parasites Lost"?
^ Favorite episode, ever.
 
Yep. Broke my heart
Love "A Leela of Her Own"
"Sting"
 
8:34 PM
Starting with the intro containing CW McCall's "Convoy"....
To the end where Fry still retains a little bit of his Holophonor ability.
 
He did really well in "The Devil's Hands Are Idle Playthings"
 
..."So that's what would've happened if I invented the finglonger..."
laugh
 
"The Problem with Popplers" -- one of funniest half hours of TV ever
Omicron Persei 8 aliens are the coolest. And they seem to have the same issues we have
 
quick, hide these message before franssu bans you for talking about non-WPF! ;)
 
:)
 
8:42 PM
laugh
 
Can't help it. Futurama is in our blood
 
I'm watching the Office these days
 
US or UK?
 
US
is UK better?
I'm a Steve Carell fan
 
They're very different
 
8:44 PM
I like Rainn Wilson
 
Like different types of comedy?
 
If you know British humor, it tends toward that
 
I'll have to give it a try.
 
Believe it or not, big fan of "Are You Being Served?" and "Grace and Favour" (sequel series)
 
user6096770
Hello, anyone mind helping me with this question? stackoverflow.com/questions/37470766/…
 
user6096770
8:54 PM
i just want to 'do code' from two button presses in wpf
 
ChrisF provides a way to distinguish between single and double clicks
I just added a comment to your question on how to start another program from WPF
 
Process.Start
 
user6096770
thanks, really helps
 
user6096770
in fact, i solved it with this :D
 
Whatchu mean @ReedCopsey?
 
user6096770
9:01 PM
 <Button x:Name="button2" MouseDoubleClick="Button2_OnMouseDoubleClick" Content="Button" HorizontalAlignment="Left" Margin="295,229,0,0" VerticalAlignment="Top" Width="75" Click="button2_Click"/>
 
user6096770
private void Button2_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {

        }
 
user6096770
solved
 
user6096770
here's a harder problem im having, i want my window to show up if program ID is focused
 
user6096770
if program x (program ID.byName) exists, show wpf window
 
11:31 PM
Hey people. anyone know how to get all the table names of a database using entity framework?
 
07:00 - 16:0016:00 - 00:00

« first day (1315 days earlier)      last day (2834 days later) »