« first day (1351 days earlier)      last day (2798 days later) » 

8:13 AM
morning
 
morning
 
 
3 hours later…
11:10 AM
mornign / afternoon
 
11:25 AM
@Maverik @Alex @franssu @Kevin I have solved that yesterday problem
 
nice :)
 
Thanks
 
11:55 AM
Good job, @Learning!
 
12:09 PM
Thank you
 
12:25 PM
'morning!
 
Morning, Lynn
Happy Friday!
 
@Borgleader did you get started with wpf?
 
1:26 PM
quick question, have a look at the following code...
 
awesome @ learning
 
try {
    this.dispatcher.Invoke(() => { var a = 3 / 0; });
catch (...)
that will not get catched?
 
should work I think
 
you have to put try catch inside invoke i think
 
but untested
 
1:29 PM
this.dispatcher.Invoke(() => { try { var a = 3 / 0; } catch (...) });
(is what kevin was saying, I believe)
 
ya
 
I had the same thought
Dunno, though
Is it not catching it right now?
 
confirmed works
I'd expect BeginInvoke to not catch
 
hmm... thats strange
 
@Markus that doesn't compile
> Division by constant zero
 
1:32 PM
it was not all the code...
ahaa :)
ok it was just an example
throw new Exception like Johan said would be the same I guess (except that it compiles)
but you meant @Johan that you do catch the thrown exception?
 
yep
are you expecting an exception in that scope and its not getting caught?
 
mm
well I wasn't expecting it :), but it's there anyway...
and it doesn't seem to get catched.. at least not in VS
nope...
that wasn't it... hold on
anyways... added a try/catch within the invoke and now it works...
strange.. reading the internet etc it should be catched, but it doesn't seem so
 
1:50 PM
is it running in background thread?
 
as I understand it, it is run by the gui thread (control.invoke)
 
2:02 PM
@Markus Are you sure it's not a BeginInvoke in your case?
 
:) fe.Dispatcher.Invoke(action); It's a method call
 
fe?
 
public static void RunInUiThread(this FrameworkElement fe, Action action)
{
    fe.Dispatcher.Invoke(action);
}
 
ahh
 
yep...
 
2:18 PM
@Kevin Duh, FrameworkElement :P
 
@NovitchiS have you modified controltemplates at runtime?
 
@JohanLarsson No, haven't had the chance yet
 
2:36 PM
> the chance
:)
should probably be avoided— always
 
2:50 PM
@JohanLarsson Yes :), unless you know what you're doing.
 
3:03 PM
have a nice week end ;D
3
 
you too! hope you have fun celebrating america's independence from the ugly brits ;)
 
@NovitchiS I don't
but maybe a bit more after fixing all the bugs this will introduce
 
 
1 hour later…
4:19 PM
@JohanLarsson did you see Kendall changed name to Veronica? heh
 
yeah, dunno what is up with that
 
do you guys know how to access grid cell (by row and column) in code behind?
 
yeah
var col = foo.GetValue(Grid.ColumnProperty);
or var col = Grid.GetColumn(foo);
same thing
can be typos as I wrote it in chat
@erotavlas ^
lame to ask in many rooms at the same time imo
shotgun asking
makes me wanna delete what I wrote a bit
@FoggyFinder do you have time for an api review?
 
4:38 PM
sorry, no have
 
but, I wonder what kind of api you are talking?
I can't leave without knowing this :)
 
haha
    <Style TargetType="{x:Type local:FooControl}">
        <Setter Property="PartTemplate">
            <Setter.Value>
                <local:PartControlTemplate>
                    <local:PartControlTemplate.Root>
                        <ControlTemplate TargetType="{x:Type local:FooControl}">
                            <FrameworkElement x:Name="PART_Foo" />
                        </ControlTemplate>
                    </local:PartControlTemplate.Root>

                    <local:PartControlTemplate.FooPart>
@FoggyFinder can you even guess what ^ is supposed to do?
(there is no answer as the code is not written)
 
4:55 PM
1 message moved to Trash can
 
