These are chat archives for AvaloniaUI/Avalonia

10th
Mar 2016
danwalmsley
@danwalmsley
Mar 10 2016 00:10
"@grokys on item-virtualiztion" does this mean virtualization is coming?
Steven Kirk
@grokys
Mar 10 2016 00:10
haha, no it means i deleted an old branch that was an aborted attempt at it ;)
i do plan to start on it in the next few weeks though
danwalmsley
@danwalmsley
Mar 10 2016 00:16
ah ok
cheers for fixing those other bugs earlier
Steven Kirk
@grokys
Mar 10 2016 00:20
np!
Steven Kirk
@grokys
Mar 10 2016 00:44
just committed another big memory usage improvement
took Core2D (managed) startup memory down from 10mb to 7.5mb!
that's down from 12mb since i started
nearly halved it! maybe soon...
we're not that much higher than WPF now
(hopefully it doesn't break anything!)
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 07:01
blockquote it works with all the sample apps though?
yeah, why not?
just try it)
Steven Kirk
@grokys
Mar 10 2016 12:24
trying it now
wow yeah devtools is a LOT faster ;)
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 12:25
yeah)
Steven Kirk
@grokys
Mar 10 2016 12:26
get an exception when switching to the Lists tab of the XamlTestApplication
Exception thrown: 'System.InvalidOperationException' in Perspex.Layout.dll

Additional information: Invalid size returned for Measure.
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 12:26
hm
will look at this later
Steven Kirk
@grokys
Mar 10 2016 12:27
ok
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 12:27
work is not finished yet)
Steven Kirk
@grokys
Mar 10 2016 12:27
sure
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 12:27
BTW, I adapt 25 test for grid
Steven Kirk
@grokys
Mar 10 2016 12:28
cool!
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 12:28
almost all of them are passing)
except 2
Steven Kirk
@grokys
Mar 10 2016 12:28
ok
if you work out what causes the exception i'm seeing, that's another test ;)
danwalmsley
@danwalmsley
Mar 10 2016 12:28
   at SharpDX.Result.CheckError()
   at SharpDX.Direct2D1.RenderTarget.EndDraw(Int64& tag1, Int64& tag2)
   at Perspex.Direct2D1.Media.DrawingContext.Dispose()
   at Perspex.Media.DrawingContext.Dispose()
   at Perspex.Direct2D1.Media.TileBrushImpl..ctor(TileBrush brush, RenderTarget target, Size targetSize)
   at Perspex.Direct2D1.Media.DrawingContext.CreateBrush(Brush brush, Size destinationSize)
   at Perspex.Direct2D1.Media.DrawingContext.FillRectangle(Brush brush, Rect rect, Single cornerRadius)
   at Perspex.Controls.Panel.Render(DrawingContext context)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(DrawingContext context, IVisual visual, Rect clipRect)
   at Perspex.Rendering.RendererMixin.Render(IRenderTarget renderTarget, IVisual visual)
   at Perspex.Controls.Platform.DefaultTopLevelRenderer.<>c__DisplayClass0_0.<Attach>b__2(Rect rect)
   at Perspex.Controls.Platform.PlatformManager.WindowDecorator.OnPaint(Rect rc)
   at Perspex.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
