« first day (711 days earlier)      last day (3438 days later) » 

1:00 PM
or use resharper, and when you use the reference, alt-enter and it will create the resource for you
 
Also, it is possible to override the keys by redefining them further down
generally that's a hard to track mistake so just be careful with key names
 
It WORKS
Marvelous
 
coolio :D
 
Scary
 
now that'll be 25 chocolates
 
1:02 PM
Ive just eaten a digestive
As a reward
For you fixing my code
 
eww
i said chocolates!
 
its a chocolate digestive
 
(one of my favs)
 
Oh no just realsied it gets more complicated
Its recursive
 
Hmm?
 
1:03 PM
Its a strange one
So
 
reminds me.. there's also such a thing as HierarchicalDataTemplates meant for recrusive data structures
 
If the type is "struct", it selects "StructFieldTemplate". Right?
But then StructFieldTemplate needs to basically do the same thing, as its parent
 
it selects whatever you told it to
 
Display a list, with fields
 
struct is not a type btw
 
1:05 PM
In my data world it is :)
 
ok!
when you're done with this, shoot the guy who did that
 
Who did what?
 
oh yea.. lets make types with the same names as keywords!
 
Haha, its DataStruct and SchemaStruct :)
(i wrote it)
 
ok then tell us the right names :P
 
1:06 PM
SOrry BOSS :D
 
my statement would still hold if you had named it "struct"
 
@Asheh I have legacy code the reads external data into a dictionary, then in a method pulls the data out of the dictionary with about a hundred different calls with various keys. This code runs on a remote machine that I can't debug on, so all I have is event viewer logs containing the stack trace when a key is not found (because of bad external data). and for political reasons I can't deploy what I need to get line numbers in the stack trace
so finding which line threw the KeyNotFound exception is ugly
 
Line Number for political reasons? thats a first!
 
:D
 
still - you have a stack trace right?
which should tell you which method threw it and how you got there
 
1:08 PM
so I changed each call to be of the form _data[key="key to find"] and put a catch that prints out key, so now I can see which key failed
 
and if you followed the Single Duty approach to functions - it shuoldn't be too hard?
 
all the calls are in one big method (legacy code, not mine)
 
also! have you tried instead using _data.TryGetValue ?
that one will return false if it fails instead of exception
 
and sometimes there are 5 or 6 on a line so even if I could deploy the .tlb's it wouldn't help all that much
 
Maverik. So are we thinking I need HierarchicalDataTemplate then? My DataStructs contain DataFields, which can be of type DataStruct
 
1:09 PM
tlbs ... COM... eww!
Hierarchicals need controls that understand that
i believe that's only TreeView
 
@Maverik the trygetvalue makes the code really unreadable in this case, and I want to do as little with this code as possible
 
I could be wrong.. i haven't explored this topic much
 
I am replacing it soon regardless
 
TreeView is no good hmm
 
yea i imagined @ Treeview
 
1:10 PM
Yes its just TreeView
 
as for dictionary - i'd write a wrapper method and do regex search & replace
 
So, can a DataTemplate bind itself to a value, in its own Item?
i.e:
<ListView ItemsSource="{Binding Fields}" ItemTemplateSelector="{StaticResource TypeSelector}"></ListView>
Data template selector selects:
<DataTemplate x:Key="StructFieldTemplate">
    <Expander></Expander>
</DataTemplate>
And now I need to bind to somthing in that Item
 
DataTemplate selects itself directly? that would be pointless
 
I mean, ItemsSource says that each item is bound to an item in an ObservableCollection
 
so, you'll have empty expanders for number of items that are there in Fields collection
 
1:12 PM
So does DataContext become that item?
 
yes
 
AWESOME
Its great when logic happens
 
:D
its just hard to get your head to work with wpf in start
 
Yes totally
 
but once you start thinking inheritance - most things just fall into place
 
1:21 PM
plus, you have to get your head around MVVM as well
 
Yes
Ive written loads of this application adhered to most MVVM
Apart from this
If this works, it will be epic
 
Have all the bits you've done so far worked?
 
Im close to getting exactly what I need @Sean
Can I bind to properties inside structures?
 
I don't think I understand
 
yes
 
1:23 PM
DataStruct returns a property called Structure
 
Properties
 
Structure has Fields
 
not fields
 
<ListView ItemsSource="{Binding Structure.Fields}" ItemTemplateSelector="{StaticResource TypeSelector}"></ListView>
 
Do you mean a struct as in not a class but a struct?
 
1:23 PM
Structure.Fields
Sorry
 
Oh god wtf
 
DataStruct
 
I missed like 10 messages there
Uberlag
 
lol
 
Yes, as long as it is a property, as Mav says
 
1:25 PM
Then in theory my code should work
 
