These are chat archives for AvaloniaUI/Avalonia

14th
Jul 2016
Jeremy Koritzinsky
@jkoritzinsky
Jul 14 2016 00:50
My initial proposal at a very basic extensibility system is here: https://github.com/AvaloniaUI/Avalonia/wiki/Avalonia-Extensibility-Proposal
We could to TypeConverters the same way as System.ComponentModel until we move to .net standard
Steven Kirk
@grokys
Jul 14 2016 00:53
yeah, an interesting idea there!
i'm kind of a little worried about changing people's app behavior unexpectedly using this, but I'm not sure how valid a worry that would be
@kekekeks would be interested to hear your thoughts
regarding TypeConverters - i was speaking to the guy who's rewriting the csproj system the other day and he says that we can keep .csproj files and target .net standard: the project.json is just needed as kind of a replacement for packages.json
so it might be less work to just do that rather than extending our TypeConverter hacks
Jeremy Koritzinsky
@jkoritzinsky
Jul 14 2016 00:57
Awesome! I say we try that out as best we can. I think I posted a link in here a few days ago about how to do that.
Steven Kirk
@grokys
Jul 14 2016 01:09
yeah... apparently the nuget project.jsons will go away but that will only be a minor change
the new csproj stuff is looking really cool btw - i think they made the right decision after speaking to him and seeing a demo of the work so far
there should be a video of the presentation at fringe online soon
Steven Kirk
@grokys
Jul 14 2016 01:22
also: this isn't certain at all, but MS might be able to help us out with performance testing infrastructure
Jeremy Koritzinsky
@jkoritzinsky
Jul 14 2016 01:25
that'd be really cool. Is that through .net foundation or through contacts as MS?
Steven Kirk
@grokys
Jul 14 2016 01:28
not sure yet how we'd be doing it - it was just from chats at fringe - need to speak to people properly about it
Jeremy Koritzinsky
@jkoritzinsky
Jul 14 2016 01:32
that's stil pretty cool.
Steven Kirk
@grokys
Jul 14 2016 01:33
yeah!
Steven Kirk
@grokys
Jul 14 2016 02:17
regarding the question of why we're not reimplementing WPF: here's a good one https://serialseb.com/blog/2007/09/03/wpf-tips-6-preventing-scrollviewer-from/
Darnell Williams
@Seeker1437
Jul 14 2016 04:39
@grokys there is a feature of binding that I am used to that does not work on AvaloniaUI
In cases where an Element's name matches the name of a property in the DataContext you can just do {Binding}
Darnell Williams
@Seeker1437
Jul 14 2016 04:45
so I can have a property inside the ViewModel which is the DataContext public bool IsReady { ... } and then an element <CheckBox Name="IsReady" IsChecked="{Binding}" /> this is vaild in WPF
Steven Kirk
@grokys
Jul 14 2016 05:03
You should be able to do that
I've done it and I think core2d does it
Darnell Williams
@Seeker1437
Jul 14 2016 12:15
it doesn't work for me
Ill just redo it though prolly my fault haha
Darnell Williams
@Seeker1437
Jul 14 2016 15:49

@jkoritzinsky I was looking at your proposal, I really like it.

@grokys @kekekeks I was curious, I want to be able to host a designer in my project, do we have some built in way Perspex can host a perspex designer? (right now our designer leverages WinForms with the interface writting in wpf

I was thinking sense we have the power couldn't we do a native one too?
Or even if you guys don't do it, do you have an idea of how it could be done?
Wiesław Šoltés
@wieslawsoltes
Jul 14 2016 19:45
Can we merge the AvaloniaUI/Avalonia#584 ?
Steven Kirk
@grokys
Jul 14 2016 20:18
ok, nobody said no, so merged :)
Wiesław Šoltés
@wieslawsoltes
Jul 14 2016 21:23
thanks
bjornjacobs
@bjornjacobs
Jul 14 2016 21:54
I just updated to the latest nightly from the alpha but now i get "Could not CreateWindow(): IWindowingPlatform is not registered." error when i start the application. Any suggestions?
Darnell Williams
@Seeker1437
Jul 14 2016 21:59
This message was deleted
Sorry about that, typing in my pocket I guess
can you share with me the ctor for your window and your app class?
@bjornjacobs
bjornjacobs
@bjornjacobs
Jul 14 2016 22:04

class App : Application
{
public App()
{
RegisterServices();
Initialize();

        //InitializeSubsystems((int)Environment.OSVersion.Platform);
        //Styles = new DefaultTheme();

         this.Initialize();
    }

    static void Main(string[] args)
    {
        var app = new App();
        var window = new MainWindow();

        window.Styles = new DefaultTheme();

        window.Show();
        app.Run(window);
    }

    public static void AttachDevTools(Window window)
    {

if DEBUG

        DevTools.Attach(window);

endif

    }

    public override void Initialize()
    {
        RegisterServices();

    }
}

}

bjornjacobs
@bjornjacobs
Jul 14 2016 22:11
public class MainWindow : Window
{
private MainViewModel _mainViewModel;
    public MainViewModel MainViewModel
    {
        get { return _mainViewModel; }
        set
        {
            _mainViewModel = value;
            this.DataContext = _mainViewModel;
        }
    }

    public MainWindow() 
    {

        this.InitializeComponent();
        this.MainViewModel = new MainViewModel();
        App.AttachDevTools(this);
    }

    private void InitializeComponent()
    {

        AvaloniaXamlLoader.Load(this);

    }

}
Darnell Williams
@Seeker1437
Jul 14 2016 22:14
Ah yeah there are a couple changes to the pattern one moment
Okay in initialize, replace the entire with just AvaloniaXamlLoader.Load(this);
in in your App.Initialize()
Darnell Williams
@Seeker1437
Jul 14 2016 22:19
Weird how the stying is diffrent for me
bjornjacobs
@bjornjacobs
Jul 14 2016 22:21
Still getting the error
Now i get this error extra:
Could not create IAssetLoader : maybe Application.RegisterServices() wasn't called?
Even if i do this:
RegisterServices();
AvaloniaXamlLoader.Load(this);
Steven Kirk
@grokys
Jul 14 2016 22:23
have you got something like this:
sorry, about the difficulty - we redid the way stuff was initialized to make it possible to share more code between desktop and mobile
Darnell Williams
@Seeker1437
Jul 14 2016 22:25
Yes, I have confused myself because my original app was still running on older version when this was still Perspex
bjornjacobs
@bjornjacobs
Jul 14 2016 22:28
My application starts but it just shows a black window
Steven Kirk
@grokys
Jul 14 2016 22:31
you also need to add a theme to App.xaml like this:
bjornjacobs
@bjornjacobs
Jul 14 2016 22:35
I added this but still a black window
Nevermind
Was stupid, when i added the new code i removed to initialize
It's working now. Thx!
Steven Kirk
@grokys
Jul 14 2016 23:00
great! :)