just got an exception
Steven Kirk
@grokys
Mar 10 2016 12:29
weird, never seen that one before
danwalmsley
@danwalmsley
Mar 10 2016 12:29
stating SharpDX this error is recoverable but requires full re-render (or words to that effect) iv lost the debug session now
i'll try and get it to happen again..
@grokys since fixing treeview, there seems to be missing a margin / gap
all my treeviewitems now back onto each other
This message was deleted
image.png
Ivan Kochurkin
@KvanTTT
Mar 10 2016 12:31
After paml to xaml renaming, my app is not working due to the following errors: The name "Window" does not exist in the namespace "https://github.com/perspex". How can I resolve it?
Steven Kirk
@grokys
Mar 10 2016 12:37
hmm that's strange @KvanTTT
i don't understand how that can be caused by a rename
danwalmsley
@danwalmsley
Mar 10 2016 12:39
is that an intellisense error or build error? @KvanTTT
image.png
make sure its not changed as per screenshot
MSBuild:Compile
Visual studio will do this to all xaml files in solution if you rename a single paml file to xaml
Steven Kirk
@grokys
Mar 10 2016 12:40
ah ok - yeah i did the rename using powershell and find/replace so maybe that's why i didn't encounter this
Ivan Kochurkin
@KvanTTT
Mar 10 2016 12:44
TestApplication from last commit compilied, but preview for xaml files is not displayed.
In my app also the following error exists: Project file must include the .NET Framework assembly 'PresentationFramework' in the reference list. Why?
MSBuild:Compile should be enabled for xaml files?
Not working :(
Steven Kirk
@grokys
Mar 10 2016 12:54
no, i think dan was saying that MSBuild:Compile should be disabled
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 13:03
@grokys did you try to set margin on the window?
Steven Kirk
@grokys
Mar 10 2016 13:04
no, i just ran the XamlTestApplication
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 13:04
no, its not regarding Grid
its about layout in general
Steven Kirk
@grokys
Mar 10 2016 13:05
oh ok. margin doesn't make sense on Window i don't think
as margin is the area outside the control
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 13:05
yeah, but how do you workaround this in ArrangeCore()?
because inside of that method margin is using
Steven Kirk
@grokys
Mar 10 2016 13:07
not sure - i've not thought about it
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 13:07
can you try to set margin on the Window and run app?
Steven Kirk
@grokys
Mar 10 2016 13:07
but if i try to set Margin on the window, it seems to do nothing as i'd expect
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 13:07
I think it will be broken
Steven Kirk
@grokys
Mar 10 2016 13:07
doesn't seem to be, but i don't have much time to test as i'm about to catch a plane
i will be away until monday
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 13:08
ah
ok
and one more question before you leave
we need to send to the measure() method size without margin basically, right?
Steven Kirk
@grokys
Mar 10 2016 13:11
i think the margins are subtracted from the available size in MeasureCore
so you call Measure without thinking about margins, MeasureCore removes the margin size from the available size and MeasureOverride receives the size available after margins have been applied
I think
worth checking this stuff with WPF to make sure everything inPerspex is correct
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 13:13
yeah, because I am not sure
Steven Kirk
@grokys
Mar 10 2016 13:42
@danwalmsley not sure what has caused the treeview item margins to change, i need to take a look when i get back. for now, adding a padding to your TreeViewItems will probably work
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 13:46
@grokys this line is confusing me all the time
var constrained = LayoutHelper
                    .ApplyLayoutConstraints(this, availableSize)
                    .Deflate(margin);
if I pass window size like 1280*720, then why I should deflate it by margin?
Ivan Kochurkin
@KvanTTT
Mar 10 2016 13:47
I fixed my problem. Inexplicably "Mixed Plarform" configuration has been used instead of "Any CPU"
Steven Kirk
@grokys
Mar 10 2016 13:47
because i'd not considered margins on Window
for now just assume that Window.Margin will always be 0
for all other controls, that line makes sense, no?
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 13:48
seems yes
but top level controls must somehow bypass this
danwalmsley
@danwalmsley
Mar 10 2016 13:49
@KvanTTT to confirm you must remove the MSBuild part from the setting on all xaml files or it will not work
this is the problem with moving to xaml at the moment its going to be problematic
Steven Kirk
@grokys
Mar 10 2016 13:49
yeah, top level controls need to bypass this i agree
Ivan Kochurkin
@KvanTTT
Mar 10 2016 13:50
Yes, I've done it :)
Steven Kirk
@grokys
Mar 10 2016 13:50
@danwalmsley the advantage of moving to the .xaml extension is that renaming works correctly!
which makes it worth it to me
Ivan Kochurkin
@KvanTTT
Mar 10 2016 13:50
Is it possible to get rid of displayed errors in xaml?
Steven Kirk
@grokys
Mar 10 2016 13:55
you'll have to ask @abdelkarim or @Seeker1437 about that, i've not been involved in the VS plugin
danwalmsley
@danwalmsley
Mar 10 2016 14:02
@grokys sure that is nice, however the plugin will need to prevent visual studio constantly filling in the "CustomTool" MSBuild:Compile option
which it does constantly anytime your rename a .xaml file, when you add a new .xaml file
Steven Kirk
@grokys
Mar 10 2016 14:02
yeah
danwalmsley
@danwalmsley
Mar 10 2016 14:02
and it applies that setting globally to all xaml files, as far as I can tell
which becomes a right pain :D
Steven Kirk
@grokys
Mar 10 2016 14:02
oh really?
i'd not noticed
danwalmsley
@danwalmsley
Mar 10 2016 14:03
but hopefully we can override it
yeh it caught me out, but I should check that's definitely what happens
Steven Kirk
@grokys
Mar 10 2016 14:03
yeah, i hope so!
Darnell Williams
@Seeker1437
Mar 10 2016 14:38
Its a csproj setting
The best way around it that I've so far is to spin our own flavor of csproj
My issue with that is that this is just a UI framework, I dont feel like its worth a whole new project system just to get rid of that setting
Darnell Williams
@Seeker1437
Mar 10 2016 14:44
The other thing I've been looking into are the document events, trying to detect if a custom tool was Added and unsetting it
Will try to fix today
Wiesław Šoltés
@wieslawsoltes
Mar 10 2016 16:02
Abdelkarim Sellamna
@abdelkarim
Mar 10 2016 16:08
@danwalmsley @KvanTTT @grokys we're aware of the issue (Perspex/PerspexVS#14) where MSBuild tries to compile our xaml, we asked vs team members about the issues in the extendvs room, we will see what we can do to help fix that.
I've got another bug related to perspex xaml files that I haven't tracked yet. I was unable to open xaml files from the solution explorer
editor-bug.gif
danwalmsley
@danwalmsley
Mar 10 2016 17:51
@wieslawsoltes that is cool, is that on github? Id be interested to see how you did that
Denis Zaporozhets
@QuantumDeveloper
Mar 10 2016 17:53
always interested how it works actually
in WPF after compilation only one exe file was present without any xmal files
how it happens?
Wiesław Šoltés
@wieslawsoltes
Mar 10 2016 18:04

@wieslawsoltes that is cool, is that on github? Id be interested to see how you did that

@danwalmsley https://github.com/Core2D/Core2D/blob/master/src/Core2D.Perspex/Controls/Editor/EditorControl.xaml

Using behaviors and grid Bounds
and IsVisible, this is my first try
one issue is that I have to use fixed row/column location inside Grid
this can be fixed using RowSpan/ColumnSpan and Row/Column, but ChangePropertyAction does not work with attached properties, so I have to find way how to do that
Darnell Williams
@Seeker1437
Mar 10 2016 18:34
@abdelkarim weird, I never noticed that. Is that after reopening a file or initially? Seems like it might think the file is in the RDT and not creating a new editor.
Ivan Kochurkin
@KvanTTT
Mar 10 2016 22:05
Is it easy to implement KeyDown event for controls? Why KeyUp is working, whereas KeyDown - not?
Wiesław Šoltés
@wieslawsoltes
Mar 10 2016 23:24
Here is updated version https://youtu.be/UlDk7UdpQZ4
this is bit verbose to declare (about 120 lines of code) but works and is 100% Perspex Xaml ;)
Xaml can be found here: https://github.com/Core2D/Core2D/blob/master/src/Core2D.Perspex/Controls/Editor/EditorControl.xaml