These are chat archives for AvaloniaUI/Avalonia

1st
Dec 2015
Johan Larsson
@JohanLarsson
Dec 01 2015 01:08
imagine wpf having the same code quality as roslyn
Darnell Williams
@Seeker1437
Dec 01 2015 01:27
C# Repl
@JohanLarsson aka Perspex
hehehe :3
Steven Kirk
@grokys
Dec 01 2015 01:41
more than 2 hours installing vs update so far
Nikita Tsukanov
@kekekeks
Dec 01 2015 07:36
Well, I remember times when VS update was installing for 11 hours
danwalmsley
@danwalmsley
Dec 01 2015 10:38
hi guys,,, managed to install the nuget package into my project again without nuget crashing
just recreated the project again
then added all the files manually!
a few things have changed since I last was playing around
it seems the way the .paml files are located might have changed
since now I get exceptions saying unable to find the View for ??? model
do views have to be in a specific directory?
danwalmsley
@danwalmsley
Dec 01 2015 11:04
made my paml files copy to output directory ,,, but that didnt work
Nikita Tsukanov
@kekekeks
Dec 01 2015 11:06
paml files should be in the same directory with view itself
They also should be compiled as EmbeddedResource
danwalmsley
@danwalmsley
Dec 01 2015 11:07
@kekekeks thanks mate
seems to get me past the first problem!!!
have you seen this one?
System.InvalidOperationException: Cannot bind to DataContext of object with no parent.
Nikita Tsukanov
@kekekeks
Dec 01 2015 11:07
nope
danwalmsley
@danwalmsley
Dec 01 2015 11:09
cheers @kekekeks
seems like a lot of progress has been made recently... :)
did we improve render loop and memory leeks?
Nikita Tsukanov
@kekekeks
Dec 01 2015 11:13
Well, testapp isn't leaking
danwalmsley
@danwalmsley
Dec 01 2015 11:17
very good... do you know if any work has been done on formatted text/ text editor?
Nikita Tsukanov
@kekekeks
Dec 01 2015 11:18
FormattedText is good as it is
danwalmsley
@danwalmsley
Dec 01 2015 11:18
ok
Nikita Tsukanov
@kekekeks
Dec 01 2015 11:18
Optimizing textbox is another matter
danwalmsley
@danwalmsley
Dec 01 2015 11:18
im just trying to see if any work has been done.. that helps me towards my goal of getting a text editor working
yeh textbox last time I looked renders the entire string, even when parts are not visible
makes opening strings that are a few hundred words long slow to render
Nikita Tsukanov
@kekekeks
Dec 01 2015 11:20
Well, it also needs to get line info for these strings, wrap words, etc
danwalmsley
@danwalmsley
Dec 01 2015 12:21
@kekekeks when you created the custom project type (Perspex Application) for visual studio
can you direct me where to look for documentation on creating my own project type?
Nikita Tsukanov
@kekekeks
Dec 01 2015 12:23
It's not a custom project type
Just a regular WinForms application that doesn't use any winforms
danwalmsley
@danwalmsley
Dec 01 2015 12:23
ah ok
Steven Kirk
@grokys
Dec 01 2015 13:27
we should probably use a custom project type
if we did, could we make it use our editor for xaml files?
Nikita Tsukanov
@kekekeks
Dec 01 2015 13:28
No idea
And that will break embedding
Steven Kirk
@grokys
Dec 01 2015 13:29
what do you mean?
Nikita Tsukanov
@kekekeks
Dec 01 2015 13:29
Well, people might want to use Perspex in existing apps
To simplify porting process, split xplat and platform-specific parts, etc
Steven Kirk
@grokys
Dec 01 2015 13:30
that would be an exception rather than the rule i'd imagine
Nikita Tsukanov
@kekekeks
Dec 01 2015 13:30
That can be easily done since WPF already support embedding native windows, so we only need a toplevel aware of that
Eto.Forms support embedding, you know
Steven Kirk
@grokys
Dec 01 2015 13:31
yeah, we should support embedding native windows
Nikita Tsukanov
@kekekeks
Dec 01 2015 13:31
What's wrong with current file extension?
Steven Kirk
@grokys
Dec 01 2015 13:31
well it's a xaml file
it'd be nice to use the .xaml extension
Nikita Tsukanov
@kekekeks
Dec 01 2015 13:31
It's our xaml dialect
Steven Kirk
@grokys
Dec 01 2015 13:31
at the moment, it's pure xaml afaik
Nikita Tsukanov
@kekekeks
Dec 01 2015 13:32
If we'll use "xaml" extension it might mess up with VS extensions that expect .xaml files to have WPF controls
Steven Kirk
@grokys
Dec 01 2015 13:32
what extension does xamarin forms use?
Nikita Tsukanov
@kekekeks
Dec 01 2015 13:32
They use XAML, but they don't target desktop
Steven Kirk
@grokys
Dec 01 2015 13:33
i think that xaml is used in lots of non-wpf scenarios, i don't think it would be a problem
its for UWP :(
Nikita Tsukanov
@kekekeks
Dec 01 2015 13:49
Port it!
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 14:09
@grokys Would be this kind ox Xaml possible to use in Perspex:
<Button x:Name="button1">
    <Interactivity:Interaction.Behaviors>
        <Interactions:EventTriggerBehavior EventName="Click" SourceObject="{Binding ElementName=button1}">
            <Interactions:InvokeCommandAction Command="{Binding UpdateCountCommand}"/>
        <;/Interactions:EventTriggerBehavior>
    </Interactivity:Interaction.Behaviors>
</Button>
Steven Kirk
@grokys
Dec 01 2015 14:11
i don't see why not - it appears to just be adding the behavior to an attached property
danwalmsley
@danwalmsley
Dec 01 2015 15:34
guys is the designer working at the moment I just get box full of exceptions...
blob
Nikita Tsukanov
@kekekeks
Dec 01 2015 16:39
Clean everything
every single assembly and object file
from your solution
danwalmsley
@danwalmsley
Dec 01 2015 16:49
still the same
danwalmsley
@danwalmsley
Dec 01 2015 16:51
just installing now
yes it works
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 18:57
@grokys I am playing with https://github.com/Microsoft/XamlBehaviors
I am getting exception Cannot find a property named "Behaviors" in the type Perspex.Controls.Shapes.Ellipse
Steven Kirk
@grokys
Dec 01 2015 19:55
hmm
Nikita Tsukanov
@kekekeks
Dec 01 2015 19:55
@grokys the time has come
the time to write announcement post
I'm preparing a video right now
Steven Kirk
@grokys
Dec 01 2015 19:56
yep, was just about to ask what we need to do for alpha 3
i'll get on to writing the post now
have we updated the VS templates?
Nikita Tsukanov
@kekekeks
Dec 01 2015 19:56
Well, I think we only need to release nuget packages and update VS extension
Steven Kirk
@grokys
Dec 01 2015 19:56
we could do with a UserControl template too
Nikita Tsukanov
@kekekeks
Dec 01 2015 19:57
Yeah, but that can be released with extension update
Steven Kirk
@grokys
Dec 01 2015 19:57
@wieslawsoltes i will take a look at that after the release post if that's ok?
also how about putting behaviors in a separate github project as MS have done?
Nikita Tsukanov
@kekekeks
Dec 01 2015 19:57
We still need that attached property fix from @SuperJMN
Steven Kirk
@grokys
Dec 01 2015 19:58
i'm aware that the perspex solution is getting massive
i think we can release without that, it only affects the root
we have plenty of other bugs, one more doesn't make much difference ;)
maybe i should add a "known bugs" section to the post
Nikita Tsukanov
@kekekeks
Dec 01 2015 19:59
Yep, but this one blocks new designer features
Steven Kirk
@grokys
Dec 01 2015 19:59
ok, we can delay the alpha if you want
i know @SuperJMN has a lot on his hands at the moment though
Nikita Tsukanov
@kekekeks
Dec 01 2015 19:59
If @SuperJMN won't fix it in the near future I'll see what I can do about this bug
Steven Kirk
@grokys
Dec 01 2015 20:00
i might be able tbh
it might not the the correct fix
but i think i know of a way to fix it
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:00
We are using a separate fork anyways
Steven Kirk
@grokys
Dec 01 2015 20:00
yeah
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 20:02

@wieslawsoltes i will take a look at that after the release post if that's ok?

@grokys No problem, this can wait

also how about putting behaviors in a separate github project as MS have done?

I will do that, just wanted to get started quickly and also get some feedback

Steven Kirk
@grokys
Dec 01 2015 20:04
let me try to fix it now
(the designer bug)
btw has anyone else experienced that the designer prevents the app from running?
I always need to kill Perspex.Designer before BindingTests will run if i've opened the xaml
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:06
Designer keeps files opened
That might be the issue
It's getting killed automatically on build events
Steven Kirk
@grokys
Dec 01 2015 20:14
yeah, it doesn't seem to be killed automatically
anyway, could you guys try the omnixaml fix i just committed?
it should fix the issue with Designer.Width etc
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:16
$ git submodule update --recursive
fatal: reference is not a tree: f2673838c0422ff0f6fdb3e4b34a5302971f59b5
Unable to checkout 'f2673838c0422ff0f6fdb3e4b34a5302971f59b5' in submodule path 'src/Markup/Perspex.Markup.Xaml/OmniXAML'
Ꚑõ偠ꚋõÜ+\K%kK%kEeEeK%kK%kSsSsÜ+\Ü+\*PP
Ehm
Steven Kirk
@grokys
Dec 01 2015 20:16
balls forgot to push omnixaml
try now
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:19
Nope, doesn't seem to work
Steven Kirk
@grokys
Dec 01 2015 20:20
hmm, here's what i did:
in BindingTests\MainWindow.xaml add Design.Width="100"
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:21
I might need to clean solution
Steven Kirk
@grokys
Dec 01 2015 20:21
if it still doesn't work, let me know what you're doing
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:24
Yep, seems to be fixed
Steven Kirk
@grokys
Dec 01 2015 20:25
cool! hopefully it didn't break anything else...
are you seeing the issue with the designer preventing BindingTests from running or is it just me?
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:32
It stops before starting
wtf
I want to report a bug. When I clear "double binding" value BindingTests crashes
Steven Kirk
@grokys
Dec 01 2015 20:35
ah really?
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:35
for a brief moment TextBox has empty value
Steven Kirk
@grokys
Dec 01 2015 20:35
press F5
there's a catch around that exception
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:36
oh
Steven Kirk
@grokys
Dec 01 2015 20:36
it's there because Convert sucks
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 20:46
Design.Width and Design.Height work
Steven Kirk
@grokys
Dec 01 2015 20:49
man, there's is so much in this update!
@wieslawsoltes excellent!
ok, this is my list so far of the major updates:
XAML Control Themes
Skia Backend
Initial Support for Android and iOS
ListBox Multi-Select
Binding to Task/Observable
Design-Time Size and DataContext
Improved XAML Binding
Name Scopes
Direct/Readonly PerspexProperties
Dialogs
anything else you guys would like me to add?
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:50
Recent xaml designer/editor changes include:
  • Zoom
  • Background color configuration
  • Attached property support
  • clr-namespace support
  • Markup extension support
  • Design.DataContext, Design.Width, Design.Height
Steven Kirk
@grokys
Dec 01 2015 20:51
ok, i'll make a "designer improvements" section
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:51
DockPanel (done)
RadialGradient (done)
File dialogs (done)
Key bindings and keyboard shortcuts (done)
Read-only/Direct Perspex properties (done)
Task support in PerspexProperty (done)
ListBox multi-selection (done)
Implement control Templates in XAML (done)
WPF-like XAML bindings with MultiBinding, converters and stuff (basic support done)
Undo/Redo in TextBox (at first just store one previous state from seconds ago/before paste/etc) (done)
That's from "The Plan"

Dialogs

I thought that file dialogs were implemented in alpha2

Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 20:52
Yeah Design.DataContext causes troubles
Steven Kirk
@grokys
Dec 01 2015 20:52
oh, ok, i'll remove dialogs
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:52
What troubles exactly?
It won't set DataContext but binding will still be evaluated
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 20:53
when I set Design.DataContext on MainWindow than when app runs the DataContext set in code behind does not work
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:53
wat
blob
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 20:55
well its worse, when I set Design.DataContext on one UserControl embeded in MainWindow than same result
and this is while MainWindow does not have set Design.DataContext
Nikita Tsukanov
@kekekeks
Dec 01 2015 20:59
Can't reproduce that with BindingsTest project
DataContext is being set fine
Something is wrong with designer, it blocks debugging everywhere
wtf
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 21:10
ok so DataContext is set properly, but when is set Design.DataContext command bindings stop working
Command="{Static core:Commands.NewCommand}"
Nikita Tsukanov
@kekekeks
Dec 01 2015 21:11
Can you reproduce this with BindingTest app from samples?
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 21:12
No its related how I initialize my DataContext
When I run my app the Design.DataContext is also set
and I use static commands :(
and initialize them with dummy values for designer
Nikita Tsukanov
@kekekeks
Dec 01 2015 21:14
Are you using 1.0.868?
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 21:18
Yes
Steven Kirk
@grokys
Dec 01 2015 21:18
is the DataContext on those controls set correctly though?
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 21:19
yes
Steven Kirk
@grokys
Dec 01 2015 21:19
wat
i don't understand how the bindings aren't working then
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 21:19
the issue is that Design.DataContext when you run app
Nikita Tsukanov
@kekekeks
Dec 01 2015 21:20
Should be ignored as any other attached property without any backing code
I can't reproduce this issue in sandbox environment
Steven Kirk
@grokys
Dec 01 2015 21:21
it sounds like it might be a very specific bug
shall we push it until after alpha 3?
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 21:21
this is my code Design.DataContext="{Static local:DesignerHelper.DataContext}"
when local:DesignerHelper.DataContext is null and I run my app I get exception
Steven Kirk
@grokys
Dec 01 2015 21:22
could you post the call stack for the exception?
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 21:22
Core2D.Perspex.exe Error: 0 : Error loading XAML: System.NullReferenceException: Odwołanie do obiektu nie zostało ustawione na wystąpienie obiektu.
   w OmniXaml.ObjectAssembler.ValuePipeline.IsAlreadyCompatible(Object value, Type targetType)
   w OmniXaml.ObjectAssembler.ValuePipeline.ConvertValueIfNecessary(Object value, XamlType targetType)
   w OmniXaml.ObjectAssembler.StateCommuter.AssignChildToParentProperty()
   w OmniXaml.ObjectAssembler.StateCommuter.AssociateCurrentInstanceToParent()
   w OmniXaml.ObjectAssembler.Commands.EndObjectCommand.Execute()
   w OmniXaml.ObjectAssembler.ObjectAssembler.Process(XamlInstruction instruction)
   w OmniXaml.TemplateHostingObjectAssembler.Process(XamlInstruction instruction)
   w Perspex.Markup.Xaml.Context.PerspexObjectAssembler.Process(XamlInstruction node)
   w OmniXaml.XamlXmlParser.Parse(IEnumerable`1 xamlNodes)
   w OmniXaml.XamlXmlParser.Parse(IXmlReader stream)
   w OmniXaml.XamlXmlLoader.Load(Stream stream, IXamlParser parser)
   w OmniXaml.XamlXmlLoader.Load(Stream stream, IXamlParser parser)
   w Perspex.Markup.Xaml.PerspexXamlLoader.Load(Type type, Object rootInstance)
   w Perspex.Markup.Xaml.PerspexXamlLoader.Load(Object obj)
   w Core2D.Perspex.Windows.MainWindow.InitializeComponent() w C:\DOWNLOADS\GitHub\Core2D\Core2D.Perspex\Windows\MainWindow.paml.cs:wiersz 35
   w Core2D.Perspex.Windows.MainWindow..ctor() w C:\DOWNLOADS\GitHub\Core2D\Core2D.Perspex\Windows\MainWindow.paml.cs:wiersz 26
   w Core2D.Perspex.App.Start() w C:\DOWNLOADS\GitHub\Core2D\Core2D.Perspex\App.paml.cs:wiersz 102
Nikita Tsukanov
@kekekeks
Dec 01 2015 21:22

when local:DesignerHelper.DataContext is null and I run my app I get exception

That's caused by another bug in OmniXAML

Steven Kirk
@grokys
Dec 01 2015 21:22
yep, omnixaml bug
Nikita Tsukanov
@kekekeks
Dec 01 2015 21:22
OmniXAML doesn't tolerate nulls at the moment
Steven Kirk
@grokys
Dec 01 2015 21:23
ok, lets push it until after alpha 3
Nikita Tsukanov
@kekekeks
Dec 01 2015 21:23
Binding expression for Design.DataContext is always evaluated
Even in runtime mode
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 21:24
the best solution would be to ignore it during runtime mode
Nikita Tsukanov
@kekekeks
Dec 01 2015 21:25
Yep, but we can't do that at the moment
It will require support from OmniXAML and @SuperJMN seems to be very busy
Wiesław Šoltés
@wieslawsoltes
Dec 01 2015 21:26
I can work around this in my code for now
until bug is fixed
Nikita Tsukanov
@kekekeks
Dec 01 2015 21:43
Does windows reuse PIDs for recently killed processes?
For some reason restarting designer process prevents VS from starting debugger
WTF
Steven Kirk
@grokys
Dec 01 2015 21:49
no idea tbh... that's too low level for me ;)
Nikita Tsukanov
@kekekeks
Dec 01 2015 21:51
Wait, it's designer process itself that is preventing debugging
If it's alive debugging won't start
wtf
wtf2
Nikita Tsukanov
@kekekeks
Dec 01 2015 22:15
BTW, HwndHost is unreliable crap
release announcement so far
pls let me know what i've got wrong or missed
oh, also if you're looking for music for the video @kekekeks, feel free to use some of mine ;)
(i won't be hurt if you don't though ;) )
Nikita Tsukanov
@kekekeks
Dec 01 2015 22:20
Well, it will be a short video (less than 2 mins)
Steven Kirk
@grokys
Dec 01 2015 22:22
yeah, it's just your videos get more hits than the band's videos ;)
though yours are more professional
arrgh!
fuck i wish it wouldn't do that
ah you can collapse it
Nikita Tsukanov
@kekekeks
Dec 01 2015 22:25
MY EYES
Steven Kirk
@grokys
Dec 01 2015 22:25
:)
Try this version
Steven Kirk
@grokys
Dec 01 2015 22:42
when i run it it says "This extension is already installed to all applicable products." -- is this just because you've not bumped the version number yet?
Nikita Tsukanov
@kekekeks
Dec 01 2015 22:42
No idea
just uninstall it from VS
Steven Kirk
@grokys
Dec 01 2015 22:42
yeah, i have
yep, that seems to have fixed it, thanks!
Nikita Tsukanov
@kekekeks
Dec 01 2015 22:44
I still have no idea why that happened
But properly killing designer instances before VS attempts to start debuggin does the trick
Steven Kirk
@grokys
Dec 01 2015 22:46
any comments on the release announcement? https://gist.github.com/grokys/49d5eca7f33e1622c08e
Nikita Tsukanov
@kekekeks
Dec 01 2015 22:52
skia backend -> skia-based backend
Steven Kirk
@grokys
Dec 01 2015 22:54
ok
ok, just realised i've not mentioned the ios and android support
who did what on that?
Nikita Tsukanov
@kekekeks
Dec 01 2015 22:56
@donandren implemented windowing support for Android, we discarded his drawing backend however
iOS backend was written by me from scratch since previous attempt used a bit different architecture
I've used XForms approach where user only needs to inherit from AppDelegate provided by lib
Steven Kirk
@grokys
Dec 01 2015 23:08
how complete is ios and android support?
Nikita Tsukanov
@kekekeks
Dec 01 2015 23:08
Well, you can run our test app
And it will work
ios backend currently doesn't have any support for text input
Touch events are translated to mouse events
And there is no multiwindow support since tinywm stuff haven't been merged yet