These are chat archives for AvaloniaUI/Avalonia

11th
Jun 2015
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:29
Hello!
@grokys I've solved the problem of extensions not working inside templates, but now I discovered a new issue
since the XamlDataTemplate doesn't currently have a TargetType, I chose to "match" when the data is not a Control
but it doesn't work under my scenario
(a new one)
it's a ListBox with bound to a list of People
    <ListBox Items="{Binding Path=People}">
        <ListBox.DataTemplates>
            <XamlDataTemplate>
                <Button Content="{Binding Path=Name}" />
            </XamlDataTemplate>
        </ListBox.DataTemplates>
    </ListBox>    
it tries to match a wide variety of data types:
  1. ItemsPresenter
  2. Person
  3. String
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:35
when it tries to match an ItemsPresenter, it doesn't match
when it tries to match the Person, it matches, because Person is not a Control
but it also matches string! (it tries to match the name of the Person)
and in this case, it also matches
and the binding fails, because the datacontext is a string, not a Person
Steven Kirk
@grokys
Jun 11 2015 14:37
sorry, i don't understand again
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:37
it's very difficult to explain :S
but let me try again
Steven Kirk
@grokys
Jun 11 2015 14:38
if you want a data template that matches only Person objects, then its IDataTemplate.Match method should be x => x is Person
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:38
yes
but given that it will be optional, I cannot find a good way to do that
Steven Kirk
@grokys
Jun 11 2015 14:38
ok, so that doesn't match string
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:39
(the DataType)
when you have it, it's trivial
I did the work around check (not is Control)
but string is also tried to be matched
Steven Kirk
@grokys
Jun 11 2015 14:40
i think the main difference is that in WPF you must supply a type
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:41
no, in WPF the DataType is optional
Steven Kirk
@grokys
Jun 11 2015 14:41
not in <Resources> - it's not optional there
which is the WPF equivalent of what you have
Perspex's ItemsControl doesn't have the ItemTemplate property which is the place where you don't need to supply a type
so putting the template in DataTemplates is like putting it in <Resources> in WPF
i may add the ItemTemplate property
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:43

not in <Resources> - it's not optional there

I've tried this scenario and it works. What is mandatory is the x:Key

Steven Kirk
@grokys
Jun 11 2015 14:44
ok, yeah it needs either a key or a type
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:44
<Window x:Class="TestBinding.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:TestBinding"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <DataTemplate x:Key="Template">
            <Button></Button>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <ListBox ItemTemplate="{StaticResource Template}" />
    </Grid>
</Window>
Steven Kirk
@grokys
Jun 11 2015 14:44
yes, in the case of it having a key, it's not automatically matched
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:45
exactly!
Steven Kirk
@grokys
Jun 11 2015 14:45
but you can also not specify a key and specify a type instead
which is the equivalent of what you do in Perspex
in that case it matches everything of that type
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:45
OK!
so the best thing to for for XamlDataTemplates is to make DataType mandatory
at least for now
what do you think?
Steven Kirk
@grokys
Jun 11 2015 14:47
yeah, for now that might be the best
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:47
OK
then, going to implement the x:Type!
Steven Kirk
@grokys
Jun 11 2015 14:47
:) good luck!
José Manuel Nieto
@SuperJMN
Jun 11 2015 14:47
back to work
thanks!!
see you :D
Steven Kirk
@grokys
Jun 11 2015 14:48
np! i need to think about resources etc and reuse from XAML
at the moment it's all code-based so you don't need them
Steven Kirk
@grokys
Jun 11 2015 21:20
menus are getting dangerously close to acting like menus!
mouse, alt, F10 and directional keys working
just need to get accessor keys working
oh, and selection needs to wrap
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:11

menus are getting dangerously close to acting like menus!

Man, why aren't you working for Microsoft!

