« first day (776 days earlier)      last day (3373 days later) » 
00:00 - 20:0020:00 - 00:00

00:12
I bet that took some skill
00:26
no idea what happened, pretty sure no one else checked in between my commits
01:12
Is there a good way to see code that is used by xaml? Bindings etc.
I think we have a lot of dead code but scary to delete since it can be used in xaml
Hmmm... None that I can think of
You could set a breakpoint in the getter and run through all your screens
But even thats not 100% if you don't know how to get to all the pages
01:34
You can also just do a global search for the property/command name
That would pick up any bindings
yeah
neither way is super nice
yeah, sorry I can't be of more help
don't be sorry man
I had an insane cleaning session tonight.
Things were copy pasted all over the place. Stackpanels with ~10 buttons with ten attributes set to the same value but not using a style.
Almost 100% misuse of layout panels.
possible that I purged > 1k lines of duplicate xaml
still just a drop in the ocean
possibly much more than 1000 lines (attribute per line)
¨nite
03:02
played with it, looks nice
did not find an untuck command
 
2 hours later…
05:07
Hi.
This seems neat, Johan.
Have not used it, but might give a try when I am to create an MVVM app.
 
3 hours later…
08:24
@Maverik yes, the non PCL does not work for me
good morning everybody
morning
I don't need to use oxyplot mandatory, I'm looking for the best library to plot line graphs on my wpf application
09:08
I've found dynamicdatadisplaybbut there is no documentation
 
2 hours later…
11:29
Morns
Morns
12:13
Snrom
.ereht did uoy tahw ees I
Are people really using the term Phablets ?
VS 2015 is free to download, right ?
I thought it was a fablet.
12:30
Now I'm in doubt, it is Phone or Fone ?
12:47
Phone.
So Phablet
Phablet seem like someone with a really bad speech impediment saying tablet
13:00
ahahah Andrè
huh, it is phablet. Well screw everything.
 
