These are chat archives for AvaloniaUI/Avalonia

26th
Feb 2018
Darren R. Starr
@darrenstarr
Feb 26 2018 11:54 UTC
Is there a chat channel for Win2d?
sorry wrong chat window
Miguel de Icaza
@migueldeicaza
Feb 26 2018 15:12 UTC
Hello team - I am trying to use Avalonia on iOS, but failing at compiling it
It claims that there is no Portable.Xaml.Markup
Mhm - perhaps iOS is not actively maintained?
danwalmsley
@danwalmsley
Feb 26 2018 15:40 UTC
@migueldeicaza I think its been a while since the iOS parts were tried!
Darren R. Starr
@darrenstarr
Feb 26 2018 15:41 UTC
I was asked this morning if I could get my code running on iOS (I'm a really new Avalonia user) and I'll be investing some time there in the near future if I continue down this path.
@migueldeicaza can I ask why the attempt on Avalonia as opposed to Xamarin.Forms? I actually was considering the .Forms path with a 2D library until I saw how responsive @danwalmsley is :)
Miguel de Icaza
@migueldeicaza
Feb 26 2018 15:51 UTC
Because we could write a backend to Xamarin.Forms to use Avalonia
Forms uses the model "Use the native toolkit everywhere", which is different than the Flash/Avalonia model where the pixels are drawn by the framework, so it can look the same everywhere, rather than native on each platform.
Some people want to have "identical look everywhere"
So I was hoping to have a backend to Forms that people could pick if they did not want native controls, but wold rather have consistent UI
Darren R. Starr
@darrenstarr
Feb 26 2018 15:53 UTC
There are so many reasons I can think of why that excites me. :) Of course, I'd be pretty excited if Forms sat directly on Skia (or similar) and behaved more like Qt itself.
Miguel de Icaza
@migueldeicaza
Feb 26 2018 15:54 UTC
Right, that is what some peoplew ant
Darren R. Starr
@darrenstarr
Feb 26 2018 15:54 UTC
Would it be community or something you guys would handle internally? If it were community and there was some commitment (even soft) from your end, I could put some resources on it as well. (P.S. I'm one of the original developers of the Opera Web Browser... wrote things like this many times for MANY platforms over the years).
My main "pet peeve" at the moment is text. It's truly amazing how after 25 years of doing this stuff, it seems the first thing I have to do when I start using a new toolkit is to write a basic font metrics class.
Steven Kirk
@grokys
Feb 26 2018 16:04 UTC
Hmm I haven't tried the iOS backend for a while
@kekekeks any idea what the problem might be?
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:05 UTC
Portable.Markup.Xaml issue is probably related to submodules, we are relying on those quite heavily. Avalonia.iOS project is built on CI, so it should be fine. I'll check if something is wrong with ControlCatalog.iOS
Regarding forms: I've had some success with embedding Avalonia-based controls to Xamarin.Forms app on android
Argh, need to update the build agent: https://i.imgur.com/j6zJrMq.png
It's been a while, indeed
Steven Kirk
@grokys
Feb 26 2018 16:10 UTC
@migueldeicaza be aware that our mobile support is very experimental at the moment. like, at the "oh can we do this? wow yes we can" level
we don't have proper touch support for one thing
Darren R. Starr
@darrenstarr
Feb 26 2018 16:11 UTC
@grokys As in #metoo kind of proper touch? ... sorry... jetlagged... will shoot myself now
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:12 UTC
We are currently translating touch events to mouse events
on the backend level
Avalonia itself doesn't know what touch event is
Proper touch support needs proper investigation of how different platforms handle it
Darren R. Starr
@darrenstarr
Feb 26 2018 16:16 UTC
There's also the major issue of IME. On desktop you can generally pretend with regards to IME (except when dealing with CJK languages), but with touch, it's critical to support IME properly on each platform. We spent like 5000+ hours on that.
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:17 UTC
I think iOS/Android are handling IME with their built-in keyboards
So we are just getting completed symbols
That's the only way to get text input on iOS anyway
Darren R. Starr
@darrenstarr
Feb 26 2018 16:19 UTC
That's promising... if it's that far along :) But when you have to support conditional IME for different control types, it can often be quite challenging. I'm going to have to look for personal curiosity
More of an IME thing than a touch thing I suppose.
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:20 UTC
Conditional IME?
Not sure if we have any control over input methods on iOS
Darren R. Starr
@darrenstarr
Feb 26 2018 16:21 UTC
There are times in different languages where you want to IME to present differently or pass data differently. I haven't done much on iOS, but I had many problems on other platforms over the years... especially Mac
@kekekeks the Qt code base is extremely informative on the topic :)
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:22 UTC
NSTextInputClient protocol on Mac is way more complex than UIKeyInput on iOS, yes
We currently have very basic implementation of it
Darren R. Starr
@darrenstarr
Feb 26 2018 16:23 UTC
I will yield to your experience on this. I have gladly avoided that topic for 10 years :)
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:23 UTC
On Linux we are using GTK's built-in support for input methods, but I'm considering to switch to XIM
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:31 UTC
Why are we still using it anyway?
I'm also getting tons of Portable PDB 'C:\Users\keks\Projects\GitHub\Perspex\src\Avalonia.Remote.Protocol\bin\Debug\netstandard2.0\Avalonia.Remote.Protocol.pdb' can't be converted to mdb. Consider setting the project 'DebugType' property to 'Full'.
Why should we switch from portable PDB? I don't think "full" PDBs are supported by .NET Core
Alexander Köplinger
@akoeplinger
Feb 26 2018 16:38 UTC
:wave:
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:41 UTC
Mkay, build seems to be fixed
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:52 UTC
Nope, not fixed
It's just Visual Studio thinking that it's fixed
It seems that Mac build host complains about Sprache.Parser for some weird reason
Probably because of transitive dependencies and the usage of the old project format
Nikita Tsukanov
@kekekeks
Feb 26 2018 16:58 UTC
@migueldeicaza Any chance of Xamarin.iOS/Mac/Android properly supporting the new project format anytime soon?
It seems that scaling got broken
Steven Kirk
@grokys
Feb 26 2018 17:18 UTC
@kekekeks yeah we're still using sprache to parse selectors
we could either rewrite it without sprache or just copy the files into our project
it's really tiny
Nikita Tsukanov
@kekekeks
Feb 26 2018 17:19 UTC
got it fixed by importing Sprache.props to ControlCatalog.iOS project
seems to be an SDK issue
Steven Kirk
@grokys
Feb 26 2018 17:19 UTC
are we not building iOS on appveyor?
Darren R. Starr
@darrenstarr
Feb 26 2018 17:20 UTC
I've ported Grammatica to .net core and also Pegasus (though it's dependent on the nuget module as well for VS integration)
Nikita Tsukanov
@kekekeks
Feb 26 2018 17:22 UTC
I don't like parsers defined by code in the run-time
they are low-performance in general
And make you depend on additional library
Darren R. Starr
@darrenstarr
Feb 26 2018 17:24 UTC
This s true... I tend to prefer to just hand code a packrat parser. It depends on the complexity of the grammar and the importance of the state and error messaging. I actually wrote a partial C parser (MOF format) in Powershell not long ago
That was an exercise in stupidity as well
The question really is what you're looking for. For example, if you want a full AST that you intend to reduce, sometimes that extra library is useful. But if you're looking for something more simplistic, the C# regex is really nice so long as you make all the Regex's static and precompiled. You can do some lovely tokenizing by using named captures.
Nikita Tsukanov
@kekekeks
Feb 26 2018 17:29 UTC
@grokys @migueldeicaza Fixed iOS build and rendering on iosfix branch
IPopupImpl is still not supported though, so no menus, tooltips and dropdowns unfortunately
Should be relatively easy to implement using UIWindow, but for me iOS stuff always takes tons of time because of build/debug issues
Nikita Tsukanov
@kekekeks
Feb 26 2018 17:51 UTC
We've also haven't updated mobile backends to scenegraph yet, so they are still using immediate mode API
Sameer Dubey
@samdubey
Feb 26 2018 18:47 UTC
Hello Everyone
I want to develop a simple media player which can Playback video using memory stream
Can this is possible using Avalokan UI cross platform?
danwalmsley
@danwalmsley
Feb 26 2018 18:50 UTC
I think @jkoritzinsky might have integrated some kind of media library (I might have remember wrong)
Jeremy Koritzinsky
@jkoritzinsky
Feb 26 2018 18:51 UTC
I've been working on it but I've been stuck for a few months. Though with Beta 1 out ive been able to get it to stop crashing from OOM.
Currently the only configuration that works is an MJPEG stream on any backend or any video stream on only the Direct2d1 backend.
Ive been unable to get the code to correctly copy the bitmap data from the GPU to the CPU (for Skia support).
danwalmsley
@danwalmsley
Feb 26 2018 19:09 UTC
Which repo is it?
Steven Kirk
@grokys
Feb 26 2018 19:12 UTC
i think we talked about renaming DropDown to ComboBox for xaml standard-ness. shall we do that now?
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:12 UTC
Our DropDown isn't really a ComboBox, isn't it?
Steven Kirk
@grokys
Feb 26 2018 19:12 UTC
no, it's not. but neither is UWPs
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:14 UTC
It might be nice to have an actual combobox though
Steven Kirk
@grokys
Feb 26 2018 19:15 UTC
yeah
my original thought was that we'd add it as a separate control, which is why i called what we have DropDown
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:15 UTC
Well, WPF's version of the ComboBox seems to lack the TextBox too
Steven Kirk
@grokys
Feb 26 2018 19:16 UTC
however, given that the xaml standard specifies a ComboBox to be a dropdown, we should probably follow that
much as i dislike it
wpf's combobox is a dropdown by default but you can set IsEditable=true to make it an actual combo box
BAD NAMING MS
also i'd like to have what other frameworks call a DropDownButton but that might make more sense just being called DropDown
ahopper
@ahopper
Feb 26 2018 19:19 UTC
talking of DropDown, I'm struggling converting some wpf combobox code. I bind to a collection of a simple label/value class, I want to display label and bind selectedItem to value, simple in wpf but so far I have failed in avalonia, am I missing something?
Steven Kirk
@grokys
Feb 26 2018 19:21 UTC
what do you have so far @ahopper ?
it should be straightforward like WPF
maybe you're hitting AvaloniaUI/Avalonia#1386 ?
ahopper
@ahopper
Feb 26 2018 19:22 UTC
<DropDown Height="38" Width="42" Margin="6,0,6,0" Items="{Binding Path=rfAgcModes}" SelectedItem="{Binding Path=rfAgcMode, Mode=TwoWay}" HorizontalAlignment="Center" >
<DropDown.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Label}"></TextBlock>
</DataTemplate>
</DropDown.ItemTemplate>
</DropDown>
I don't know how to connect Value to selected item
Steven Kirk
@grokys
Feb 26 2018 19:23 UTC
what is Value?
(btw if you surround your code with 3 backticks it makes it a lot easier to read)
ahopper
@ahopper
Feb 26 2018 19:24 UTC
another field of the items collection
Steven Kirk
@grokys
Feb 26 2018 19:25 UTC
but you're binding SelectedItem to rfAgcMode
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:25 UTC
{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DropDown}}, Path=DataContext.rfArgModes.Value}
Steven Kirk
@grokys
Feb 26 2018 19:25 UTC
should that be rfAgcModes.Value?
@kekekeks we have nice syntax for that now ;) {Binding $parent[DropDown].DataContext.rfArgModes.Value}
but i'm not sure why you'd need to bind to a relative source?
ahopper
@ahopper
Feb 26 2018 19:31 UTC
I want rfAgcMode bound to the Value property of the selected rfAgcModes item ,wpf has SelectedMemberPath and DisplayMemberPath
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:31 UTC
Ouch
How is that even supposed to work if you change frAgcMode from code
Steven Kirk
@grokys
Feb 26 2018 19:32 UTC

