These are chat archives for AvaloniaUI/Avalonia

30th
Jun 2017
danwalmsley
@danwalmsley
Jun 30 2017 10:18
@kekekeks any ideas exactly what editbin does when you use it to patch exe to get rid of console, I'm wondering if I'm using a Linux build server could I manage to do the same thing?
is it just replacing some bytes in the file somewhere?
Eric Mellino
@mellinoe
Jun 30 2017 10:21
@danwalmsley I'd very much like to know that as well, for the same reason. I'm pretty sure it's just replacing some bytes in some header, but I never found anything specific.
danwalmsley
@danwalmsley
Jun 30 2017 12:06
@mellinoe I added an issue to dotnet cli repo dotnet/coreclr#12548
to get it supported on other platforms, maybe you can get the right people to see the issue
@grokys getting crashes on this line:
everynow and again
private void Arrange(ILayoutable control)
        {
            if (control.VisualParent is ILayoutable parent)
            {
                Arrange(parent);
            }

            if (!control.IsArrangeValid && control.IsAttachedToVisualTree)
            {
                if (control is ILayoutRoot root)
                {
                    root.Arrange(new Rect(control.DesiredSize));
                }
                else
                {
                    control.Arrange(control.PreviousArrange.Value);
                }
            }
        }
control.PreviousArrange is null
and it crashes my app
(this is on scenegraph)
Nikita Tsukanov
@kekekeks
Jun 30 2017 12:31
@danwalmsley It's fairly easy to patch PE file using managed code
I had a C# program that was doing exactly that, but it seems to be lost on some old hard drive
You need to change Subsystem field of IMAGE_OPTIONAL_HEADER structure
This should help you to get the offset
Nikita Tsukanov
@kekekeks
Jun 30 2017 12:36
Basically the last field of MSDOS file header (e_lfanew) holds the offset to IMAGE_NT_HEADERS
So you need to read e_lfanew, add known offset to it
And you get the position in the file with subsystem field
Steven Kirk
@grokys
Jun 30 2017 12:59
ah @danwalmsley that should have already been fixed on master - I need to do a merge
danwalmsley
@danwalmsley
Jun 30 2017 13:04
do you mind if I press the button to update it with master?
I can continue testing then
Steven Kirk
@grokys
Jun 30 2017 13:04
sure, if it merges without conflicts, go for it!
i assumed there's be a conflict somewhere
danwalmsley
@danwalmsley
Jun 30 2017 13:05
done
Steven Kirk
@grokys
Jun 30 2017 13:05
there usually is
cool, thanks
danwalmsley
@danwalmsley
Jun 30 2017 13:05
no conflicts this time ;)
@mellinoe have you ever noticed on netcoreapp if you run Process.Start("cmd.exe") its not possible to get cmd.exe to open in a new window
any ideas why this is?
danwalmsley
@danwalmsley
Jun 30 2017 13:57
@grokys is the calling WindowFramebuffer with zero height / width bug an easy one to fix
Steven Kirk
@grokys
Jun 30 2017 14:01
i imagine - not had time to look into it yet though, sorry
Nikita Tsukanov
@kekekeks
Jun 30 2017 15:03
@danwalmsley console subsystem apps "inherit" parent's console
danwalmsley
@danwalmsley
Jun 30 2017 15:30
ah
iv managed to find a workaround "hack"
Process.Start("cmd.exe" "/c start cmd.exe");
which works
but I guess once the build is patched with editbin it would have worked anyway
danwalmsley
@danwalmsley
Jun 30 2017 15:47
@grokys with latest scenegraph is seems there is no way to give treeviewers itemspanel a background
so it only receives mouse hits were there are text inside tree view
so scrolling is a bit difficult
Steven Kirk
@grokys
Jun 30 2017 15:48
ah
will fix :+1:
danwalmsley
@danwalmsley
Jun 30 2017 15:48
not sure how to get a background in there
Steven Kirk
@grokys
Jun 30 2017 15:50
does adding <Setter Property="Background" Value="Transparent"/> to this line https://github.com/AvaloniaUI/Avalonia/blob/dc7a50812d625c22f782959eefbd537493abbfd8/src/Avalonia.Themes.Default/TreeView.xaml#L2 fix it?
oh no
i think you need to add that to the TreeViewItem template
danwalmsley
@danwalmsley
Jun 30 2017 15:53
  <Controls:ToolControl Title="Solution Explorer">
    <TreeView BorderThickness="0" Background="{StyleResource ThemeControlDarkBrush}" Items="{Binding Solution}" SelectedItem="{Binding Path=SelectedItem, Mode=TwoWay}">
      <TreeView.Styles>
        <Style Selector="TreeViewItem">
          <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
        </Style>
        <Style Selector="TreeViewItem:selected /template/ ContentPresenter#PART_HeaderPresenter">
          <Setter Property="Background" Value="#0F63BA" />
        </Style>
      </TreeView.Styles>
      <TreeView.DataTemplates>
        <TreeDataTemplate DataType="ViewModels:SolutionViewModel" ItemsSource="{Binding Projects}">
          <TextBlock Text="{Binding Title}">
            <TextBlock.ContextMenu>
              <ContextMenu>
                <MenuItem Header="Run All Tests" />
                <MenuItem Header="Configuration" />
                <MenuItem Header="Build Solution" />
                <MenuItem Header="Rebuild Solution" />
                <MenuItem Header="Clean Solution" />
                <Separator />
                <MenuItem Header="Add">
                  <MenuItem Header="New Project..." Command="{Binding NewProjectCommand}" />
                  <MenuItem Header="Existing Project..."  Command="{Binding AddExistingProjectCommand}"/>
                  <MenuItem Header="New Solution Folder..." />
                </MenuItem>
                <Separator />
                <MenuItem Header="Open Containing Folder"  Command="{Binding OpenInExplorerCommand}"/>
              </ContextMenu>
            </TextBlock.ContextMenu>
          </TextBlock>
        </TreeDataTemplate>

        <TreeDataTemplate DataType="ViewModels:StandardProjectViewModel" ItemsSource="{Binding Items}">
          <StackPanel Orientation="Horizontal" IsVisible="{Binding IsVisible}">
            <StackPanel.ContextMenu>
              <ContextMenu>
