These are chat archives for AvaloniaUI/Avalonia

11th
Nov 2017
Nikita Tsukanov
@kekekeks
Nov 11 2017 00:00
I think it would be enough for web version
and VSCode will use a proper language server
Not sure how to deal with bitmaps over the web though
FPS will be really low
And I don't have time to wire up libwebm for live streaming
Steven Kirk
@grokys
Nov 11 2017 00:02
doesn't need to be that fast does it?
Nikita Tsukanov
@kekekeks
Nov 11 2017 00:02
Well, if we don't want previewer to handle user input
It doesn't need to be fast, yes
danwalmsley
@danwalmsley
Nov 11 2017 11:58
@kekekeks @grokys I tried to add a kind of viewlocator attached property for ContentPresenter so I can do something like this
<ContentPresenter local:View.Model={Binding EditorViewModel} />
this was the code
public static class View
    {
        static View()
        {
            ViewProperty.Changed.AddClassHandler<ContentPresenter>((presenter, args) =>
            {
                var text = "null";

                if(args.NewValue != null)
                {
                    text = args.NewValue.GetType().FullName;
                }

                presenter.Content = new TextBlock { Text = text  };
            });
        }

        public static readonly AttachedProperty<object> ViewProperty = AvaloniaProperty
            .RegisterAttached<ContentPresenter, object>("View", typeof(View));

        public static void SetView(Control control, object value)
        {
            control.SetValue(ViewProperty, value);
        }

        public static object GetView(Control control)
        {
            return control.GetValue(ViewProperty);
        }
    }
but when I run it I get
using this xaml
<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:previewer="clr-namespace:AvalonStudio.Languages.Xaml"
             xmlns:as="clr-namespace:AvalonStudio.Controls;assembly=AvalonStudio.Extensibility"
             xmlns:editor="clr-namespace:AvalonStudio.Controls.Standard.CodeEditor;assembly=AvalonStudio.Controls.Standard"
             >
    <Border BorderBrush="{DynamicResource ThemeBorderDarkBrush}" BorderThickness="1">
        <Grid RowDefinitions="*,10,*">
            <Grid DockPanel.Dock="Top" Background="{DynamicResource ThemeEditorBackground}">
                <previewer:AvaloniaPreviewer Xaml="{Binding SourceText}" SourceFile="{Binding SourceFile}" />
            </Grid>

            <GridSplitter Grid.Row="1" Height="4" />

            <ContentPresenter as:View.View="{Binding CodeEditor}" />
        </Grid>
    </Border>