I want rfAgcMode bound to the Value property of the selected rfAgcModes item

i don't understand this.

Nikita Tsukanov
@kekekeks
Feb 26 2018 19:32 UTC
How dropdown is supposed to find the matching item?
ahopper
@ahopper
Feb 26 2018 19:33 UTC
This is very normal in wpf and html
Steven Kirk
@grokys
Feb 26 2018 19:33 UTC
could you show your code in WPF?
ahopper
@ahopper
Feb 26 2018 19:33 UTC
"""<ComboBox Height="38" Width="42" Margin="6,0,6,0" Style="{StaticResource ComboBoxFlatStyle}" ItemsSource="{Binding Path=rfAgcModes}" DisplayMemberPath="Label" SelectedValuePath="Value" SelectedValue="{Binding Path=rfAgcMode, Mode=TwoWay}" Background="{StaticResource HelpBrush}" HorizontalAlignment="Center" >
        </ComboBox>"""
sorry wrong quotes
Steven Kirk
@grokys
Feb 26 2018 19:35 UTC
you can edit your messages you know ;)
but yeah, i don't think we can do that
i've never used SelectedValuePath
reading about it now... well i'm rather confused!
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:38 UTC
How ComboBox is supposed to find the item matching the SelectedValue?
Steven Kirk
@grokys
Feb 26 2018 19:38 UTC
i can't see why you'd even do that?
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:38 UTC
Just iterate the whole collection and find the first one?
Wiesław Šoltés
@wieslawsoltes
Feb 26 2018 19:39 UTC
@ahopper Well something like this <DropDown Items="{Binding Tools}" SelectedItem="{Binding Tool}"> selects proper object from DropDown
ahopper
@ahopper
Feb 26 2018 19:40 UTC
I get that but for a large number of cases you want an simple value selected from a text description
Steven Kirk
@grokys
Feb 26 2018 19:41 UTC
i guess we should probably add that?
though i can't really understand its use...
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:42 UTC
Not sure how it will play along with virtualization and collections containing thousands of items
Steven Kirk
@grokys
Feb 26 2018 19:42 UTC
well if WPF and UWP manage to do it, we probably should...
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:42 UTC
We need to investigate how it works in WPF
ahopper
@ahopper
Feb 26 2018 19:42 UTC
I'm happy that I'm not missing something and am happy to work around it.
Steven Kirk
@grokys
Feb 26 2018 19:42 UTC
yeah
yeah @ahopper if you could add an issue
thanks for showing me that, never even knew it existed!
you say there's something similar in html <select>?
ahopper
@ahopper
Feb 26 2018 19:44 UTC
yep select has value and whatever is displayed
Steven Kirk
@grokys
Feb 26 2018 19:44 UTC
right, but that's more of a key/value thing
which i guess this is too, but with binding it makes it feel a bit strange to me
ahopper
@ahopper
Feb 26 2018 19:47 UTC
I agree it becomes less obvious in the super cool templated world and have wondered what is happening behind the scenes in the past.
Is it worth having somewhere to collect wpf transition tricks/tips/issues
Nikita Tsukanov
@kekekeks
Feb 26 2018 19:49 UTC
Feel free to start a wiki page
needs some work, but there's a start there
ahopper
@ahopper
Feb 26 2018 19:52 UTC
Thanks for the help, I'll make some notes as I progress and create a PR is they amount to anything useful.
Steven Kirk
@grokys
Feb 26 2018 19:56 UTC
cool, thanks @ahopper !