see this for example
id have to add it in a lot of places
I'm not sure on wpf Id have to add this.
I can do it with a selector actually
danwalmsley
@danwalmsley
Jun 30 2017 16:01
ok I found a fix....
not sure if its correct
change template to this...
        <ControlTemplate>
            <Border Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}">
                <ScrollViewer CanScrollHorizontally="True">
                    <Grid Background="Transparent">
                        <ItemsPresenter Name="PART_ItemsPresenter"
                                        Items="{TemplateBinding Items}"
                                        ItemsPanel="{TemplateBinding ItemsPanel}"
                                        Margin="{TemplateBinding Padding}"
                                        MemberSelector="{TemplateBinding MemberSelector}" />
                    </Grid>
                </ScrollViewer>
            </Border>
        </ControlTemplate>
so adding a <Grid> with a transparent background
but could also be
 <ScrollViewer CanScrollHorizontally="True">
                    <Grid Background="{TemplateBinding Background}">
                        <ItemsPresenter Name="PART_ItemsPresenter"
                                        Items="{TemplateBinding Items}"
                                        ItemsPanel="{TemplateBinding ItemsPanel}"
                                        Margin="{TemplateBinding Padding}"
                                        MemberSelector="{TemplateBinding MemberSelector}" />
                    </Grid>
                </ScrollViewer>
so user gets control of it
curiously how can you have no background Background="" ???
iv added comments about this to #827
Steven Kirk
@grokys
Jun 30 2017 16:06
Ah I assumed you had it checked out, I mean add it to the solution in Avalonia
Steven Kirk
@grokys
Jun 30 2017 16:11
Just to be clear: the problem is selecting the items in the tree view, is that correct?
Ah no, you mentioned scrolling, sorry
On mobile
Scrolling how? With the scroll bars?
Eric Mellino
@mellinoe
Jun 30 2017 19:01
@danwalmsley I've proposed a similar thing in dotnet/core-setup#196. Hopefully I can convince folks on the team that it is worth doing -- there's been a lot of resistance to the idea.
Of course, every extra voice helps
Eric Winnington
@ewinnington
Jun 30 2017 19:53
I just had a skype call with a Microsoft progam manager asking about desktop development, I mentioned Avalonia and
he was aware of your developments. I hope Avalonia gets some more help and awareness.
Steven Kirk
@grokys
Jun 30 2017 21:57
@ewinnington cool! glad that people are aware!
@danwalmsley https://github.com/AvaloniaUI/Avalonia/pull/827/commits/cb9e9a196d7a66df226632efda7a97b509e1b17b fixes the WindowFramebuffer problem you were seeing - not sure if it's the correct fix however
Steven Kirk
@grokys
Jun 30 2017 22:15
also i see what you're saying about the treeview now - will fix
Steven Kirk
@grokys
Jun 30 2017 22:48
@danwalmsley should have fixed the scrolling issue too now
thanks for testing this!