These are chat archives for AvaloniaUI/Avalonia

22nd
Dec 2015
Alexey
@flcl42
Dec 22 2015 08:42
i'll think to create mobile app with perspex for indoor location, map of it will include 0.063 km^2 of clickable vector rooms, is it possible to implement it using perspex or it has some opengl view? Is there a way to create a fully customized button with animations like it may be easly done in wpf? Is there any perfomance comparison with native/cordova/titanium apps? Does someone plan to create mobile-oriented controls and services library based on perspex?
Nikita Tsukanov
@kekekeks
Dec 22 2015 08:51
@flcl42
1) You can use DrawingContext for custom rendering, it provides everything needed for 2D graphics
2) Controls are fully customizable with XAML
3) We haven't done performace optimizations yet, but drawing vector graphics should be fine
4) Not in the immediate future, for now we don't even have proper touch event handling infrastructure
Alexey
@flcl42
Dec 22 2015 09:03
ty @kekekeks, (4) may be nice task for me to test possibility of extending the framework. I'll also probably try to contribute into designer error reporting presentability http://puu.sh/m4A97/e21de6903c.png
Nikita Tsukanov
@kekekeks
Dec 22 2015 09:04
Reference Perspex.Desktop in that project
It's a known issue with class libraries
Or just copy binaries to bin/Debug
Alexey
@flcl42
Dec 22 2015 09:20
ty, it works now! almostly
Steven Kirk
@grokys
Dec 22 2015 10:58
@JohanLarsson as @kekekeks said, all our control unit tests use vanilla xunit and we've had not problems.
Johan Larsson
@JohanLarsson
Dec 22 2015 10:59
nice
I'm testing some hairy attached properties for wpf where vanilla is not enough
Also had a nasty bug caused by a dumb in the default style the other day, don't see how that can be tested using vanilla
Why default scheme is file?
WPF loads images from resources by default
Steven Kirk
@grokys
Dec 22 2015 11:05
because XamlTestApplication has a bitmap loaded from filesystem without a path
Nikita Tsukanov
@kekekeks
Dec 22 2015 11:05
We are still in alpha, it's not the time to worry about backward compatibility
Just fix test app
Steven Kirk
@grokys
Dec 22 2015 11:05
haha yeah, i know
sure, i will do that
Nikita Tsukanov
@kekekeks
Dec 22 2015 11:06
BTW, I thought that we've argeed to use res instead of resource
Steven Kirk
@grokys
Dec 22 2015 11:06
yep
but nobody's made the changes yet
Nikita Tsukanov
@kekekeks
Dec 22 2015 11:06
mkay
Steven Kirk
@grokys
Dec 22 2015 11:06
that was just a quick fix for something else i'm working on tbh
i probably should've committed it to a branch
but it doesn't break anything and adds a useful feature, so it's no biggie. we can fix it.
what is the syntax for "file in current directory" in WPF? is there one?
Nikita Tsukanov
@kekekeks
Dec 22 2015 11:08
I don't think so
It's kinda pointless, really
You aren't supposed to load stuff from current directory from UI markup files
Steven Kirk
@grokys
Dec 22 2015 11:11
i'm sure someone will want to do it
Nikita Tsukanov
@kekekeks
Dec 22 2015 11:11
from current directory? not app root directory?
current directory is unreliable thing, you know
Steven Kirk
@grokys
Dec 22 2015 11:12
sorry, i meant app root directory
Nikita Tsukanov
@kekekeks
Dec 22 2015 11:12
We can use some prefix for that, dunno
BTW, define "app root"
It becomes tricky on mobile platforms
Steven Kirk
@grokys
Dec 22 2015 11:13
well, location of the .exe file, actual current directory, who knows. lets leave it for now.
it was just something i was wondering
Nikita Tsukanov
@kekekeks
Dec 22 2015 11:13
And for proper *nix packaging you are supposed to have your data files in a separate directory from executable ones
Steven Kirk
@grokys
Dec 22 2015 11:17
anyway, it's better than before because you can actually load resources now
which is what i needed
danwalmsley
@danwalmsley
Dec 22 2015 12:27
@kekekeks do you know on linux with a mono compiled app
from commmand line
I have to type ./myapp.exe
I want to add the app to path
and then any user to be able to run the command
myapp
without the .exe extension is this possible?
Alexey
@flcl42
Dec 22 2015 12:30
better to write converter which will interpret your %Resources%/x.bmp as what you need
Steven Kirk
@grokys
Dec 22 2015 12:34
@danwalmsley i think the only way is to write a wrapper
you have to use mono ./myapp.exe don't you?
danwalmsley
@danwalmsley
Dec 22 2015 12:35
i can type ./myapp.exe and it invokes mono
but I can type ./myapp
I think the wrapper idea is good though
Steven Kirk
@grokys
Dec 22 2015 12:36
oh, i didn't know even that was possible on mono
Alexey
@flcl42
Dec 22 2015 12:38
rename file removing extension
danwalmsley
@danwalmsley
Dec 22 2015 12:38
seems to work @flcl42 thanks
Johan Larsson
@JohanLarsson
Dec 22 2015 13:14
@grokys White looks pretty nice for testing UI
In case you need it some time
Steven Kirk
@grokys
Dec 22 2015 13:15
sorry, not sure what you mean
TestStack.White a layer above UIAutomation
Steven Kirk
@grokys
Dec 22 2015 13:16
we need to support the UI Automation API before we could use it
Johan Larsson
@JohanLarsson
Dec 22 2015 13:17
yeah, pretty low prio probably
unless it is needed for tests
White looks nice, when setting text on a textbox it looks like it simulates all events, keydown keyup for each char etc
Nikita Tsukanov
@kekekeks
Dec 22 2015 13:19
@danwalmsley You need to do proper packaging to do that
danwalmsley
@danwalmsley
Dec 22 2015 13:19
@kekekeks do you have a link that can give me any info on how to get started with that?
Steven Kirk
@grokys
Dec 22 2015 13:20
uh oh...
danwalmsley
@danwalmsley
Dec 22 2015 13:20
i suppose you mean like creating a deb package?
@kekekeks thanks
Nikita Tsukanov
@kekekeks
Dec 22 2015 13:21
I'm planning to implement packager in VS extension, but there is so much more important stuff to do (
danwalmsley
@danwalmsley
Dec 22 2015 13:22
ah ok
yeh its only once we get to a release we need that
Nikita Tsukanov
@kekekeks
Dec 22 2015 13:22
BTW, JB guys just provide launcher script for their apps
danwalmsley
@danwalmsley
Dec 22 2015 13:22
I think I will use a script
Nikita Tsukanov
@kekekeks
Dec 22 2015 13:22
It also creates .desktop file in ~/.local/share/applications
danwalmsley
@danwalmsley
Dec 22 2015 13:22
until we are closer to release
Nikita Tsukanov
@kekekeks
Dec 22 2015 13:22
So app gets shown in start menu, etc
danwalmsley
@danwalmsley
Dec 22 2015 13:25
ok nice
Nikita Tsukanov
@kekekeks
Dec 22 2015 13:27
kekekeks@KeksMPC:~/.local/share/applications$ cat jetbrains-clion.desktop 
[Desktop Entry]
Version=1.0
Type=Application
Name=CLion
Icon=/home/keks/local/clion-1.2/bin/clion.svg
Exec="/home/keks/local/clion-1.2/bin/clion.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-clion
Something like that
Proper packaging requires you to put your wrapper script in /usr/bin, binaries to /usr/lib/{packagename}, icon to /usr/share/pixmaps/{packagename.png}, .desktop file to /usr/share/applications/{packagename}.desktop
Something like that
But that's kinda pointless to do now since Mono in Ubuntu repos is outdated
And user still needs to update it
danwalmsley
@danwalmsley
Dec 22 2015 21:50
@kekekeks what is the registry key I need to stop the Designer diagnostic window opening?
@grokys might have found a small bug in the TreeView
really minor..
it seems when I select a sub-item
that the containing scrollviewers horizontal offset sets itself at the location.X of the selected sub item
danwalmsley
@danwalmsley
Dec 22 2015 21:55
so you cant scroll over to the far left again...
see in screenshot here...
ok forget that... im talking shit...
Darnell Williams
@Seeker1437
Dec 22 2015 21:58
:O
Steven Kirk
@grokys
Dec 22 2015 21:58
i have noticed that the scrollbars are sometimes incorrect in the treeview when loading a project in avalon studio
danwalmsley
@danwalmsley
Dec 22 2015 21:59
yeh until you resize
im not sure if its a mistake iv made
but iv created Perspex/Perspex#370 the other day to cover that
Alexey
@flcl42
Dec 22 2015 22:01
Does scrollbar style may be changed?
danwalmsley
@danwalmsley
Dec 22 2015 22:02
not that im aware of
Alexey
@flcl42
Dec 22 2015 22:03
It's separate question
danwalmsley
@danwalmsley
Dec 22 2015 22:04
ah
Steven Kirk
@grokys
Dec 22 2015 22:17
yeah, you can override the template
danwalmsley
@danwalmsley
Dec 22 2015 22:18
on scroll bar we need to implement clicking in the "non" thumb parts for scolling up and down...
Steven Kirk
@grokys
Dec 22 2015 22:18
yeah
i think there's an up-for-grabs issue for that
danwalmsley
@danwalmsley
Dec 22 2015 22:19
if its still there in the new year I will probably tackle that one
other than that should be simple
danwalmsley
@danwalmsley
Dec 22 2015 22:22
ah doesnt look to complex...
danwalmsley
@danwalmsley
Dec 22 2015 23:03
@grokys can I have an image repeat itself horizontally?
like an imagebrush or something?
Steven Kirk
@grokys
Dec 22 2015 23:04
yeah, just use an ImageBrush
danwalmsley
@danwalmsley
Dec 22 2015 23:04
thanks
if I implement context menu.. I should be able to use a lot from Menu and MenuItem?
Steven Kirk
@grokys
Dec 22 2015 23:07
yep, it should be really easy i think
rather than adding a ContextMenu property to Control or something though, I'd say use the attached property technique that ToolTip uses
danwalmsley
@danwalmsley
Dec 22 2015 23:09
ok i'll have a look at ToolTip
with my SolutionExplorer im nearly ready for that as you have seen
OmniXaml.XamlLoadException: Error loading XAML: System.ArgumentException: Invalid value for Property 'Source': 'Resources/grip_pattern.png' (System.String)
   at Perspex.PerspexObject.SetValue(PerspexProperty property, Object value, BindingPriority priority)