Stop using C# terms for class names hahaha
 
Sorry
:)
So CLOSE
Oh no, I have a declaration problem
 
@Billdr HAAAAI
 
My DataTemplate needs the selector and the selector needs the data template
 
Hello!
It's Tuesday, right? Happy Tuesday.
 
1:30 PM
Make them both resources and reference them
 
Elo!
 
HAPPY TUESDAY!! WOOO
 
WOOOO
 
How're you doing Billdr?
 
You mean, two external files?
 
1:31 PM
Been crunching for over a week. Feeling it.
 
StructFieldTemplate needs TypeSelector and TypeSelector needs StructFieldTemplate!
 
I just realized I have no versioning exposed to users, so now I've got to rush another feature in. WOOOO
 
What you working on Bildr?
 
A tool that turns one ugly nasty report into another ugly nasty report with the minimum of human intervention.
 
Lovely.
 
1:34 PM
@Asheh Use DynamicResource instead of StaticResource on one of them?
 
So I'm making a tool that will be used 30 minutes a month to make a report that no one will read. I've been working on it for about 8 months.
 
Yeah I thought that too
But
Does ItemTemplateSelector get inherited from parent?
 
No
 
ok
 
ok while this may seem like magic -- inheritance isn't magic
the controls are generally wired internally to inherit their parents commonly used values
 
1:38 PM
I may have this working
And its genius
 
but that isn't a rule - so if it doesn't appear to be inheriting.. its possible that the ControlTemplate doesn't have a TemplateBinding on that property
(something that you can fix yourself by creating a copy of ControlTemplate and adding the TemplateBinding yourself)
 
Hmm ok
 
WHAT THE HELL SKYPE DIE IN A FIRE
 
skype has no issues here?
 
There's something going horribly wrong with my PC
 
1:41 PM
though for some reason my DDG isn't working
but interwebs tells me its up
 
I've got an svchost exe running at 25% CPU almost constantly
 
