These are chat archives for AvaloniaUI/Avalonia

6th
Mar 2016
Ivan Kochurkin
@KvanTTT
Mar 06 2016 00:20
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
If I commented it out, application runs with black empty background
danwalmsley
@danwalmsley
Mar 06 2016 08:34
@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
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
Thanks!
In should be edited in default template.
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 10:07
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
@wieslawsoltes thanks, I'll take a look.
Yeah the next release would be a big thing
Steven Kirk
@grokys
Mar 06 2016 13:55
@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
@kekekeks i added WeakSubscriptionManager.Unsubscribe so no need to worry about it
Nikita Tsukanov
@kekekeks
Mar 06 2016 14:24
Oh, I haven't thought about explicitly unsubscribing
BTW, is there some framework-independent observable collection?
Steven Kirk
@grokys
Mar 06 2016 15:12
i think the closest is ObservableCollection
Steven Kirk
@grokys
Mar 06 2016 15:51
@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
@grokys Just tested weak-bindings branch
really big improvment
Steven Kirk
@grokys
Mar 06 2016 16:01
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
@grokys does this fix memory leaks? some or all?
Steven Kirk
@grokys
Mar 06 2016 16:03
@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
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
i don't think so
danwalmsley
@danwalmsley
Mar 06 2016 16:04
ok
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 16:35
@grokys Tested the update and really like the progress with memory usage
Steven Kirk
@grokys
Mar 06 2016 16:36
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
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
I vote for perf/memmory usage
@grokys could you have a look into Perspex/Perspex#463
Steven Kirk
@grokys
Mar 06 2016 16:47
yeah, will do that shortly - really easy to fix
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 16:47
ok, and #466 too please
Steven Kirk
@grokys
Mar 06 2016 16:54
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
@wieslawsoltes ok both of those fixed
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 17:42
great!
Steven Kirk
@grokys
Mar 06 2016 17:42
nobody told me that the designer was broken!
well, even more than usual
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 17:49
@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
hmm, strange
i'll try and work out what's happening
Wiesław Šoltés
@wieslawsoltes
Mar 06 2016 17:52
ok
and if you have time Perspex/Perspex#464
Steven Kirk
@grokys
Mar 06 2016 17:57
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
no problem
and #464 is for XamlBehaviors sample app
Ivan Kochurkin
@KvanTTT
Mar 06 2016 18:01
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

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
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
@grokys, thank you, I already noticed :)
Darnell Williams
@Seeker1437
Mar 06 2016 19:27
@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
yes
Nikita Tsukanov
@kekekeks
Mar 06 2016 19:27
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
oh, actually looks like i was kinda wrong
Darnell Williams
@Seeker1437
Mar 06 2016 19:29
For me sizing of usercontrols is weird but not windows
Steven Kirk
@grokys
Mar 06 2016 19:30
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
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
i was just trying it - i could debug into perspex sources no problem
Darnell Williams
@Seeker1437
Mar 06 2016 19:58
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
@grokys does it work properly when compiled?
Steven Kirk
@grokys
Mar 06 2016 20:10
Well the window gets given a default
Size by windows when run
Darnell Williams
@Seeker1437
Mar 06 2016 20:10
hmm
Steven Kirk
@grokys
Mar 06 2016 20:10
But the designer should fit to the content of no other side is given
If
Nikita Tsukanov
@kekekeks
Mar 06 2016 20:11
So, basically, in designer mode windows should have SizeToContent=WidthAndHeight by default
Darnell Williams
@Seeker1437
Mar 06 2016 20:12
Idk about that
Nikita Tsukanov
@kekekeks
Mar 06 2016 20:13
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
wouldnt the best way be to just have a default? enum
Nikita Tsukanov
@kekekeks
Mar 06 2016 20:14
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
ah
I see what you mean.
Darnell Williams
@Seeker1437
Mar 06 2016 20:16
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
@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
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
You can use IsSet to check if a property has been set
danwalmsley
@danwalmsley
Mar 06 2016 21:45
in latest version it seems paml files are not recognised any more?
Darnell Williams
@Seeker1437
Mar 06 2016 21:46
Yeah changed to xaml
if it's styles it was changed to xaml
danwalmsley
@danwalmsley
Mar 06 2016 21:47
all my views im having to change it seems
Darnell Williams
@Seeker1437
Mar 06 2016 21:47
otherwise if you mean designer, it should still see them
danwalmsley
@danwalmsley
Mar 06 2016 21:47
but the actual application is throwing now
unless im renaming to xaml
Darnell Williams
@Seeker1437
Mar 06 2016 21:48
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
problem is visual studio sets them all automatically to build custom tool MsBuild:Compile
Nikita Tsukanov
@kekekeks
Mar 06 2016 21:54
I have no idea why you guys are so obsessed with .xaml extension
danwalmsley
@danwalmsley
Mar 06 2016 21:54
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
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
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
Can't be right
danwalmsley
@danwalmsley
Mar 06 2016 22:01
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
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
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
You can do it right after line 80
At this point XAML is already loaded
Darnell Williams
@Seeker1437
Mar 06 2016 22:12
Oh okaay ill update
Darnell Williams
@Seeker1437
Mar 06 2016 22:20
Updated
Steven Kirk
@grokys
Mar 06 2016 22:54
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
PR with fix is already merged
Steven Kirk
@grokys
Mar 06 2016 22:57
ah ok, thanks
sorry i'm not at my computer