<ImageBrush Source="Resources/grip_pattern.png" />
Johan Larsson
@JohanLarsson
Dec 22 2015 23:10
Should ToolTips inherit DataContext from parent?
Can be a bit annoying to bind in WPF
danwalmsley
@danwalmsley
Dec 22 2015 23:14
<TextBlock Text="Console"  Margin="10,4,0,0">
        <TextBlock.Background>
          <ImageBrush Source="Resources/grip_pattern.png"/>      
        </TextBlock.Background>        
      </TextBlock>
Steven Kirk
@grokys
Dec 22 2015 23:15
you currently need to use a resource: URL to load resources
danwalmsley
@danwalmsley
Dec 22 2015 23:16
then compile as resource on the image?
or embedded resource?
Steven Kirk
@grokys
Dec 22 2015 23:16
embedded resource, currently
and then use a resource url like resource://application/ControlCatalog.Assets.delicate-arch-896885_640.jpg
so you need to use '.' as a dir separator
danwalmsley
@danwalmsley
Dec 22 2015 23:17
replace application with avalonstudio?
Steven Kirk
@grokys
Dec 22 2015 23:18
no, leave that as application
we need to sort the asset stuff out - the format is going to change
danwalmsley
@danwalmsley
Dec 22 2015 23:18
ok
I tried this
<ImageBrush Source="resource://application/Resources.grip_pattern.png"/>
Darnell Williams
@Seeker1437
Dec 22 2015 23:19
resource://application/AvalonStudio.Resources.grup_pattern.png
danwalmsley
@danwalmsley
Dec 22 2015 23:19
but still complains...
nope that doesnt do it either
Steven Kirk
@grokys
Dec 22 2015 23:20
to find out the name, set a breakpoint somewhere and in the immediate window call:
System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceNames()
danwalmsley
@danwalmsley
Dec 22 2015 23:20
cheers
Steven Kirk
@grokys
Dec 22 2015 23:21
and then put the resource name from that after resource://application/
Darnell Williams
@Seeker1437
Dec 22 2015 23:21
and yeah it is wont be relative from what I read on the source
so it has the be the full path right?
Steven Kirk
@grokys
Dec 22 2015 23:21
currently yeah
we can't use the WPF resources as mono doesn't support them
so we're stuck with embedded resources, which handle paths slightly weirdly
Darnell Williams
@Seeker1437
Dec 22 2015 23:22
Cant we kind fake it out like we did for RxUI?
Steven Kirk
@grokys
Dec 22 2015 23:23
what did we do for rxui?
danwalmsley
@danwalmsley
Dec 22 2015 23:23
hmm iv checked and it matches..
so I think there might be a bug
Darnell Williams
@Seeker1437
Dec 22 2015 23:25
1
what are you using?
and what error is it giving?
Have you tried using a stream instead of directly?
sorry curious is all xD
danwalmsley
@danwalmsley
Dec 22 2015 23:27
well I assume the only supported method is resource at the moment...
Darnell Williams
@Seeker1437
Dec 22 2015 23:27
We dont have GetResourceStream?
danwalmsley
@danwalmsley
Dec 22 2015 23:28
but this is from Xaml
Darnell Williams
@Seeker1437
Dec 22 2015 23:28
Oooh right hmmm
danwalmsley
@danwalmsley
Dec 22 2015 23:28
<TextBlock Text="Console"  Margin="10,4,0,0">
        <TextBlock.Background>
          <ImageBrush Source="res://application/AvalonStudio.Resources.grip_pattern.png"/>
        </TextBlock.Background>        
      </TextBlock>
Darnell Williams
@Seeker1437
Dec 22 2015 23:28
Maybe converter hack?
danwalmsley
@danwalmsley
Dec 22 2015 23:28
its not an important thing.. it was just a bit of polish to make the ui look a bit nicer
Darnell Williams
@Seeker1437
Dec 22 2015 23:32
that would mean its stores in the AvalonStudio.Resources namespace folder
but the other thing it might be doing is seeing .png as another folder?
Steven Kirk
@grokys
Dec 22 2015 23:33
you need to use resource:
it's going to change to res: but we've not done that yet
danwalmsley
@danwalmsley
Dec 22 2015 23:34
ok... yeh I just changed that to try incase but neither is working for me
repro commit?
im 100% sure the url is correct since it matches the output got of GetResourceNames
its not treating the .png like /png?
here is a commit to repro if you get chance
VitalElement/AvalonStudio@9295716
Steven Kirk
@grokys
Dec 22 2015 23:43
looking now
ah, i see - it's because Image.Source is a Bitmap and ImageBrush.Source is an IBitmap
the converter was only registered for the former
making them both use the same type.
Steven Kirk
@grokys
Dec 22 2015 23:53
ok, there should be a new nuget version once it's gone through CI