</UserControl>
I get
Portable.Xaml.XamlObjectWriterException: 'Cannot set unknown member '{clr-namespace:AvalonStudio.Controls;assembly=AvalonStudio.Extensibility}.View.View''
cant see what I'm doing wrong?
Steven Kirk
@grokys
Nov 11 2017 12:05
looks like portable.xaml isn't finding the attached property for some reason
btw what are you wanting to do there with that View attached property?
danwalmsley
@danwalmsley
Nov 11 2017 12:06
currently I have ViewModelViewHost control
its basically a content control
and if you have a datacontext of type MyViewModel
it finds a control called MyView
and uses that for the content
what I want to do, is turn it into an attached property, so I can do that on any content presenter, and also so I don't always have to use the data context
the use case is this
say you have a TextEditor control
all works fine
then someone comes and wants to implement a XamlTextEditor
danwalmsley
@danwalmsley
Nov 11 2017 12:08
XamlTextEditor, has the same textcontrol + a previewer
so I want to use this attached property to allow the person designing the XAML editor control
to insert the right view
hmm so if I did that
how would I use it?
<ContentControl DataContext={Binding MyViewModel} />
and it would just use that to find the correct view?
Steven Kirk
@grokys
Nov 11 2017 12:10
yeah, it's just a DataTemplate
you can put whatever logic you want into that view locator
danwalmsley
@danwalmsley
Nov 11 2017 12:11
so content control if it doesn't have a content property set
will try and look for a datatemplate based on datacontext?
Steven Kirk
@grokys
Nov 11 2017 12:11
oh no, sorry you still need to set the Content property. so <ContentControl Content="{Binding MyViewModel}"/>
danwalmsley
@danwalmsley
Nov 11 2017 12:12
that's perfect though
Steven Kirk
@grokys
Nov 11 2017 12:12
the content control looks up the tree for a matching data template until it gets to that one in app.xaml
that one says "i match" and runs the code to locate the view
that way you can also "override" the data template by putting another matching data template closer to the control, e.g. in a UserControl
danwalmsley
@danwalmsley
Nov 11 2017 12:13
how can I add that to app.xaml
(because its a generic class)
Steven Kirk
@grokys
Nov 11 2017 12:14
well you don't have to make it generic, but if you want it to be generic just add it in code after App.Initialize
danwalmsley
@danwalmsley
Nov 11 2017 12:14
ah ok
thanks
I think I know what I need to do now :)
Steven Kirk
@grokys
Nov 11 2017 12:15
i really need to document this stuff! :/
danwalmsley
@danwalmsley
Nov 11 2017 12:15
well once I have the avalonia previewer and dotnet support for AS hopefully by chrisgtmas id like to do a whole series of youtube tutorials for avalonia, (using avalon studio)
Steven Kirk
@grokys
Nov 11 2017 12:15
that'd be awesome!
danwalmsley
@danwalmsley
Nov 11 2017 12:16
so if you think of any good things like this maybe
keep a list and I will try and do some tutorials on them
(i'll probably get you guys to check for correctness) before publishing them
anyway I have to pop out but cheers for help
Steven Kirk
@grokys
Nov 11 2017 12:16
cool, will do! i really need to write this demo app i've been talking about!
ok later!
danwalmsley
@danwalmsley
Nov 11 2017 12:17
which demo app?
something different from control catalog?
Steven Kirk
@grokys
Nov 11 2017 12:17
yeah, something for a tutorial
danwalmsley
@danwalmsley
Nov 11 2017 12:18
I want to start from scratch, like basic things, data binding, commanding, lists, styling,
Steven Kirk
@grokys
Nov 11 2017 12:18
yeah
Nikita Tsukanov
@kekekeks
Nov 11 2017 12:45
@grokys it seems that attached properties somehow got broken
danwalmsley
@danwalmsley
Nov 11 2017 12:48
Hmmm but XAML behaviours is working
Nikita Tsukanov
@kekekeks
Nov 11 2017 12:49
        xmlns:wtf="clr-namespace:Avalonia.Controls;assembly=Avalonia.Controls"

  <TabControl  wtf:DockPanel.Dock="Left">
It doesn't work like that
Something is wrong with namespace resolution
Nikita Tsukanov
@kekekeks
Nov 11 2017 12:56
Aaaand it works if I run it from our source tree
danwalmsley
@danwalmsley
Nov 11 2017 12:57
does it look at the defaultnamespace for an assembly?
Nikita Tsukanov
@kekekeks
Nov 11 2017 12:57
Wait I was running it with some old revision just now
f226a516fe2bc191145c1fbf732f5a087f121a33
Yep, that issue is cause by Portable.Xaml update
danwalmsley
@danwalmsley
Nov 11 2017 13:00
damn!
can you see the cause?
Nikita Tsukanov
@kekekeks
Nov 11 2017 13:14
I think I've found the issue, but I'm not sure that my fix is correct
Nikita Tsukanov
@kekekeks
Nov 11 2017 13:25
cwensley/Portable.Xaml#75
@cwensley
danwalmsley
@danwalmsley
Nov 11 2017 13:34
@grokys for IDataTemplate
public bool Match(object data)
for this, in my case do I want this to always return true?
i.e. if the data template can be used on any viewmodel class?
Steven Kirk
@grokys
Nov 11 2017 13:37
you want it to return true if data is of your viewmodel type
danwalmsley
@danwalmsley
Nov 11 2017 13:39
in this case I don't think I know the viewmodel type ahead of time
danwalmsley
@danwalmsley
Nov 11 2017 13:44
its just a kind of last ditch, if we didn't find anything else, do we find a matching view
danwalmsley
@danwalmsley
Nov 11 2017 15:21
do we now support binding directly to a method?
from xaml
like instead of
<Button Command={Binding CloseCommand} />
I could do <Button Command={Binding Close} />
Steven Kirk
@grokys
Nov 11 2017 15:43
yeah that should work now
danwalmsley
@danwalmsley
Nov 11 2017 15:55
why wpf never had that amazes me
danwalmsley
@danwalmsley
Nov 11 2017 17:54
@grokys with style selectors can you check if a class is not set
something like
<Style Selector="cont|DocumentTabControl /template/ TabStripItem:dockleft:pointerover:!selected">
so this would be pointer over and not selected
<Style Selector="cont|DocumentTabControl /template/ TabStripItem:dockleft:pointerover:selected">
this would be when pointer over and selected
second example is already supported
is the first one possible?
I suppose I can add
a more specific selector to override negating the need for this
Nikita Tsukanov
@kekekeks
Nov 11 2017 18:00
I think styles are applied in the same order as they are defined in XAML files
danwalmsley
@danwalmsley
Nov 11 2017 18:01
ok
Steven Kirk
@grokys
Nov 11 2017 19:52
ok, AvaloniaUI/Avalonia#1270 is a good first start to improving performance on the Calendar page in ControlCatalog
jp2masa
@jp2masa
Nov 11 2017 19:52
when binding a view model property to a control property, the property setter gets called after the getter, setting the value which was returned by the getter, is this expected behaviour?
Steven Kirk
@grokys
Nov 11 2017 20:13
@jp2masa yeah, that's currently expected behavior, but maybe it's not right - i just tried in WPF and seems that doesn't happen there
danwalmsley
@danwalmsley
Nov 11 2017 20:14
@grokys iv got a memory leak with my document tabs again... these are the key retention paths... does this look like something wrong with avalonia?
image.png
Steven Kirk
@grokys
Nov 11 2017 20:15
looks like a style isn't detaching from the control. that usually happens when a control isn't properly removed from the logical tree
could be an avalonia but or a avs bug, hard to say really.
Nikita Tsukanov
@kekekeks
Nov 11 2017 20:17
1.32M objects though
There were issues with overridden visual tree handlers before
I don't remember if we've fixed that in Avalonia
danwalmsley
@danwalmsley
Nov 11 2017 20:19
yeah its a lot, memory usage is pretty high
Steven Kirk
@grokys
Nov 11 2017 20:19
yeah, there's a lot we can do to improve memory usage, but it's either spend time on that or spend time on getting features
Nikita Tsukanov
@kekekeks
Nov 11 2017 20:20
Managed heap is not that big actually
only 65MB
danwalmsley
@danwalmsley
Nov 11 2017 20:21
I'm a bit lost on how to narrow it down to a particular style or whatever
:(
there were loads of retention paths before
and I fixed them, looks like its the last thing now
danwalmsley
@danwalmsley
Nov 11 2017 20:35
I made sure there is no where now in code that overrides onAttachedtovisual / detached and logical trees without calling base class
danwalmsley
@danwalmsley
Nov 11 2017 20:41
ah looks like its a bug in avalonia edit
protected override void OnTemplateApplied(TemplateAppliedEventArgs e)
        {
            base.OnTemplateApplied(e);
            ScrollViewer = (ScrollViewer)e.NameScope.Find("PART_ScrollViewer");
           ScrollViewer.Content = TextArea;
        }
if this was done (ScrollViewer.Content = TextArea)
that means on detached from logical tree it would need removing?
Nikita Tsukanov
@kekekeks
Nov 11 2017 20:42
I don't think so
Hm...
Is TextArea rooted somewhere?
Adding a control as a child adds a reference from the child to the parent
danwalmsley
@danwalmsley
Nov 11 2017 20:44
hmmm might be this
textArea.TextView.Services.AddService(this);
which shows up on the dotmemory thing
Is TextArea rooted somewhere?
what does that mean?
Nikita Tsukanov
@kekekeks
Nov 11 2017 20:53
Is it referenced by any GC roots?
danwalmsley
@danwalmsley
Nov 11 2017 20:55
hmmm let me see
I assume dotmemory can tell me?
Nikita Tsukanov
@kekekeks
Nov 11 2017 20:57
it should
danwalmsley
@danwalmsley
Nov 11 2017 21:02
i think I'm going to give up for today :(
memory leaks make me sad
danwalmsley
@danwalmsley
Nov 11 2017 21:07
hmm looks like I have broken logical tree somehow
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:15
Does debugging works on xaml branch?
danwalmsley
@danwalmsley
Nov 11 2017 21:15
in theory it should
did it crash?
iv not tried on Linux for ages
but on windows it was working like a week or so ago
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:16
Nothing happens
Now it crashes
Hm
danwalmsley
@danwalmsley
Nov 11 2017 21:17
oh
that's just there is not sharpdx patch tool for linux
if you build it on windows
then use the dll it produces
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:18
I think I've provided you with runtime helper generator
danwalmsley
@danwalmsley
Nov 11 2017 21:18
where those methods
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:18
That doesn't require binary patching
danwalmsley
@danwalmsley
Nov 11 2017 21:18
then it will work
if you did I don't remember
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:19
Also syntax highlighting doesn't work anymore for some reason
danwalmsley
@danwalmsley
Nov 11 2017 21:19
oh yeah
you probably need a newer commit
oh
actually
update submodules
i had to make a minor change to avalonedit
that might fix it
image.png
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:20
I guess you've fixed setting highlighting method from XAML, right?
What prevents the patch tool from running on .NET Core?
danwalmsley
@danwalmsley
Nov 11 2017 21:22
i never go round to porting it
yeah highlighting method gets set from language service now
Now it got broken
And I can't find my old commit anymore
for some reason
I guess I shouldn't have checked "Allow changes from maintainers"
danwalmsley
@danwalmsley
Nov 11 2017 21:28
i have a working commit here
you on latest commit for XAML-highlight?
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:29
Mkay, eb58d2e2c8c0968482de7efc203fd4c172f66d25
seems to have working previewer
saving doesn't work, unfortunately
You've removed my logic for proper whitespace on the new lines
Like, completely
And commit doesn't exist anywhere anymore
danwalmsley
@danwalmsley
Nov 11 2017 21:32
hmmm that's supposed to be added
i think we must not be on same commit
7e8ed4?
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:33
Aaaand it crashed when I've pressed Home
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotImplementedException: The method or operation is not implemented.
at AvalonStudio.Controls.ViewLocatorDataTemplate.get_SupportsRecycling() in /home/kekekeks/Projects/AvalonStudio/AvalonStudio/AvalonStudio.Extensibility/Controls/ViewLocator.cs:line 11
at Avalonia.Controls.Presenters.ContentPresenter.CreateChild()
at Avalonia.Controls.Presenters.ContentPresenter.UpdateChild()
Wait, commits aren't removed
I'll roll back for now then
danwalmsley
@danwalmsley
Nov 11 2017 21:45
oh screen shot, yeah there was a serious issue with the data template thing
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:49
Z:\astudio\patchtool>SharpCli.exe ..\CorApi.Portable.dll
System.OutOfMemoryException: Array dimensions exceeded supported range.
at Microsoft.Cci.Pdb.MsfDirectory..ctor(PdbReader reader, PdbFileHeader head, BitAccess bits)
at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, Dictionary`2& tokenToSourceMapping, String& sourceServerData, Int32& age, Guid& guid)
at Mono.Cecil.Pdb.PdbReader.PopulateFunctions()
at Mono.Cecil.Pdb.PdbReader.ProcessDebugHeader(ImageDebugDirectory directory, Byte[] header)
at Mono.Cecil.ModuleDefinition.ProcessDebugHeader()
at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
at Mono.Cecil.ModuleReader.CreateModuleFrom(Image image, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
at SharpCli.InteropApp.PatchFile(String file)
at SharpCli.InteropApp.Main(String[] args)

That's what happens when I run the patch tool on windows
I guess it can't really handle the pdb file
danwalmsley
@danwalmsley
Nov 11 2017 21:49
oh that's the reason
it all came back now
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:49
Z:\astudio\patchtool>SharpCli.exe ..\CorApi.Portable.dll
System.NotSupportedException: Specified method is not supported.
at Mono.Cecil.PE.ImageReader.ReadArchitecture()
at Mono.Cecil.PE.ImageReader.ReadImage()
at Mono.Cecil.PE.ImageReader.ReadImageFrom(Stream stream)
at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Mono.Cecil.BaseAssemblyResolver.SearchDirectory(AssemblyNameReference name, IEnumerable`1 directories, ReaderParameters parameters)
at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
at Mono.Cecil.TypeReference.Resolve()
at SharpCli.InteropApp.PatchFile(String file)
at SharpCli.InteropApp.Main(String[] args)
That's garbage
danwalmsley
@danwalmsley
Nov 11 2017 21:50
it will only work with the old pdb format
when you build on windows
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:50
Switch to runtime helper generation
danwalmsley
@danwalmsley
Nov 11 2017 21:50
it runs that tool for you
you don't have to manually do it
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:50
Can you send me a patched version of that library?
danwalmsley
@danwalmsley
Nov 11 2017 21:50
if you build the solution without error then the file is already getting patched
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:51
That will require me to clone and build AS on my windows machine and I'm kinda afraid that your nuget packages (which tend to be ~500MB each) will eat the remaining disk space there
danwalmsley
@danwalmsley
Nov 11 2017 21:52
those are only used inside as itself
which dir is corapi.portable in?
i cant see it here
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:52
<root>/AvalonStudio/CorApi.Portable/
danwalmsley
@danwalmsley
Nov 11 2017 21:55
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:56
thanks
danwalmsley
@danwalmsley
Nov 11 2017 21:56
@kekekeks can you take a look at this
none of the items that get added show up as LogicalChildren
in logical tree? any ideas?
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:58
Does regular SelectingItemsControl still work?
danwalmsley
@danwalmsley
Nov 11 2017 21:58
I think so
Nikita Tsukanov
@kekekeks
Nov 11 2017 21:59
Are you reusing HeaderSeperatorContent?
Mkay, when I press "Debug" nothing happens
danwalmsley
@danwalmsley
Nov 11 2017 22:00
did you get a message in console?
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:00
Nope
danwalmsley
@danwalmsley
Nov 11 2017 22:00
did you set a startup (default) project?
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:00
Building works
danwalmsley
@danwalmsley
Nov 11 2017 22:00
you must also set a breakpoint
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:01
I'm using the context menu of the project
Oh
Now something has happened
Mkay, got debugger working
Thanks
It doesn't stop previewer process when I hit "Debug"
But everything mostly works
Thanks
danwalmsley
@danwalmsley
Nov 11 2017 22:03
public class DocumentTabControl : SelectingItemsControl
if I did this
then made my own template for this control
you would expect the template to become logical child right?
or do I need to do something else?
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:04
Template?
danwalmsley
@danwalmsley
Nov 11 2017 22:04
it basically has no logical children
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:04
Nope, everything in the control template
Only gets added to the visual tree
That's the whole point of logical/visual tree separation
danwalmsley
@danwalmsley
Nov 11 2017 22:05
oh yeh
of course
hmm can you open developer tools
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:05
On which version?
danwalmsley
@danwalmsley
Nov 11 2017 22:05
and have a look at the logical tree when hovering over welcome screen
your current one
or over open XAML / cs file
can you see the problem?
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:07
Unfortunately I've encountered that bug in our devtools
Where everything gets painted in blue
You are probably talking about this one
danwalmsley
@danwalmsley
Nov 11 2017 22:08
why doesn't that have any children?
this I'm sure is why I'm getting memory leak
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:09
I'd ask why are there 2 DocumentTabControls
One inside another
danwalmsley
@danwalmsley
Nov 11 2017 22:09
top one is a user control
(i know it needs renaming)
next one is a proper control
I used to have user control only
and iv been trying to fix a lot of the tabcontrol weird ness
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:10
It's probably better to not use TabControl at all
It's quite weird even in WPF
danwalmsley
@danwalmsley
Nov 11 2017 22:10
yeah
this is my own tab control
its a carousel combined with
tabstrip
for the headers
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:11
So you've replaced it with SelectingItemControl and Carousel, right?
danwalmsley
@danwalmsley
Nov 11 2017 22:11
yes
i just don't see why selectingitemcontrol isn't making the controls it materializes logical children of itself
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:12
What are you using as HeaderSeperatorContent?
danwalmsley
@danwalmsley
Nov 11 2017 22:12
<cont:DocumentTabControl.HeaderSeperatorContent>
      <Grid Background="{DynamicResource ApplicationAccentBrush}" Height="2" IsVisible="{Binding SeperatorVisible}" />
    </cont:DocumentTabControl.HeaderSeperatorContent>
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:13
Try to remove that completely
danwalmsley
@danwalmsley
Nov 11 2017 22:13
ok
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:13
and replace with " " string
Oh, separator is only used once
My bad
Nikita Tsukanov
@kekekeks
Nov 11 2017 22:18
I guess it has something to do with your control template
being different from default one
    <ControlTemplate>
      <ItemsPresenter Name="PART_ItemsPresenter"
                      Items="{TemplateBinding Items}"
                      ItemsPanel="{TemplateBinding ItemsPanel}"
                      ItemTemplate="{TemplateBinding ItemTemplate}"
                      MemberSelector="{TemplateBinding MemberSelector}"/>
</ControlTemplate>
Which contains itemspresenter
And ItemsControl has some checks for ContentControl
I'm not really familiar with this part of the code base, it's probably better to ask @grokys
danwalmsley
@danwalmsley
Nov 11 2017 23:38
hmmm this has to be some bug in avalonia
image.png
@grokys
my welcome screen view looks like this...
<ScrollViewer>
    <Grid RowDefinitions="80, *" ColumnDefinitions="250, 400, 250">
      <Grid Grid.RowSpan="2" RowDefinitions="100, *" Background="{DynamicResource ThemeControlBackgroundBrush}">
        <TextBlock FontSize="35" FontFamily="Segoe UI" FontWeight="Light" Margin="10 0">AvalonStudio</TextBlock>

        <StackPanel Gap="0" Grid.Column="0" Grid.Row="1">
          <StackPanel Margin="10 0" VerticalAlignment="Top" HorizontalAlignment="Left">
            <TextBlock Classes="h1" FontFamily="Segoe UI" FontWeight="Light">Start</TextBlock>
          </StackPanel>
          <StackPanel Margin="10 0" VerticalAlignment="Top" HorizontalAlignment="Left">
            <Button Content="New Solution" Command="{Binding NewSolution}" Classes="hyperlink h3"/>
            <Button Content="Open Solution" Command="{Binding OpenSolution}" Classes="hyperlink h3"/>
          </StackPanel>

          <TextBlock Text=" "/>
          <TextBlock Text=" "/>

          <StackPanel Margin="10 0" VerticalAlignment="Top" HorizontalAlignment="Left">
            <TextBlock Classes="h1" FontFamily="Segoe UI" FontWeight="Light">Recent Solutions</TextBlock>
          </StackPanel>

          <StackPanel Margin="10 0" VerticalAlignment="Top" HorizontalAlignment="Left">
            <ListBox Items="{Binding RecentProjects}" SelectedItem="{Binding SelectedTemplate}" BorderThickness="0">
              <ListBox.ItemTemplate>
                <DataTemplate >
                  <Button Content="{Binding Name}" Command="{Binding ClickCommand}" Classes="hyperlink h3"/>
                </DataTemplate>
              </ListBox.ItemTemplate>
            </ListBox>
          </StackPanel>
        </StackPanel>
      </Grid>
danwalmsley
@danwalmsley
Nov 11 2017 23:47
narrowing it down
danwalmsley
@danwalmsley
Nov 11 2017 23:57
@grokys ok I'm pretty sure its something in avalonia
if I remove all the extra XAML just down to this...
<UserControl xmlns="https://github.com/avaloniaui" xmlns:vm="clr-namespace:AvalonStudio.Controls;assembly=AvalonStudio" xmlns:Controls="clr-namespace:AvalonStudio.Controls;assembly=AvalonStudio.Extensibility">

  <ListBox Items="{Binding RecentProjects}" SelectedItem="{Binding SelectedTemplate}" BorderThickness="0">
    <ListBox.ItemTemplate>
      <DataTemplate >
        <Button Content="{Binding Name}" />
      </DataTemplate>
    </ListBox.ItemTemplate>
  </ListBox>
</UserControl>
it wont get GCed
if I take out the DataTemplate and manually declare some ListBoxItems
it all gets GCed just fine
I'll post a repro commit
this is the issue iv been chasing last 4-5 hours, so this is probably about as minimal a repro I can get