If they only had you in the WPF team 9 years ago!
Steven Kirk
@grokys
Jun 11 2015 22:15
haha
you're too kind
i don
i was going to say "i don't even know what i'm doing"
but maybe i should say "i can't even type"
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:17
hahaha, you have sense of humor!
but the funny thing is that I also thought about THAT exact sentence today when thinking about myself!
and... this image is the vivid essence and true representation of me:
i-have-no-idea-what-im-doing-dog.jpg
Steven Kirk
@grokys
Jun 11 2015 22:21
hahah yeah that's how i often feel! especially when writing a menu control!
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:21
lol!
Steven Kirk
@grokys
Jun 11 2015 22:22
also i know nothing about internationalization so my access key code will probably be completely wrong
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:23
don't worry about that
it's going to work when it's needed
:D
by the way, look at what I've got working today !
Captura.PNG
Binding extension, Type extension, Templates, Converters, Content Properties
I also fixed several bugs
Steven Kirk
@grokys
Jun 11 2015 22:26
wow excellent!
(well except for the ricky martin part ;) )
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:27
hahaha, it's not Ricky Martin
it's a one-hit wonder from Lou Bega!
Steven Kirk
@grokys
Jun 11 2015 22:28
ohhh ok ;) sorry!
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:28
the played-until-puke Mambo Number 5
Steven Kirk
@grokys
Jun 11 2015 22:28
i'm kinda pleased i didn't know that ;)
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:28
haha, I don't know why, the song came to my mind just before taking the snapshot
Steven Kirk
@grokys
Jun 11 2015 22:29
i know the feeling!
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:29
hahaha
I usually put strings like "Pollo"
Steven Kirk
@grokys
Jun 11 2015 22:30
that's really cool though
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:30
"JMN"
"Grokys", too
sample data in the form of credits and "thanks to" section
haha
but I tend to remove them before taking the picture
when writing test data, specially strings, everything can happen
thank God, there is the Octocat picture there, already
Steven Kirk
@grokys
Jun 11 2015 22:32
good old octocat
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:33
haha
by the way, I'm about to try your progress in the Menus!
wow, they look like the real thing!
I see something wrong, though
Steven Kirk
@grokys
Jun 11 2015 22:37
yeah, i stole the styling from WPF
what's that?
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:37
checkmarks
it seems they render bad
see how they look
Steven Kirk
@grokys
Jun 11 2015 22:37
yeah checkmarks aren't implemented yet
how are you getting checkmarks on menus?
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:38
Sin título.png
well, I don't know if they are checkmarks
Steven Kirk
@grokys
Jun 11 2015 22:39
ohhh you mean the arrows
strange
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:39
yes!
it looks like that
it also happens for me in the CheckBox
the ticks appear badly rendered
Steven Kirk
@grokys
Jun 11 2015 22:39
blob
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:40
O_O
Steven Kirk
@grokys
Jun 11 2015 22:40
oops took a shot of my whole desktop ;)
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:40
definitely, not what I get!
Steven Kirk
@grokys
Jun 11 2015 22:40
i wonder why?...
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:40
I don't know! Let me show you the tick in the CheckBox
that shitty slash is the tick!
Sin título.png
sorry
not the right capture
Captura.PNG
this one
Steven Kirk
@grokys
Jun 11 2015 22:41
you know you can just Alt+PrtScr and then Ctrl+V into gitter right?
but yeah it's a similar thing
and this is from grokys/perspex master with no changes?
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:42

you know you can just Alt+PrtScr and then Ctrl+V into gitter right?

yes!

