These are chat archives for AvaloniaUI/Avalonia

13th
Aug 2016
Jeremy Koritzinsky
@jkoritzinsky
Aug 13 2016 01:38
@MitchellBot did you change the build action to embedded resource?
MitchellBot
@MitchellBot
Aug 13 2016 01:48
the build action on what?
On the xaml/paml?
MitchellBot
@MitchellBot
Aug 13 2016 01:54
The xaml file is "page"
Darnell Williams
@Seeker1437
Aug 13 2016 03:22
Ah, yeah make it an embedded resource and remove the custom tool
James Walmsley
@jameswalmsley
Aug 13 2016 03:46
blob
This is completely lame I know... I have Skia rendering on Linux via my libSkiaSharp.so, and I'm trying to get the pixel data to render on the Gdk.Window using Gdk.Drawable.DrawPixbuf(), but currently I get a seg-fault when I do it.
I can easily get the Skia rendering to output to a png file (as shown in the image) so I know Skia is working fine.
I'm probably doing something wrong with Gtk/Gdk....
Type for some sleep.
MitchellBot
@MitchellBot
Aug 13 2016 05:26
@Seeker1437 still no
danwalmsley
@danwalmsley
Aug 13 2016 09:13
@jameswalmsley I mentioned you above from yesterday morning, @kekekeks explained how this is done, and posted code that already does this
danwalmsley
@danwalmsley
Aug 13 2016 09:34
@MitchellBot are you still having problem?
Tiago Freitas Leal
@tfreitasleal
Aug 13 2016 10:14
I feel uneasy asking some questions that may be well known facts but I must ask them anyway.
VS2015 is unable to build Avalonia.sln for platform Mono.
danwalmsley
@danwalmsley
Aug 13 2016 10:16
@tfreitasleal all questions are very welcome
I think think it is intended to be built on monodevelop
On ubuntu, or bash for windows 10
Its basically to fix the automated builds
If you build an Avalonia app on windows, you can run those binaries on mono also
You don't need to do a special build
Tiago Freitas Leal
@tfreitasleal
Aug 13 2016 10:18
building with XBUILD works ok on UBUNTU but NOK on Windows
reports
KeyGesture.cs(105,74): error CS1929: Type System.Array' does not contain a memberCast' and the best extension method overload System.Linq.Enumerable.Cast<Avalonia.Input.InputModifiers>(this System.Collections.IEnumerable)' requires an instance of typeSystem.Collections.IEnumerable'
of course i was using the mono build options
xbuild /p:Platform=Mono /p:Configuration=Debug
Steven Kirk
@grokys
Aug 13 2016 10:48
@tfreitasleal yeah the "mono" build configuration is used when building under mono, not on .net
it's mainly there for the mono CI
Tiago Freitas Leal
@tfreitasleal
Aug 13 2016 10:49
every samples runs under Mono on Windows, except for XamlTestApplication
Sorry, forgot to explain
everything was build on VS2015
everything runs on .NET (double click on exe file)
Steven Kirk
@grokys
Aug 13 2016 10:57
sorry, i don't think i understand what you're trying to do
Tiago Freitas Leal
@tfreitasleal
Aug 13 2016 11:01
@danwalmsley said If you build an Avalonia app on windows, you can run those binaries on mono also.
I was testing this scenario:
1) build on VS 2015 platform Any CPU
2) run binaries on Mono under windows
(4 samples passed and 1 failled)
3) run binaries on Mono under UBUNTU
all samples failed
Tiago Freitas Leal
@tfreitasleal
Aug 13 2016 11:23
second phase of the tests
XBUILD the solution on UBUNTU
all 3 build samples run.
The samples build with VS2015 are supposed to run under Linux?
Tiago Freitas Leal
@tfreitasleal
Aug 13 2016 11:55
on the other hand
binaries xbuild on UBUNTU don't run on Windows, neither by double clicking nor by mono <path> on mono's command line.
So I found binaries build on VS don't run on Linux and binaries build on Linux don't run on Windows.
danwalmsley
@danwalmsley
Aug 13 2016 12:02
@tfreitasleal I will try this later when I get a minute
Steven Kirk
@grokys
Aug 13 2016 12:19
Hmm, ok - they should run if you have all the libs for that platform... Maybe we broke something
Steven Kirk
@grokys
Aug 13 2016 12:29
are you getting any errors?
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 12:37
@grokys Managed to get CI to build without errors for AvaloniaUI/Avalonia#681
Steven Kirk
@grokys
Aug 13 2016 16:31
@wieslawsoltes great! i will try to take a look soon, not had much time in front of the computer this weekend
MitchellBot
@MitchellBot
Aug 13 2016 17:33
@danwalmsley yes, still having problems
No matter what I do I cannot get the correct designer to open for the xaml files
or paml if I rename them
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 17:36
devenv_2016-08-13_19-36-00.png
@MitchellBot Do you have same settings ?
MitchellBot
@MitchellBot
Aug 13 2016 17:36
yes
on a .xaml and on a .paml file
MitchellBot
@MitchellBot
Aug 13 2016 17:46
There's a big delay before the Design tab even opens and then when it does it shows "cannot be edited in the Design view"
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 17:46
What is your project structure ?
MitchellBot
@MitchellBot
Aug 13 2016 17:46
blob
I forked and cloned and haven't messed with anything except to add my own project to the same solution
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 17:47
so AvaloniaSandbox is class library ?
MitchellBot
@MitchellBot
Aug 13 2016 17:47
application
blob
I've tried with/without the XAML designer itself enabled
in case it's getting confused between the XAML designer and the Avalonia designer
I have all the references that the sample apps have and more
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 17:50
I will try to recreate your project, give me few minutes
MitchellBot
@MitchellBot
Aug 13 2016 17:50
I've tried creating more projects in case it was just this one
ok
Darnell was trying too, I don't think he repro'd
I'm using the extension for VS so when I create the project I right-click the sln and add new item > Other Languages > Visual C# > Avalonia > Avalonia Application
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 17:59
@MitchellBot Same issue here, that is strange
MitchellBot
@MitchellBot
Aug 13 2016 17:59
sweet, I'm not crazy!
well... probably still a little crazy... but I'm not wrong!
quick someone tell my wife!
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 17:59
when I create new project not in Avalonia.sln all works
MitchellBot
@MitchellBot
Aug 13 2016 17:59
weird
and also a pain in the ass for version control
Darnell Williams
@Seeker1437
Aug 13 2016 18:00
Yeah its a designer issue
Ill take a look into it :O
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 18:01
@MitchellBot Try creating new AvaloniaApplication but put project in sandbox folder on disk
MitchellBot
@MitchellBot
Aug 13 2016 18:01
gah... wtf is this now?!
blob
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 18:02
and put project in solution to Samples folder
this works :)
MitchellBot
@MitchellBot
Aug 13 2016 18:03
k, ty :D
Wiesław Šoltés
@wieslawsoltes
Aug 13 2016 18:04
2016-08-13_20-03-51.png
MitchellBot
@MitchellBot
Aug 13 2016 18:05
huh, I can't remove the project from the solution
Just dragging/dropping into the sample directory fixed
and rebuilding
there's still a big delay before the design tab actually opens
but I can actually use the design tab now
is there any logging for this that I can provide?
MitchellBot
@MitchellBot
Aug 13 2016 18:14
blob
is there something I can do to get that grey box out of my way?
Andrew
@zezba9000
Aug 13 2016 18:29
Is there a design width / height value? Setting minWidth lets me edit values visual but messes up stuff at runtime.
MitchellBot
@MitchellBot
Aug 13 2016 18:33
For a control or a window?
Andrew
@zezba9000
Aug 13 2016 18:33
Both
MitchellBot
@MitchellBot
Aug 13 2016 18:34
I'm new to this but I'll see if I can find it
Andrew
@zezba9000
Aug 13 2016 18:34
its just if I want a UserControl to be ran at any size that lives in a Window it messes up if I set the Min values to high
but I need to set them for design in the VS ext
Its ok for now though, I can get around it
MitchellBot
@MitchellBot
Aug 13 2016 18:35
Design.cs has a SetWidth property taking a Control and a Double as values
But that must be for the codebehind and not the markup
Jeremy Koritzinsky
@jkoritzinsky
Aug 13 2016 18:36
And Width and Height attached properties for XAML
Andrew
@zezba9000
Aug 13 2016 18:36
ya no such property in the UserControl
MitchellBot
@MitchellBot
Aug 13 2016 18:37
Yeah, Window SizeToContent WidthAndHeight?
Jeremy Koritzinsky
@jkoritzinsky
Aug 13 2016 18:37
Use the attached properties on the Design class
Like Design.Width="300" Design.Height="300" should work
Andrew
@zezba9000
Aug 13 2016 18:37
@jkoritzinsky aww thats it, ok cool
Jeremy Koritzinsky
@jkoritzinsky
Aug 13 2016 18:37
No prob
MitchellBot
@MitchellBot
Aug 13 2016 18:39
The Button Command is supposed to be the equivalent of WPF OnClick, right?
no wait, there is an onclick
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:39
OnClick tries to execute the Command
Andrew
@zezba9000
Aug 13 2016 18:40
@MitchellBot Its just .Click
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:40
You can do Click="Button_Click" in XAML, or Button.Click += Button_Click(...)
MitchellBot
@MitchellBot
Aug 13 2016 18:40
In the markup?
Steven Kirk
@grokys
Aug 13 2016 18:40
not in the markup yet, no
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:40
Oh.
MitchellBot
@MitchellBot
Aug 13 2016 18:40
oh, that's what I was looking for
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:40
Should be fairly trivial to implement.
Steven Kirk
@grokys
Aug 13 2016 18:41
yeah until very recently omnixaml didn't support it
Andrew
@zezba9000
Aug 13 2016 18:41
@MitchellBot There is no code behind, so you have to do "this.Find<Button>("MyButton").Click += buttonClick;"
Steven Kirk
@grokys
Aug 13 2016 18:41
i think it does now but i'm not sure we've updated to a version with those changes
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:41
I use Command 95% of the time.
MitchellBot
@MitchellBot
Aug 13 2016 18:41
So I basically have to register the button to an event on application startup, right?
ok, gotcha, thanks @zezba9000
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:41
I don't put code in code-behind files
MitchellBot
@MitchellBot
Aug 13 2016 18:41
What parameter does Command actually take Miguel?
Steven Kirk
@grokys
Aug 13 2016 18:42
not on application startup, in the control constructor after InitializeControl
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:42
CommandParameter
MitchellBot
@MitchellBot
Aug 13 2016 18:42
Command=""?
Steven Kirk
@grokys
Aug 13 2016 18:42
@MitchellBot it's the same as in WPF
MitchellBot
@MitchellBot
Aug 13 2016 18:42
oh, ok
ty
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:42
OnClick => if (Command?.CanExecute(CommandParameter)) { Command.Execute(CommandParameter); }
Steven Kirk
@grokys
Aug 13 2016 18:42
Command="{Binding MyCommand}"
yeah omnixaml master still doesn't support events: SuperJMN/OmniXAML#106
not sure why it's not been merged into master - @SuperJMN ?
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:47
what's omnixaml?
Andrew
@zezba9000
Aug 13 2016 18:48
Jeremy Koritzinsky
@jkoritzinsky
Aug 13 2016 18:54
OmniXAML is the Xaml engine we use
Miguel Rochefort
@miguelrochefort
Aug 13 2016 18:54
I now feel dumb for coding my own.
Although mine supports events.
Jeremy Koritzinsky
@jkoritzinsky
Aug 13 2016 19:01
Which one is yours?
I'm interested at looking at it
Miguel Rochefort
@miguelrochefort
Aug 13 2016 19:08
s/my own/our own, it's not open source
Jeremy Koritzinsky
@jkoritzinsky
Aug 13 2016 19:10
Ok. Nevermind then
Jeremy Koritzinsky
@jkoritzinsky
Aug 13 2016 19:27
Hey, do we have an equivalent of x:Null?
Andrew
@zezba9000
Aug 13 2016 19:29
There is no HorizontalContentAlignment="Center" for TextBlock object?
Can I make a label with Centered text content?
got a workaround for what I need but maybe this is missing
Should I update Serilog to 2.1.0 and Sparche to 2.0.0.52 or is that a bad idea for Avalonia?
Jeremy Koritzinsky
@jkoritzinsky
Aug 13 2016 19:34
I don't know. You can try testing it out and letting us know.
Andrew
@zezba9000
Aug 13 2016 19:35
ok I'll make a copy later on a test
Steven Kirk
@grokys
Aug 13 2016 20:58
@zezba9000 TextBlock doesn't have HorizontalContentAlignment because its not a templated control: the "content" in this case refers to the ContentPresenter in the control template
you're looking for TextAlignment
also we don't generally update packages every time there's a new version of a dependency, there's not much point unless there's a feature we need and it may break stuff
i generally update all packages periodically though
Andrew
@zezba9000
Aug 13 2016 21:25
@grokys aww ok
Just pushed up my UI mock of for my GUI-It-GUI WPF to AvaloniaUI port: https://github.com/reignstudios/Git-It-GUI
After I port the meat of the code I should be able to get it working on Win/OSX/Lin finally
Darnell Williams
@Seeker1437
Aug 13 2016 22:28
@zezba9000 add support for BeyondCompare :D