like that? (i'm like that 24/7)
 
No not quite like that
 
Why does resharper suggest I use "implicitly typed variable declaration"
 
1:55 PM
Because you can and it's less to type
 
Explicit typing is better though
 
var myVariable = new SomeRidiculouslyLongWhoEventheFuckNamedThisStupidGoddamnTypeNameFromHellYourePro‌​bablyGoingToNeedABiggerMonitor();
 
I only use it in C++ 11 for things like std::vector<myType>::iterator itor;
 
That's different
Are they called templates in C++ or generics?
Cos they're called generics in C#
 
templates
 
1:57 PM
List<MyType>
When it says "implicitly typed" it doesn't mean dynamically typed
C# does have dynamics but C# is a staticly-typed language. The type of a variable declared with the var keyword is still resolved at compile-time
 
Its similar to the auto keyword isn't it?
it just determines the type
 
Yeah
(I totally know C++ that well...)
 
auto blah = myList.begin(); //blah becomes whatever type begin returns
 
that is the one warning in R# that I have turned off because I violently disagree with it
 
Yes
 
1:58 PM
a C++ 11 feature
 
It's exactly the same
 
@DreadPiratePeter ah good because I do too
 
I used to
 
Also removing {}
 
And then I started using it
 
1:59 PM
:D
 
Oh I leave {} in where I can
It makes it clearer
 
Yep
 
I hate seeing one-line if statements or loops
 
HATE
Yep
 
but, a quick efficiency trick, say you have a really complex type, like Dictionary<String,List<int>>
 
1:59 PM
Or even two-line statements of the same type
 
you can put in say, foreach (var d in dictvar)
then alt-enter on the var and let it R# change it to the real type
 
@AndréSilva well make sure you're both running the same code
 
Zomg i almost have it working
 
also good for things like WSDL processing where the return type of a method/iterator is not readily apparent
 
Thats really cool Dread
 
2:01 PM
I MISS ZOMG
I miss ZOMG so bad
 
:D
Dread, whats the code cleanup tool like?
I love the cleanup Using
 
That is good
 
This is really hard to debug now
 
Did you turn on binding warnings?
 
So, I am resisting the urge to do something evil and overly clever in the name of convenience
 
2:08 PM
Sean I have it set to Warning
 
That's what I have it set to
Check the output window for binding errors
 
Roger
 
I have a range class and I am resisting the urge to make a decimal type conversion operator so that I can say range = 1.10 instead of range = new Range(1,10)
because that would be so wrong
 
That is a bit clever
That would be a little confusing
 
Its very wrong
Do not do it
you mad man
 
2:10 PM
that's one thing I miss from my Perl days. they have a built in range operator ..
so I could say range = 1..10
 
Can you not overload a different operator?
that is more obvious
1^10
thats like pow actually
 
Yeah don't use that
 
yeah, but not of the operators look right. I would probably do a string conversion operator, range = "1..10"
 
All the operators are there to do specific things
Don't break them
String conversion is probably your best bet
 
Or just stop beng lazy and type
lol
 
2:12 PM
Oooooooh
Buuuuurn
 
I agree with @Sean, other than type conversion operators and indexers I tend not to overload operators if it would change their meaning
@Asheh that won't work anyway as the ^ operator would be applied to the 1 and 10 before the assignment and use the built in operator
 
It WORKKKKKKKKs
It looks shit
But it works
Now I need to do that trick that @Maverik mentioned about lazy loading
 
I bet with Roselyn stuff I could make a .. operator, but that would be a ridiculously over-engineered solution for a non-problem
 
trigger wasn't it?
 
Mav is all about triggers
 
2:18 PM
Do you have any info on how to do it @Maverik
 
Style.Triggers?
 
But I mean, I have an expander, that should only do its magic if its expanded
I want to guess
Set ItemsSource when the IsExpanded is triggered?
 
He gave you code earlier
 
Oh sorry must have missed it ill scroll up
 
Well...
3 hours ago, by Maverik
so leave expander empty by default, but upon IsExapanded True -> Set Content to whatever
 
2:24 PM
Awesome
Yes just found it
 
2:37 PM
So my expander that I have setup a trigger for. Can I target the ListView?
My setter targets one control but my trigger is another
Triggers only seem to be able to act upon themselves, the control they belong inside of
Unless I do a databinding to the IsExpanded property
From the ListView....
this may work!
 
So wooden (or rubber). Much listen. Wow.
 
What?
 
Wooden programmer / rubber ducky
 
Amazing
Lol
 
R# FTW again. just bit the bullet and switched out a UniformGrid for a Grid. Went to the last cell in the grid, added Grid.Row and Grid.Column attributes and R# added all the row and column definitions for me
then told R# to fix all missing row and column attributes in scope and it put in place holder attributes for me and all I had to do was changed the 0s to the real row/column nos. Sweet!
 
2:46 PM
Boom!
 
IT WORKS
So much coolness
 
that should be their slogan - "We even take the pain out of WPF Grids!"
 
Finally getting the hang of this only took me a day
 
#region Typedefs
// This is the equivalent of typedef in C / C++
using int8_t    = SByte;
using int16_t   = Int16;
using int32_t   = Int32;
seeing this in C# project -_-
 
wow, someone is firmly planted in 1986 huh
 
2:49 PM
@DreadPiratePeter Yes. Grids are a pain in the dick
 
I do miss typedefs...
 
No you don't
 
@Asheh ugh
 
pretty sure was a pure C++ firmware dev before this app
 
I have not coded C/C++ since about 1992 and I can't say that I have missed it even once
 
2:51 PM
@DreadPiratePeter Me and sean are barely breath in 1992
 
return m_DoWork();
 
I was working professionally then, and married. I'm old
 
i did C ~ a year ago... its fun :)
 
...until you need classes
 
sure, fun like, rubbing your face with a cheese grater fun
 
2:52 PM
I have a course that uses C++.. It's not that bad, it's just sooooo low-level...
 
I never want to manage memory by hand again
 
Try working on the cryengine
 
rubbing your face with a cheese grater. sounds like fun... not sure how you would like it though :p
@Sean drop it low girl, drop it drop it low girl
 
I might drop it low for you, just ask nice babe
 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDrop the Bass
 
2:54 PM
I remember my first roguelike (in C, 1985 or so). Spending a week and a half on a bug with weird characters on my screen, which turned out to be a '<=' in a for loop instead of a '<', in completely unrelated code in another part of the system
 
I can delete like 1000 lines of code
 
no way I am going back to that bullshit
 
Thanks guys @Sean & @Maverik & @DreadPiratePeter you have been a great help today
 
Any time =]
 
2:56 PM
The resharper is great it actually lets me see what values I can type
which is super useful
 
In XAML?
That is nice. VS isn't great at that
 
Yes
Now I know what I am doing I can refactor all my code
 
Have you tried the ctrl+alt+space for intellisense?
 
aka. delete most of it
 
I don't use it but it's a cool feature
 
2:57 PM
ah yes :)
very useful!
I wish there was a more "plain" control which I could use for ItemsSource
 
ItemsControl?
 
You absolute genius
 
Say that again
 
what control you use, kind of depends on the semantics you need
 
you absolute genius
 
2:58 PM
Mmm
 
I need a list of controls
lol
 
*You are an absolute genius
 
if you need focus and selection, you probably want a list control, dropdown behavior you want a combobox, just display of readonly data, an ItemsControl is usually sufficient
 

« first day (711 days earlier)      last day (3438 days later) »