well...I can only guess that this is due to the graphics (because of display ActualWidth), maybe even for the Gu.Wpf.Geometry. However, activity in the repository dismisses my version.
 
@Learning, you understand what is written on this picture (which had just moved)?
@JohanLarsson can I have a hint? :)
 
@FoggyFinder nope
Sorry
I didn't even notice something written on that picture
 
@FoggyFinder I can show you later when I have written it.
But you answered the question, it is not very clear what it does.
Maybe a bit better with better names instead of foo & bar
 
5:02 PM
@FoggyFinder is there something wrong with that picture?
 
no the pic is fine
mav cleans up pics after they fall off screen
you did nothing wrong
 
@Learning no, translate : "If someone hurts you, say"
 
I was little worried
 
or, better, "...,say!"
 
5:34 PM
Happy Friday afternoon!
 
Happy weekends guys
 
You too, @Learning. Glad you got the problem resolved with that question
 
Yeah but 1 guy really helped me alot
I am really very thankful to him and of course everybody
Guys who has highest points on SO
Jon skeet?
 
5:52 PM
He's the Chuck Norris of SO.
 
that is reed I believe
 
366
Q: Jon Skeet Facts

Bill the LizardI'm looking for Chuck Norris Facts style answers. In case anyone is curious, this question was inspired by Jon's own comment to this question. EDIT: If you're into cryptography, you may enjoy these facts. Now with official sanction from the powers that be!

 
Jon Skeet's a demigod
 
Jon skeet
 
 
1 hour later…
7:17 PM
Got an issue that I'm hoping someone can shed some light on. I have two ListViews who's SelectedItem is bound to the same property on the same DataContext. I would think that if you selected an item from the first ListView, then selected a different item in the second ListView, the item in the first ListView would be unselected.
It doesn't seem to work that way, which means, if I reselect the item in the first ListView, it doesn't update the property.
 
8:04 PM
@milleniumbug do you want a binding kata or a small style kata or nothing?
 
sure, binding kata would be nice
I only know basics
 
Johan, I like the katas you've been creating
Nice way to learn
 
good :)
ok let's do a small xaml only then
 
Do an SSRS kata
just kidding
 
@milleniumbug A textblock showing the value of a slider, ask if you want hints.
I have a feeling you don't want hints :)
maybe the black thing is not there if I ctrl +f5
gah, I forgot to collapse the gif, sry
it is annoying to watch
 
8:16 PM
Have something less annoying to watch. Makes me laugh on nearly every iteration.
 
Love that gif... been there, done that
 
One of my all time favs
 
s
c
r
o
l
l
s
c
r
o
l
l
off my low res now :D
 
12 mins ago, by Johan Larsson
user image
 
8:23 PM
<grin>
 
I'll watch some football
 
Mav's going to have a field day cleaning up the transcript. I can almost hear him swearing at me.
 
I can hear his ocd :D
sounds like bach
 
Hahahaha
 
9:00 PM
ok, I think I need to use Content="{Binding something something}" in the Label
autocompletion tells me about multiple types of bindings
 
if you use a label you will bind content that is true
for textblock it would be text
do you want a word to google for or a solution or nothing?
 
yeah not sure what to google without revealing too much
 
^ usually has nice tutorials
maybe that is enough, ping if you want more or solution
I use TextBlock far more often than Label
TextBlock is lightweight compared to label
 
9:19 PM
^ ditto
Why are you ppl still online? It's late friday night! Party! <grin>
Heading out in... 35 or so.
 
@JohanLarsson tried to do Content="{Binding Value, ElementName=mySlider} where the slider has x:Name="mySlider"
but it doesn't seem to work (no content in the label)
 
look right
must be very close
post the full xaml?
@milleniumbug snoop is an essential tool for troubleshooting wpf
 
actually, nevermind
 
@milleniumbug Did you get any binding errors?
 
You can give it a go for finding out the current issue
 
9:33 PM
it seems some XAML designer bullshit got in, so the label wasn't actually displaying
removed it
never actually typed the margins
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="149*"/>
        <RowDefinition Height="160*"/>
    </Grid.RowDefinitions>
    <Slider Grid.Row="0" x:Name="mySlider" Value="4"/>
    <Label Grid.Row="1" VerticalAlignment="Center" Content="{Binding Value, ElementName=mySlider}" />