also yes!
pristine
virginal
untouched!
Steven Kirk
@grokys
Jun 11 2015 22:43
could you run the render tests?
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:43
of course
Steven Kirk
@grokys
Jun 11 2015 22:43
then go to TestFiles\Direct2D1\Shapes\Path
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:47
argh, a lot of tests fail!
running again:
------ Discover test started ------
========== Discover test finished: 342 found (0:00:11,88539) ==========
------ Run test started ------
33 tests fail
309 pass
the rest, don't run!
(although I selected Run All)
Steven Kirk
@grokys
Jun 11 2015 22:50
hmm how odd - i'm using ncrunch for unit tests and they all pass
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:50
Now I'm going to see what's inside the folder you mentioned
Steven Kirk
@grokys
Jun 11 2015 22:50
but when i run them in the VS test runner 12 fail
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:50
:S
Steven Kirk
@grokys
Jun 11 2015 22:50
but yes ignore those
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:50
strange!
Steven Kirk
@grokys
Jun 11 2015 22:50
look in that folder
blob
that's what i get
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:51
oh oh...
I don't get that
asdfa.png
sorry for the delay, the shortcut Control+V doesn't work for me :S
(maybe it doesn't work for IE)
Steven Kirk
@grokys
Jun 11 2015 22:54
so it looks like certain paths aren't drawing correctly on your machine
but only some...
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:54
I can try on another machine
a virtual machine, maybe?
(I have some configured)
Steven Kirk
@grokys
Jun 11 2015 22:55
wherever you can try it would be good
my other machine doesn't have VS2015
José Manuel Nieto
@SuperJMN
Jun 11 2015 22:55
I'm going to try in a W7 machine
no worky!
Steven Kirk
@grokys
Jun 11 2015 23:01
btw over at https://gitter.im/dotnet/corefx they're talking about XAML
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:01
Sin título.png
Steven Kirk
@grokys
Jun 11 2015 23:01
same again, huh?
wonder why it works on mine?...
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:02
The virtual machine doesn't have any VS installed
can you do one thing?
send me your bin folder
built from your machine
when you want
Steven Kirk
@grokys
Jun 11 2015 23:02
sure
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:02
and I will run the TestApplication.exe
are they talking about XAML? argh! they want to eat our lunch?
Steven Kirk
@grokys
Jun 11 2015 23:03
^^ there you go
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:06
thank you!
haha, it doesn't work either!!!
what happens!?
Steven Kirk
@grokys
Jun 11 2015 23:08
same problem?
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:08
yes, exactly the same!
Steven Kirk
@grokys
Jun 11 2015 23:08
ok, so it's a platform difference
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:09
x64 here
Steven Kirk
@grokys
Jun 11 2015 23:09
here too - win8.1 x64
maybe a gfx card thing? who knows...
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:10
maybe. I can try with my wife's PC tomorrow!
Rohan Singh
@Rohansi
Jun 11 2015 23:11
works well for me
Steven Kirk
@grokys
Jun 11 2015 23:11
ah really? ok, so it's bad on 2 computers of jose's but ok on mine and yours...
hey. i bet i know what it is
@Rohansi - is your language set to English?
@SuperJMN - I assume yours is Spanish?
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:12
yes, it is!
Steven Kirk
@grokys
Jun 11 2015 23:12
i bet it's the parsing of the Paths not using the invariant culture
that always gets me
let me try
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:13
I thought about the different culture, but ... how?!
it's not rendering text
maybe the decimal point?
Steven Kirk
@grokys
Jun 11 2015 23:13
yep
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:13
here it's ","
not "."
Steven Kirk
@grokys
Jun 11 2015 23:13
exactly
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:14
is it that?
Steven Kirk
@grokys
Jun 11 2015 23:14
looking now
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:14
OK! I hope you can catch a bug!
Steven Kirk
@grokys
Jun 11 2015 23:15
could you try something for me?
Perspex.SceneGraph\Media\PathMarkupParser, line 228
could you change it to:
return double.Parse(b.ToString(), CultureInfo.InvariantCulture);
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:18
OK!
trying it right now!
FIXED!!!
you got it!
Steven Kirk
@grokys
Jun 11 2015 23:19
:)
ok, i'll commit that change
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:20
you see? having a Spaniard is always nice!
Steven Kirk
@grokys
Jun 11 2015 23:20
haha yeah!
now we need someone from japan, china, india etc to really make my life hard ;)
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:20
hahahaa
no, please!
we (in a previous company) had to localize to use Japanese and Chinese and we almost died
Steven Kirk
@grokys
Jun 11 2015 23:21
i've never had to do it, thankfully
but that ',' problems has hit me a few times
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:21
in the graphic editor I worked, the measures had decimals
Steven Kirk
@grokys
Jun 11 2015 23:21
you crazy europeans with your swapping '.' and ','
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:21
and it was a big hell
yes! the comma is for decimals
and that produces an uncountable number of problems
Steven Kirk
@grokys
Jun 11 2015 23:22
yeah
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:22
but yeah, it's good you fixed a bug :D
I've got to go to bed
Steven Kirk
@grokys
Jun 11 2015 23:23
sure, i should too really!
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:23
see you soon, very nice work by the way! Keep it up!
Steven Kirk
@grokys
Jun 11 2015 23:23
you too! good night
José Manuel Nieto
@SuperJMN
Jun 11 2015 23:23
good night to you, too!!
Rohan Singh
@Rohansi
Jun 11 2015 23:44
is the combobox thing like this for you too
Steven Kirk
@grokys
Jun 11 2015 23:45
yeah - that's a known bug atm
it started happening last week i think and i've not got round to fixing it as the dropdown needs a lot of work generally
a lot of the improvements i'm making to facilitate menu will apply to that control too so i'm trying to finish menus first
what about this one?
when you move the window the menu stays open
Steven Kirk
@grokys
Jun 11 2015 23:57
yep :) know about that one too ;)
i need to detect non-client clicks