These are chat archives for AvaloniaUI/Avalonia

6th
Jan 2015
José Manuel Nieto
@SuperJMN
Jan 06 2015 13:07
hey guys, I wonder if someone has taken a look to the XAML branch
(in my fork)
specially the reflection part!
Maybe I'm missing something
Steven Kirk
@grokys
Jan 06 2015 15:22
what would you like us to take a look at?
btw, i just remembered that i half-implemented binding for avalonia
as i remember it pretty much works but wasn't debugged and didn't support [indexers]
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:25
I never liked the INotifyPropertyChanges virus
but, what else? :(
Steven Kirk
@grokys
Jan 06 2015 15:26
that's all we have
tbh i can't really see any way it would be improved
what would you prefer?
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:46
:(
I always asked whose criticize it about better ways to detect changes in an object, but I never got a good solution
Steven Kirk
@grokys
Jan 06 2015 15:48
yeah, like i say - i can't really think of a better solution without support from the language
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:48
Some mechanisms include having a copy of the original state of each object
capture the current state
and make diffs!
Steven Kirk
@grokys
Jan 06 2015 15:48
but then you double the memory used
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:48
but dude, what a complex task!
Steven Kirk
@grokys
Jan 06 2015 15:48
which would be unacceptable to a lot of applications
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:49
of course
slow
and heavy
I think some javascript frameworks do that to detect changes
Steven Kirk
@grokys
Jan 06 2015 15:49
yes, in knockoutjs you have Observables
which are nice, but a lot more heavyweight
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:49
change detection is a very interesting topic
Steven Kirk
@grokys
Jan 06 2015 15:50
i honestly believe it requires language support to do it any better
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:50
this is where functional programming starts to look nice
yes, I think so
Steven Kirk
@grokys
Jan 06 2015 15:50
what functional languages do it?
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:51
I we eventually discover there's a better way than INotifyPropertyChanged, we can consider using it
Steven Kirk
@grokys
Jan 06 2015 15:51
yes, but for the moment, everything uses INPC
does the avalonia code help you?
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:52
I don't really know, but I think data flow can be monitorized more easily using functional programming
like x = y + z
Steven Kirk
@grokys
Jan 06 2015 15:53
possibly, i'm not too hot on FP... but as far as i know it's not even used for GUI apps really
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:53
then your are stating the inputs and outputs
I'm totally new to it!
Rohan Singh
@Rohansi
Jan 06 2015 15:54
you mean something like Elm?
Steven Kirk
@grokys
Jan 06 2015 15:54
GUIs rely on mutable state throughout so i'm not sure it'd be a good match
though like i say, i know very little
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:54
anyways, I didn't look to Avalonia in months
Steven Kirk
@grokys
Jan 06 2015 15:54
Elm, is that the thing that compiles to js?
those two links might help
they try to re-implement WPF's binding
(which is why i didn't want to do it in Perspex ;) )
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:55
oh yeah
Rx is the way to do that
Rohan Singh
@Rohansi
Jan 06 2015 15:56
yeah elm compiles to js
and is functional and reactive
Steven Kirk
@grokys
Jan 06 2015 15:56
interesting, i took a cursory look when something was posted about it on hacker news a few months ago
but the general consensus didn't seem very positive
anyway, @SuperJMN - when you're doing binding at runtime, which is what you have to do with a markup format
José Manuel Nieto
@SuperJMN
Jan 06 2015 15:57
I would really like to do someting like <TextBlock Text={Observable SomeObserable} />
Steven Kirk
@grokys
Jan 06 2015 15:57
that's just changing the syntax though
as i say: when you're doing binding at runtime, which is what you have to do with a markup format
you have to basically go back to strings
which means reflection and INPC
if you want to avoid that, you'll have to use something like roslyn IMO
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:00
@grokys "anyway, @SuperJMN - when you're doing binding at runtime, which is what you have to do with a markup format" I don't really understand the question
Steven Kirk
@grokys
Jan 06 2015 16:00
not a question
but what i mean is:
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:00
ahh, OK
sorry
Steven Kirk
@grokys
Jan 06 2015 16:00
markup is text
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:01
yes, the problem is to parse everything and inflate it
Steven Kirk
@grokys
Jan 06 2015 16:01
so you have to convert that text to something meaningful in terms of program state
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:01
yes, that is!
the problem I found with bindings was that you don't have at the moment any way to bind to a ViewModel
Steven Kirk
@grokys
Jan 06 2015 16:01
there are two ways of doing that in .NET: reflection and using a compiler service like roslyn
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:01
I'm working on that
Steven Kirk
@grokys
Jan 06 2015 16:02
at the moment, I can bind quite well to ViewModels!
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:02
(just saying my current state, but by the way, I agree with what you say)
how do you do it?
Steven Kirk
@grokys
Jan 06 2015 16:02
because the code i'm writing isn't using a markup language!
:)
                        new TabItem
                        {
                            Header = "Logical Tree",
                            IsSelected = true,
                            [!TabItem.TagProperty] = this[!RootProperty].Select(x => LogicalTreeNode.Create(x)),
                        },
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:03
the BindTwoWay only takes PerspexObjects and PerspectProperties
Steven Kirk
@grokys
Jan 06 2015 16:03
ah yes, i've not got to two way bindings yet
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:04
:)
this is what I found while dealing with bindings!
I have to overcome that
Steven Kirk
@grokys
Jan 06 2015 16:04
your problem is that you're a very early adopter! :)
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:04
haha
Steven Kirk
@grokys
Jan 06 2015 16:04
(and thank you for that!)
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:04
I usually am!
but I couldn't stand seeing this great project without getting involved
and your kindness
helped a lot
you're easy-going!
sorry, I have never used that term
Steven Kirk
@grokys
Jan 06 2015 16:05
haha
tranquillo
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:06
"easy-going" but I think it's OK!
does it fit?
haha, vale, gracias!
Steven Kirk
@grokys
Jan 06 2015 16:06
yeah, i think so!
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:06
haha
anyways, I'm going directly to my VS
I've got some tests waiting for me!
Steven Kirk
@grokys
Jan 06 2015 16:07
ok! good luck - hope the avalonia stuff might be able to at least point you in the right direction
if there's something you want me to look at, let me know where
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:08
regarding property paths?
I'm going blind
haha
I'm learning by doing
I try to be able to get a binding an set the path to Prop1.Prop2
Steven Kirk
@grokys
Jan 06 2015 16:09
yes the avalonia code does that
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:09
Not essential, but another challenge!
argh
did you use PropertyPath?
or reimplemented it?
Steven Kirk
@grokys
Jan 06 2015 16:10
reimplemented it
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:10
O_O
how does it work?!
I intend to traverse using reflection
and get a MemberInfo
Steven Kirk
@grokys
Jan 06 2015 16:10
i actually didn't reimplement it using the exact same API
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:10
well, a PropertyInfo
it may well be very buggy!
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:12
oh mum
I see the code
crazy!
haha
you had WPF in your head!
Steven Kirk
@grokys
Jan 06 2015 16:12
haha yes, i've forgotten it all now!
you could probably do it better
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:12
me!?
I can do shittier!
Steven Kirk
@grokys
Jan 06 2015 16:13
and like i say it'll need support for indexers
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:13
but don't worry, it's a challenge
Steven Kirk
@grokys
Jan 06 2015 16:13
which means INotifyCollectionChanged as well!
José Manuel Nieto
@SuperJMN
Jan 06 2015 16:13
I can make some progress
and later, someone can improve!
oh, I see
do we have ItemsSource in Perspex yet?
I love ItemsControls
haha
Steven Kirk
@grokys
Jan 06 2015 16:14
yeah, they're there
quite basic but they're in there
but don't ask me to bring ICollectionView into Perspex!
that was what made me stop working on Avalonia
it's so brain-dead
José Manuel Nieto
@SuperJMN
Jan 06 2015 21:46
ICollectionView sounds like... going deep into Hell!
CollectionViewSources have been useful for me in the past :)
Steven Kirk
@grokys
Jan 06 2015 21:54
no, they're part of the problem. if you ever feel bored one day try reverse-engineering them, and start to question the person who wrote them's sanity!