These are chat archives for AvaloniaUI/Avalonia

6th
Mar 2016
Ivan Kochurkin
@KvanTTT
Mar 06 2016 00:20 UTC
Hello! I updated Perspex to last nightly build and got error message: Property or indexer 'Application.Styles' cannot be assigned to -- it is read onlyStyles = new DefaultTheme();
How can I resolve it?
Ivan Kochurkin
@KvanTTT
Mar 06 2016 00:30 UTC
If I commented it out, application runs with black empty background
danwalmsley
@danwalmsley
Mar 06 2016 08:34 UTC
@KvanTTT you have to change to new Styles in app.xaml
see the example app in source
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 09:57 UTC
Add this to your app.xaml and remove Styles = new DefaultTheme();
    <Application.Styles>
        <StyleInclude Source="resm:Perspex.Themes.Default.DefaultTheme.paml?assembly=Perspex.Themes.Default"/>
        <StyleInclude Source="resm:Perspex.Themes.Default.Accents.BaseLight.paml?assembly=Perspex.Themes.Default"/>
    </Application.Styles>
Ivan Kochurkin
@KvanTTT
Mar 06 2016 09:58 UTC
Thanks!
In should be edited in default template.
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 10:07 UTC
I have created PR Perspex/PerspexVS#32, but this probably needs to wait after next Perspex release on NuGet
Darnell Williams
@Seeker1437
Mar 06 2016 11:08 UTC
@wieslawsoltes thanks, I'll take a look.
Yeah the next release would be a big thing
Steven Kirk
@grokys
Mar 06 2016 13:55 UTC
@QuantumDeveloper excellent news!
Grid is really important however so i'd like to have a decent test suite ready before we think about bringing it into perspex master
otherwise we'll have a lot of breakage i imagine
Steven Kirk
@grokys
Mar 06 2016 14:24 UTC
@kekekeks i added WeakSubscriptionManager.Unsubscribe so no need to worry about it
Nikita Tsukanov
@kekekeks
Mar 06 2016 14:24 UTC
Oh, I haven't thought about explicitly unsubscribing
BTW, is there some framework-independent observable collection?
Steven Kirk
@grokys
Mar 06 2016 15:12 UTC
i think the closest is ObservableCollection
Steven Kirk
@grokys
Mar 06 2016 15:51 UTC
@wieslawsoltes i've implemented using weak listeners for bindings, and now core2d initially climbs in memory usage but then seems to level off
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 16:01 UTC
@grokys Just tested weak-bindings branch
really big improvment
Steven Kirk
@grokys
Mar 06 2016 16:01 UTC
cool! :)
it's really useful to have a perspex and WPF version, to compare them
perspex is a lot slower and uses a lot more memory than WPF
but that's kinda expected as it's not at all optimized
but interesting to see anyway
anyway, the weak bindings branch is now merged to master
danwalmsley
@danwalmsley
Mar 06 2016 16:03 UTC
@grokys does this fix memory leaks? some or all?
Steven Kirk
@grokys
Mar 06 2016 16:03 UTC
@kekekeks i noticed that nuget packages seem to be pushed to myget even from non-master branches - that's not right is it?
@danwalmsley it fixes a lot of them
i won't say "all" though ;) that's a bit absolute
danwalmsley
@danwalmsley
Mar 06 2016 16:03 UTC
ok il have a look with avalon studio
see how it looks
of course
:D
as anything changed regarding style resource?
Steven Kirk
@grokys
Mar 06 2016 16:04 UTC
i don't think so
danwalmsley
@danwalmsley
Mar 06 2016 16:04 UTC
ok
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 16:35 UTC
@grokys Tested the update and really like the progress with memory usage
Steven Kirk
@grokys
Mar 06 2016 16:36 UTC
great!
btw @wieslawsoltes @danwalmsley @KvanTTT - there's going to be another change related to the styling stuff: i'm renaming .paml files to .xaml so you'll have to update the paths in your App.xaml when i commit
Steven Kirk
@grokys
Mar 06 2016 16:42 UTC
after that, i'm wondering what to work on next: item virtualization or performance/memory usage?
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 16:46 UTC
I vote for perf/memmory usage
@grokys could you have a look into Perspex/Perspex#463
Steven Kirk
@grokys
Mar 06 2016 16:47 UTC
yeah, will do that shortly - really easy to fix
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 16:47 UTC
ok, and #466 too please
Steven Kirk
@grokys
Mar 06 2016 16:54 UTC
ah yeah, that seems to have been introduced by my recent changes to reduce leaks
ok, .paml files have been renamed to .xaml
Steven Kirk
@grokys
Mar 06 2016 17:11 UTC
@wieslawsoltes ok both of those fixed
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 17:42 UTC
great!
Steven Kirk
@grokys
Mar 06 2016 17:42 UTC
nobody told me that the designer was broken!
well, even more than usual
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 17:49 UTC
@grokys When I display first ContextMenu everything is ok, but second time when trying to display differen ContextMenu its rendered incorectly
Steven Kirk
@grokys
Mar 06 2016 17:51 UTC
hmm, strange
i'll try and work out what's happening
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 17:52 UTC
ok
and if you have time Perspex/Perspex#464
Steven Kirk
@grokys
Mar 06 2016 17:57 UTC
ok, just committed a change - hopefully will fix it
(sorry, didn't try it in Core2d, got distracted by real life things)
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 17:58 UTC
no problem
and #464 is for XamlBehaviors sample app
Ivan Kochurkin
@KvanTTT
Mar 06 2016 18:01 UTC
Is it possible to manage scroll position manually in ScrollViewer?
I want to scroll up to end.
And what is the best way to add text to Canvas?
Nikita Tsukanov
@kekekeks
Mar 06 2016 19:02 UTC

i noticed that nuget packages seem to be pushed to myget even from non-master branches - that's not right is it?

there is a check for non-master branch in the script

What you see in the log are "build artifacts"
So you can get nuget-packages for your non-master commit
Steven Kirk
@grokys
Mar 06 2016 19:18 UTC
ah ok
@KvanTTT yes you can set the ScrollViewer.Offset property
best way to add text to a canvas is by adding a TextBlock
Ivan Kochurkin
@KvanTTT
Mar 06 2016 19:20 UTC
@grokys, thank you, I already noticed :)
Darnell Williams
@Seeker1437
Mar 06 2016 19:27 UTC
@grokys I guess I am a bit confused, are you saying windows dont resize to their content in the designer?
Steven Kirk
@grokys
Mar 06 2016 19:27 UTC
yes
Nikita Tsukanov
@kekekeks
Mar 06 2016 19:27 UTC
Ehm, wat
Designer doesn't force any restrictions on the window
it's basically a normal window
just with WM_CHILD style
Steven Kirk
@grokys
Mar 06 2016 19:29 UTC
oh, actually looks like i was kinda wrong
Darnell Williams
@Seeker1437
Mar 06 2016 19:29 UTC
For me sizing of usercontrols is weird but not windows
Steven Kirk
@grokys
Mar 06 2016 19:30 UTC
they do resize if you put SizeToContent=WidthAndHeight for example
however if i open e.g. BindingTest\MainWindow.xaml
i get this
blob
the controls are cut-off
it should resize to the window's desired size
let me update the issue
Nikita Tsukanov
@kekekeks
Mar 06 2016 19:32 UTC
And here we have a problem with Perspex.Designer extracted from the main repo
It's hard to debug designer-related issues
This one can be covered by unit tests, however
Steven Kirk
@grokys
Mar 06 2016 19:33 UTC
i was just trying it - i could debug into perspex sources no problem
Darnell Williams
@Seeker1437
Mar 06 2016 19:58 UTC
oh weird
I see
I think I might have to hand that to my sempai lol @kekekeks im not sure how it handles that.
Darnell Williams
@Seeker1437
Mar 06 2016 20:09 UTC
@grokys does it work properly when compiled?
Steven Kirk
@grokys
Mar 06 2016 20:10 UTC
Well the window gets given a default
Size by windows when run
Darnell Williams
@Seeker1437
Mar 06 2016 20:10 UTC
hmm
Steven Kirk
@grokys
Mar 06 2016 20:10 UTC
But the designer should fit to the content of no other side is given
If
Nikita Tsukanov
@kekekeks
Mar 06 2016 20:11 UTC
So, basically, in designer mode windows should have SizeToContent=WidthAndHeight by default
Darnell Williams
@Seeker1437
Mar 06 2016 20:12 UTC
Idk about that
Nikita Tsukanov
@kekekeks
Mar 06 2016 20:13 UTC
Is there any way to check if perspex property has it's value unchanged from default?
i. e. property setter haven't been touched at all
Darnell Williams
@Seeker1437
Mar 06 2016 20:14 UTC
wouldnt the best way be to just have a default? enum
Nikita Tsukanov
@kekekeks
Mar 06 2016 20:14 UTC
Basically I want to be sure that SizeToContent wasn't assigned from XAML
So I can change it freely
Darnell Williams
@Seeker1437
Mar 06 2016 20:15 UTC
ah
I see what you mean.
Darnell Williams
@Seeker1437
Mar 06 2016 20:16 UTC
Sorry you guys I need you to work with me xD So I see now if I remove width and height in wpf designer, it sozes to the content
ah and our designer doesnt do this
Darnell Williams
@Seeker1437
Mar 06 2016 20:22 UTC
@kekekeks I was thinking the same thing except explicitly setting on the windows that we create (like where you set the content of the new window to the control?) because it does the same thing for me
to the control when the root is not a window*
Darnell Williams
@Seeker1437
Mar 06 2016 20:25 UTC
right so basically window = new window(Content = original, WindowSize = SizeToContent};
I have them now just gotta PR
Steven Kirk
@grokys
Mar 06 2016 20:48 UTC
You can use IsSet to check if a property has been set
danwalmsley
@danwalmsley
Mar 06 2016 21:45 UTC
in latest version it seems paml files are not recognised any more?
Darnell Williams
@Seeker1437
Mar 06 2016 21:46 UTC
Yeah changed to xaml
if it's styles it was changed to xaml
danwalmsley
@danwalmsley
Mar 06 2016 21:47 UTC
all my views im having to change it seems
Darnell Williams
@Seeker1437
Mar 06 2016 21:47 UTC
otherwise if you mean designer, it should still see them
danwalmsley
@danwalmsley
Mar 06 2016 21:47 UTC
but the actual application is throwing now
unless im renaming to xaml
Darnell Williams
@Seeker1437
Mar 06 2016 21:48 UTC
ah I wonder if he ment to do that right away, well it was a change to come, yeah you would need to change to xaml
we left the paml support in there to help with the transition but eventually we'll drop the paml out of the designer too]
danwalmsley
@danwalmsley
Mar 06 2016 21:50 UTC
problem is visual studio sets them all automatically to build custom tool MsBuild:Compile
Nikita Tsukanov
@kekekeks
Mar 06 2016 21:54 UTC
I have no idea why you guys are so obsessed with .xaml extension
danwalmsley
@danwalmsley
Mar 06 2016 21:54 UTC
I was happy with paml
now I cant build my project
its demanding that PresentationCore be attached
Nikita Tsukanov
@kekekeks
Mar 06 2016 21:54 UTC
Using .xaml will bring a LOT of problems
With 3rd party VS extensions
that rely on xaml file extension
danwalmsley
@danwalmsley
Mar 06 2016 21:54 UTC
latest nuget packages seem to require .xaml
not the designer perspex itself
ah one of my files had lost its embedded resource setting
Darnell Williams
@Seeker1437
Mar 06 2016 21:57 UTC
Can't be right
danwalmsley
@danwalmsley
Mar 06 2016 22:01 UTC
it really doesnt work when I update
blob
do I need to update my designer?
was there a new release of plugin lately? I think mine is currently installed from vsix
Darnell Williams
@Seeker1437
Mar 06 2016 22:04 UTC
Groky you killed the paml loading capability!!
Perspex/Perspex@81d7d76
It doesn't try to load pamls anymore
Darnell Williams
@Seeker1437
Mar 06 2016 22:10 UTC
Submitted pr :D
@kekekeks idk where in DesignerAssist I could do the IsSet checking I don't think OnResize is accurate enough
Nikita Tsukanov
@kekekeks
Mar 06 2016 22:12 UTC
You can do it right after line 80
At this point XAML is already loaded
Darnell Williams
@Seeker1437
Mar 06 2016 22:12 UTC
Oh okaay ill update
Darnell Williams
@Seeker1437
Mar 06 2016 22:20 UTC
Updated
Steven Kirk
@grokys
Mar 06 2016 22:54 UTC
i didn't disable loading .paml files at all
ah balls
ok, i did
that was a mistake
i did a global replace of .paml -> .xaml but I shouldn't have changed it in the one place where it tried to load .paml
sorry @danwalmsley i will fix tomorrow
Nikita Tsukanov
@kekekeks
Mar 06 2016 22:57 UTC
PR with fix is already merged
Steven Kirk
@grokys
Mar 06 2016 22:57 UTC
ah ok, thanks
sorry i'm not at my computer