</Grid>
now it seems to work
 
nice, except from the GridRow heights, what is up with them?
<Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>
</Grid.RowDefinitions>
try changing to ^
Auto means size to content
the last star heighted will fill remaining
that is a useful technique almost always
 
from now on you can ping for katas, don't feel like harassing more
don't hesitate to ping, it is fun
also the last column can be <RowDefinition /> as star is the default
but I prefer to be explicit about it
for symmetry if nothing else
 
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Slider Grid.Row="0" x:Name="mySlider" Value="4"/>
    <TextBlock Grid.Row="1" Text="{Binding Value, ElementName=mySlider}" HorizontalAlignment="Center" />
</Grid>
@JohanLarsson ok this is what I have now
removed the heights I had for no reason whatsoever (I assume clicking on the designer interface added them)
 
I think min & max for slider is 0, 1 default
 
9:44 PM
dunno, the designer says Maximum 10
but that's designer so heh
 
<Slider Grid.Row="0" x:Name="mySlider" Value="4" Minimum="2" Maximum="6" />
maybe it is right, I don't remember
designer was right
10 feels like a strange default
but no biggie
 
yeah, I'd expect either 1 or 100
 
yeah
you format nicely, easy on the eyes
my convention is to always have x:Name as first attribute
 
that's understandable
 
^ is a nice extension for vs
formats on ctrl + k +2
think it formats on save by default but I disabled that
want to know when things happen
it sorts attributes etc
 
9:48 PM
I don't pay much attention to the order now, but I realise having a convention for order of the fields could be beneficial
 
yeah, and it does not take any more time to write them like that
I agree with the stylers convention pretty much
also attribute per line can create nice diffs
 
the agreed upon convention on the project we're working on is we have max. 2 attributes per line
so I group related attributes on one line
e.g. VerticalAlignment and HorizontalAlignment on one line, Grid.Row and Grid.Column on another line
 
yeah
I put layout stuff like Grid.Row early, right after x:Name
I don't use x:Name that often but it is nice when debugging
@milleniumbug use the formatter with default settings and convention will be a non-issue
automate things
for c# I use stylecop for almost all things even if I don't agree with all of it
when using tools keeping things vanilla is good ime
having different settings among the team will create an extremely noisy history
and reviews
 
I usually don't change configuration of my tools much
I can deal with some configuration changes if the default settings are good enough, but some details could be different
but if I need to change half of the configuration before the tool becomes usable, I simply don't use it
and switch to alternative one
 
10:03 PM
it is nice if config gets versioned with the code
R# does it via .dotsettings
and the roslyn stuff too
tha xaml styler does not yet
been meaning to write a pr for it but time
 
Have a good weekend + monday
(July 4th here in the US)
 
and you
I'm gonna wait for bug to ping for katas :D
 
@JohanLarsson ok can I haz kata
 
do you want a big and boring one?
big as in a small app
estimated time to write: ~5 minutes
 
ok good enough
 
10:18 PM
ålrejt firing up vs
@milleniumbug ^ lob app
 
remember that you decide the pace, ask for hint, link to tutorial or I can push the whole thing
@milleniumbug one thing: the thing we are binding to must be in a separate class, name it ViewModel or something
the code behind of the window must be clean, only a ctor with call to InitializeComponent()
estimated lines of C#: 45
time is not good to estimate when learning
gah, forgot the gif again
 
11:07 PM
@JohanLarsson been wondering why do you need the separate class
 
oh it is just how wpf is written
no business logic in code behind is probably a good rule
makes it harder to test and no separation of concerns
@milleniumbug let the view do view stuff and view stuff only
for this simple sample it is not needed of course
just an arbitrary requirement I threw in
might as well get used to the bloat right now :D
 
hehe
 
Think of the class as something you read from a db or something
maybe it makes more sense then
I'm gonna sleep now, nite.
 
good night
 

« first day (1351 days earlier)      last day (2798 days later) »