These are chat archives for AvaloniaUI/Avalonia

31st
Aug 2017
Wiesław Šoltés
@wieslawsoltes
Aug 31 2017 16:05
@kekekeks @danwalmsley
netcoreapp2.0 win7-x64 publish sizes for Avalonia app:
TrimUnusedDependencies + LinkDuringPublish: 37.6 MB
LinkDuringPublish: 43.0 MB
Default: 72.5 MB
danwalmsley
@danwalmsley
Aug 31 2017 17:22
Nice, what's the difference between linkduring publish only ?
Is it still stripping out framework stuff?
Wiesław Šoltés
@wieslawsoltes
Aug 31 2017 17:41
Did not try this
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 19:05
Is it possible to have a borderless window?
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:16
I'm getting some weird render issues, any way to debug this? http://i.imgur.com/E7DhHmm.png
danwalmsley
@danwalmsley
Aug 31 2017 20:21
@JurjenBiewenga what did you do to get that?
borderless window
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:21
class Program
{
    static void Main(string[] args)
    {
        AppBuilder.Configure(new Application()).UsePlatformDetect().Start<MainWindow>();
    }
}

public class MainWindow : Window
{
    public MainWindow()
    {
        this.HasSystemDecorations = false;
        this.Width = 250;
        this.Height = 100;

        this.Content = new Button();
        //this.Position = new Point(1,1);
        //this.Background = Brushes.Gray;
    }
}
danwalmsley
@danwalmsley
Aug 31 2017 20:22
set HasSystemDecorations= false
oh you already did ;)
running on windows?
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:22
Yeah
danwalmsley
@danwalmsley
Aug 31 2017 20:22
oh are you on nuget version or nightly build?
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:22
Nuget
danwalmsley
@danwalmsley
Aug 31 2017 20:23
ok this looks like something that was fixed not so long ago
Nikita Tsukanov
@kekekeks
Aug 31 2017 20:23
We might want to make an intermediate release
danwalmsley
@danwalmsley
Aug 31 2017 20:23
try using nightly build
I'm fairly sure that will fix it
Nikita Tsukanov
@kekekeks
Aug 31 2017 20:23
0.5.2-alpha-preview1 or something
danwalmsley
@danwalmsley
Aug 31 2017 20:24
yes, definitely, that's a bit of a show stopper there
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:25
Any idea on how to do that in Rider?
danwalmsley
@danwalmsley
Aug 31 2017 20:25
i know its possible
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:25
Nevermind found it
danwalmsley
@danwalmsley
Aug 31 2017 20:25
This message was deleted
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:25
It's not under settings but under the nuget window
Now how to figure how to install a nightly version
It says it is available
danwalmsley
@danwalmsley
Aug 31 2017 20:28
in visual studio you have to specify you want pre-release versions
did you manage to install it?
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:28
Yeah got it
There is a toggle and then you have to switch to the avalonia feed only
Then there is an update button
Kinda weird
danwalmsley
@danwalmsley
Aug 31 2017 20:29
visual studio also similar
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:29
danwalmsley
@danwalmsley
Aug 31 2017 20:29
wow I'm surprised
can you try with system decorations on
and resize the windows
see if it then renders correctly
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:30
Still broken with system decorations on
danwalmsley
@danwalmsley
Aug 31 2017 20:30
even if you resize the window?
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:30
Not broken without a custom size
danwalmsley
@danwalmsley
Aug 31 2017 20:30
ok
i will open an issue for you
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:30
Resizing fixes it as well
danwalmsley
@danwalmsley
Aug 31 2017 20:31
i thought it might
we recently had a very similar think with popups
never realised window was affected
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:32
Happens
Any way to force a repaint for now?
danwalmsley
@danwalmsley
Aug 31 2017 20:33
@kekekeks do you know which issue we were tracking the window / popup resize render issue?
you could try:
Dispatcher.UIThread.Invoke(()=>{this.InvalidateVisual();};
from memory, IntelliSense might show you slightly different method name...
that may work, although it also may not!
i think it will decide nothing has changed since last render
you could do this though and it should work
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:35
It doesnt :(
danwalmsley
@danwalmsley
Aug 31 2017 20:36
 public MainWindow()
    {
        this.HasSystemDecorations = false;

Dispatcher.UIThread.Invoke(()=>{
        this.Width = 250;
        this.Height = 100;
});

        this.Content = new Button();
        //this.Position = new Point(1,1);
        //this.Background = Brushes.Gray;
    }
see if that fixes it
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:36
Nope
danwalmsley
@danwalmsley
Aug 31 2017 20:37
Try adding an
await Task.Delay(250);
before setting the width
i know its horribly hacky
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:38
Still not
danwalmsley
@danwalmsley
Aug 31 2017 20:39
why not define mainWindow in XAML?
i think it will make the issue go away
(only because it will mask the bug)
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:41
Eh, need to create the content through code so might as well do the rest as well
And it's fairly simple
Just a few buttons and a few lines of text
danwalmsley
@danwalmsley
Aug 31 2017 20:42
if you do this...
MainWindow.xaml (Set as embedded resource)
<Window xmlns="https://github.com/avaloniaui" MinWidth="500" MinHeight="300" />
then
public class MainWindow : Window
    {
        public MainWindow()
        {
            this.InitializeComponent();
            this.AttachDevTools();

            this.Content = //// you code here
        }

        private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);
        }
    }
you will get the window to be initialized via the XAML parser (and probably render correctly)
and also you can then define the content in code as before
just 1 line of XAML :)
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:46
Let me figure that out in Rider
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 20:53
@danwalmsley Can't seem to get it working, any ideas on how to do it in visual studio?
danwalmsley
@danwalmsley
Aug 31 2017 21:25
Add the .xaml file
It has to be named the same as the class
Not inside a folder, unless the class has an extra namespace
And set to embedded resource on compile option (right click properties on file)
See the net core example app
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 21:33
Yeah that is what I have
Error: assembly specified in the dependencies manifest was not found -- package:
'consoleapplication2', version: '1.0.0', path: 'cs/ConsoleApplication2.resource
s.dll'
Jurjen Biewenga
@JurjenBiewenga
Aug 31 2017 21:41
Okay, stripped the example from most things
danwalmsley
@danwalmsley
Aug 31 2017 22:47
Still corruption with XAML
I will try and repro the issue in the morning