2 hours later…
14:55
Mornin!
15:06
good moring
15:38
Morning folks
@franssu so, any last minute tip?
If banging your head against the wall was proportional to the difficulty of solving a problem in WPF, I would have knocked down a few buildings by now.
Anyone up for an MVVM question? Well I'm asking anyways...
Is it an acceptable pattern to have events in your VM, even though that means event handlers in your view's code-behind or is there another mechanism?
Do you have your VM in your codebehind?
I have a reference to it. The DataContext is set to the VM.
are you going this week end markus ?
15:51
yup
@Markus, was that your answer?
cool
sorry branden, I have no good answer.
oh so you want to connect a button event for example to the VM?
15:55
no
other way around
Let's say someone's connection to a third party service is lost. I was thinking the best way to handle that would be with an event from the VM that the view would handle and perhaps show a messagebox
why don't you just show a messagebox from the VM?
if you want to change something in the view it should be based on properties in the VM
For me, that seems to violate the idea of keeping the view logic in the view.
(at least that's my image of MVVM)
It seems to me that the view should be in charge of how the message is displayed to the user
(brb, breakfast)
Is there a way to store somthing up the heirarchy for use by another element?
Like, I want to say, "hey element, you are presented by X"
then element can say, "i know im presented by X, so I should do this, instead of this"
16:06
back
I see your point Branden. But I'm not sure that that's the best way to go... however what do I know, @Maverik is the guru
@Asheh, I can't say I fully understand your intentions but I have done similar by using the Tag property of the parent control.
Thats what I was thinking
I need to display a different context menu based on the tag
is this possible?
I'm assuming you are trying to keep it all in the xaml?
It would be nice if that was an option
16:09
You might be able to use a Data Trigger
I have a "Structure", which if you right click you can copy/paste. (it can exist without a parent). I have an "Array", which can contain a number of structures
But if Structure is a child of Array, it needs a different context menu
But it depends on the data if it is or not
Data trigger may work - need a value to trigger from though
I would just have your menu contain all possible menu options and set the visibility based on the data (e.g. a boolean set in the tag of a parent)
And then use the BoolToVisibility converter
Yeah that makes sense, its just knowing "am I inside an array, or not"
If you think setting that bit up in the data is better, I can do it that way...
If you're array is a collection of some custom class (model), you might be able to add a flag to that model
Yeah well thats what i thought
but i was hoping I could possibly set a value on the parent
that was inherited
then I could bind to it
but if there isnt then ill go the model way
16:13
@Markus Ya, there seems to be a lot of grey area in the WPF community as to what should be in the view and what should be in the VM
@Asheh if you're having a problem deciding, try to look at it from a readability standpoint.
The main problem for me is that it doesn't make sense that an element in array knows about its parent :D
Anyone got time for a quick question?
So I wanted to derive it directly from the view!
If you were to revisit your code six months from now, would it be easier to tell what you had intended if there was a flag in the model?
In your model, do you have a class that contains this array, and that array contains a child array?
Well the function ill have to create in the model will look pretty horrible
16:16
@MarkW ask away and we'll try to help if we can.
Because the structure (to determine if its an array element) will have tosearch the parent to see if it exists inside its children
@Asheh can you give us a better idea of your model's structure?
I think I'm not putting it together correctly in my head
Errm its pretty complex
Basically...
A Structure contains Fields, and a Field can be of a number of types. This particular type is a pointer to a structure in an array
so, I have a model, with a property that exposes a 2d array. I have a grid on a view whose dimensions match that of the array in the model. is it possible to parameterize the data binding such that it gets a value at a specific index in the models array? something like {binding path=MyModel.My2dArrayProp(0,0).SomeValue
yep
just [] instead of ()
16:19
it doesnt compile :(
Here you go:
15
Q: Binding in WPF to element of array specified by property

itsmattSay I've got some TextBlocks on my UI, something like so: <StackPanel Orientation="Vertical"> <TextBlock Text="{Binding DessertIndex}" /> <TextBlock Text="{Binding Food[2]}" /> <TextBlock Text="{Binding Food[{Binding DessertIndex}]}" /> </StackPanel> and in my code behind I've got ...

I think its the fact that is a 2d array
it chokes on the ,
Text="{Binding Path=PickingModel.GetBinAt[0,0].BinID"}"
is GetBinAt an actual property or a method?
well technically its a method
You cant bind to a method :(
16:21
nope
But you can bind to a multi-dimetional property that can act as a method in it's Get accessor
Branden out of interest, can you bind to a property thats a dictionary?
Is somthing like that possible
@Asheh so your "Field" is of a generic type (either of type object or some other base class)?
Or can arrays only be indexed by integer
@Asheh, yes you can bind to a Dictionary in most cases
{Bind MyProperty['SomeVal'].Val} possible?
16:24
but you'd have to bind to MyDictionary.Values or MyDictionary.Keys for an ItemsSource
maybe...
im tryign to figure out how to parameterize a property
the compiler doesnt like it
@MarkW for normal 1d arrays, you can bind to a single element using MyArray[1]
So I believe for 2d arrays, you can do either MyArray[1,2] or MyArray[1][2]
but MyArray has to be a Property not a Method
@Asheh I believe so
Whaaat, thats crazy cool
But you wouldn't do .Val
I have somthing in my code where that would be really useful
16:26
You'd just do MyDict['Key']
I have this:
    public Bin SpecificBin[0, 0]
    {
        get
        {
            try
            {
                return _Bins[column, row];
            }
            catch (IndexOutOfRangeException e)
            {
                return null;
            }
        }
    }
cant get it to compile :/
ignore the 0's
it was just an attempt
I had [int x, int y]
"FragmentStruct.GetFieldByKeyValue("viewmap", "fragment_character").Reference"
and variations of that
16:27
If i could convert that to a property, it would be amazing
whoa
one sec all. I'm going to build up an example
lol
I suppose it doesnt need to be 2d...
which would probably make it easier
just harder to read from a programmers perspective
I think im getting closer
but the binding still is wonky
so what I have is and array declared in my view model like so
private Bin[,] _Bins = new Bin[3,3];

then in the constructor

_Bins[0, 0] = new Bin();

my view sets it data context to this class in its constructor, and in my ControlTemplate I have

<TextBlock Style="{StaticResource TransparentGeneralTextBlock}" Text="{Binding Path=PickingModel.Bins[0][0].BinID}" Margin="22,17,143,192" Width="69" Height="35" />
it compiles
but I dont see the default text
which I set in the Bin class
never his a breakpoint in Bin.BinID getter
hits*
16:43
btw, @MarkW, while I'm working on an example, it occurred to me that when I have the need to do this, instead of using a 2d array, I use List<List<MyModel>>();
or ObservableCollection<ObservableCollection<MyModel>>
wouldnt I still need two parameters in the property?
which seems to be the breaking factor
Then you'd just bind to MyCollection[1][1]
Im not sure I see the problem
you'd just have public ObservableCollection<ObservableCollection<string>> MyCollection { get; set; }
then in your xaml:
<TextBlock Style="{StaticResource TransparentGeneralTextBlock}" Text="{Binding Path=MyCollection[0][0]}" Margin="22,17,143,192" Width="69" Height="35" />
I dont understand why that would work and mine doesnt
I changd it
to expose the 2d array directly
so
    public Bin[,] Bins
    {
        get { return _Bins; }
        set { _Bins = value; }
    }
I bind to that
and put in [0][0].BinID
which is a member of the Bin type
I also had a mistake
Bin is a member of PickingViewModel, not PickingModel
do you see any binding errors in the output window?
so I removed that first part of the binding
target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String') ArgumentException:'System.ArgumentException: Array was not a one-dimensional array.
<TextBlock Style="{StaticResource TransparentGeneralTextBlock}" Text="{Binding Path=Bins[0][0].BinID}" Margin="22,17,143,192" Width="69" Height="35" />
16:53
If you look at my code, MyCollection is a collection of collections, not a 2d array
@MarkW I have a bit of a confession. What I was calling a 2d array is actually a Jagged array. It's an array defined as MyArray[][], not MyArray[,]
The problem is xaml can bind to MyArray[1][2] but not MyArray[1,2] (miserable oversight on WPF if you ask me)
so it would seem
your route of nested collections does work
at least
the binding does retrieve the value
just having an issue getting it to display correctly
doesnt want to draw via my template
lol, that's a different problem...
lol
agreed
but one I think I can figure out
Thanks for the help though
your welcome
you're*
ug
no... its totally MY welcome... and you cant have it!
17:06
hahaha
@Asheh, I just found this: I created a dictionary and I can bind to a specific value in a dictionary (e.g. Text="{Binding MyDict[ValueOne]}")
The best part about this is that it works but complains about it in the output
When I try it, the binding does work but I get this error: System.Windows.Data Error: 17 : Cannot get 'Item[]' value
Go figure
This did seem to break if I had A dictionary within a dictionary
17:27
Oh nice thanks Branden
I wonder if that works as an observable value then
 
1 hour later…
18:41
anyone know the property on a SCrollViewer to set the scroll bar and its background color?
not the region inside of the scrollviewer
but the bar, and the slider background it has
18:52
not off the top of my head
I think you need to modify the control template for scroll viewer: msdn.microsoft.com/en-us/library/aa970847(v=vs.110).aspx
to use a modified ScrollBar style from the first link
still on this maintenance train Bradley, sorry I haven't started drilling you with questions yet ;)
thats lame
and the example on the website is hosed in my IDE
havent a clue why
So im tryign to use this: codeproject.com/Articles/37366/…
to get rid of that 1998 style scroll bar color scheme... but when I put it in my Application.Resources block in my app.xaml
its very very broken
anyone know why?
19:12
Did you put all the code in your resources?
Because that was a full file
You didn't want all of it
everything except for whats outside of teh Window.Resources node
so from
the first solid color brush down to the line above the close tage for Window.Resources
that sound right
and the error in my IDE is on the second SolidColorBrush
What erorr is it giving you?
sec ill get a link
wtf?
hahaha
when I copy and paste that text
something like 54 of the closing '"'s get replaced with some weird char that looks just like themn
but isnt
and the interpreter just went nuts
find and replace fixed it
19:17
thats good
it was weird though
because when I moused over it said that the SolidColorBrush doesnt support content
but when I took a screenshot to show you, the help text was different
Well thats interesting
saying a strings are terminated with a "
yeah... hence the 'wtf'
thats been driving me nuts about WPF
love everything else
cept for how errors are reported... its almost completely useless
99% of the time when I have an error at compile time, it tells me it cant find a closing tag
when that has yet to be the actual problem
Thats true
Kind of like the end-of-file errors on the C# compiler
yeah somewhat I suppose
19:21
what locale is your computer in?
Im certainly not smart enough to improve on it though, so I probably shouldnt complain
US central with English
Agreed on that
I took grammars/compilers, and I don't want to go anywhere near that again
I did do some NLP work for CDA doc generation from audio dictations
and... I sucked so bad we outsourced the work
the website might not be in the same encoding
lol
″ vs "
thats what was copy and pasted
19:27
right
@BradleyDotNET fun class!
About as fun as assembly
that is also fun!
after the learning curve, i started having fun
Assembly drains fun from everything
but thats just me
way over my head
I know what it is, but I couldnt tell you anything else about the instruction sets and how to use them
its all registers
adding two numbers takes like 6 lines of code
depending on the instruction set
19:33
thank god for OOP
And if you want to do anything like, say, a loop, or printing, its a lot more instructions
No kidding
You have to manage your own parameter stack
Why would you ever want to do that?
that sounds like something you would do to punish someone
I'll take my high-level language thank you
someone bad
like hitler
Or someone who likes goto
Of course, they would get some perverse pleasure out of it, since there is nothing but goto in assembly
Since functions don't exist yet
19:35
lol I cant say much... I used named blocks in Java frequently... although I dont ever reference them. I just use them to make things like Swing init code easier to read. but every compiler ever complains about the unused blocks
so does my boss
No #region in Java?
I dont think so no
hence why I use named blocks
Thats too bad
At least you aren't calling them
lol yeah thats a stupid idea
I like back when VS 2012 came out and there was the achievements plugin
one of them was the Go To Hell achievement
for using a goto statement
lol, thats pretty good
This guy would have gotten it: stackoverflow.com/questions/27279132/…
19:39
hahaha public int lol, b, haslo; AND goto's
definitely would have earned that achievement
That would have earned the "F" achievement if I was ever grading that code :)
best part is... his switch has no breaks
who needs them eh?
or default cases
Yeah, break is for chumps ;)
goto is much better
That guy's teacher should be fired
lol I'm not a great programmer by any means... but some of the code I see on SO for things like android apps and whatnot... make me cry
or whatever book/blog he is learning from destroyed
A lot of the code on SO makes me cry :(
Actually, a lot of the writing on SO makes me cry
Its like no one knows how to use a line-break
alas, they all learn eventually (I hope)
19:46
got a quick question for ya about VS Bradley
sometimes when im editing my xaml, specifically my app.xaml where a number of my styles and templates are, the properties window below the solution explorer will provide me with editors for things like Color or Brush values
othertimes it wont. do you know what the criteria is for the properties window to give me those editors?
I believe your cursor just has to be in the tag root
thats what I thought :/
idk its weird
by "cursor" I mean text cursor of course
why is it weird?
19:49
yeah
because sometimes it does
VS is showing you the properties of the context you are in
like I click on the value for color for some brush
and other times, it doesnt
The only time it won't (when you might think it would) is when you are inside another property
In which case, your context just changed, so it still makes sense to me
_http://wikisend.com/download/580840/Issues.bmp
the wierd part is that I know for certain I could edit those fields in the properties window earlier
just suddenly decided it was too useful of a feature
If you move your cursor outside the string does it work?
19:54
doesnt matter what I click
between the text and the quote
inside fo the text
just before or after
Oh, because you are in the collection
nope
it will do nothing with the SolidColorBrush colors as well
I got nothing then
19:55
works in a design view editor though
lol
Maybe its just because its a resource
I really have no idea
I have to admit, the color editor is really useful
about the only time I use the "Properties" window
00:00 - 20:0020:00 - 00:00

« first day (776 days earlier)      last day (3373 days later) »