These are chat archives for AvaloniaUI/Avalonia

13th
Nov 2018
Nikita Tsukanov
@kekekeks
Nov 13 2018 07:22
@Gillibald "last activated" window might be not the window which activated the dialog
I just want to keep the framework cross-platform even if it means some inconvenience for app developers who are accustomed with how Windows handles things
And people often mess up file dialogs even in WinForms/WPF applications, so it's better to force them to behave properly
ahopper
@ahopper
Nov 13 2018 07:45
Talking of dialogs, what mvvm dialog approaches are people using in Avalonia?
ahopper
@ahopper
Nov 13 2018 07:55
could we have some sort of bindable dialog launcher control
Steven Kirk
@grokys
Nov 13 2018 09:31
@donandren i see you're trying to get azure pipelines working
i need to enable submodule restore on that project, one sec
that way you won't need to do it manually
Andrey Kunchev
@donandren
Nov 13 2018 09:32
@grokys lol yes
Steven Kirk
@grokys
Nov 13 2018 09:33
ok, i've enabled submodule checkout
Benedikt Schroeder
@Gillibald
Nov 13 2018 09:40
I wonder what is wrong about using modal windows. As far as I understand the dialog rework uses child windows. The only advantage is that you can have dialogs per window and not just per application. Is that a natural behavior? Does someone know of an application that uses that approach? Even OSX has runModal to show a dialog per application and the concept of a main window. I think runModal should be the default. It someone wanted to show a dialog that is attached to a specific window you can always set the owner property before showing the window.
Nikita Tsukanov
@kekekeks
Nov 13 2018 09:51
X11 doesn't have application-modal windows
It has "window groups"
But application doesn't necessary has all of it's windows in the same window group
Since groups are also used for taskbar grouping
Which sometimes isn't a desired behavior
In case of OSX, NSModalSession prevents us from running our own event loop
Nikita Tsukanov
@kekekeks
Nov 13 2018 09:57
Another problem is what happens if someone decides to show multiple dialogs at the same time
In case of dialog windows with a parent, they only block their parent
(which, in turn, might be blocking it's own parent)
In case of orphan dialogs, it's quite tricky
Especially if dialogs are closed out of order
Our current implementation doesn't support such scenarios properly, BTW
We might return the support for orphaned dialogs later in the future when these concerns are resolved
But current implementation is broken anyway, so I'd rather enforce dialogs to have a parent, at least for now
There was quite a lot of confusion with file dialogs "not being shown" when people decided to pass null as a parent
Nikita Tsukanov
@kekekeks
Nov 13 2018 10:04
I guess I need to document it somewhere other than gitter chat
Benedikt Schroeder
@Gillibald
Nov 13 2018 10:04
Sry for bringing up this discussion. I now understand why you choose that approach. It brings the most freedom.
Nikita Tsukanov
@kekekeks
Nov 13 2018 10:05
Things like that need to be discussed
One can't just make design decisions without consulting people first
sorry if I sometimes sound offensive, it's just my style of speech (I'm trying to work on it and failing miserably)
ReIaxo
@ReIaxo
Nov 13 2018 11:00
Is it possible to run an application on Android at the moment? How can i do that?
Steven Kirk
@grokys
Nov 13 2018 11:51
@ReIaxo there is android support, but it's very experimental and i think unmaintained, so it might not even work
i don't know if anyone's tried it recently
there are certainly a lot of limitations even if it does work
it's more a proof-of-concept than anything i think
ReIaxo
@ReIaxo
Nov 13 2018 12:44
@grokys Yes, that's all i want, a proof-of-concept. I only want to see a minimal application like the Hello World example with an additional Button or sth. like that. And i need to know how to do it. There is not "publish for Android" like it exists for Linux or MacOs
that uses xamarin
braca
@braca
Nov 13 2018 12:51
Is there any kind of intellisense in xaml editor (Visual Studio for Windows) I have the Avalonia Plugin (that brings the Designer)?
bit bonk
@bitbonk_twitter
Nov 13 2018 13:12
is avalonia a write-once-compile-anywhere (WOCA) type of framework?
or more like Xamarin ?
Benedikt Schroeder
@Gillibald
Nov 13 2018 13:17
Do you think it is possible to use ANGLE for DirectX interop and remove the D2D backend for a smaller code base but still support DirectX?
ahopper
@ahopper
Nov 13 2018 13:40
@braca there should be but it seems broken for a lot of people, I think it is being fixed here AvaloniaUI/AvaloniaVS#76
Andrey Kunchev
@donandren
Nov 13 2018 13:47
that's correct @ahopper, @braca designer is completely functional in AvaloniaUI/AvaloniaVS#76, preview version can be downloaded at https://drive.google.com/open?id=19nhPUSlYlvaYugSkp9E7ENnZ6B3QvvyJ everything is expect to be working pretty much stable
Callum
@CallumDev
Nov 13 2018 14:04
does avalonia expect to own the entire window it renders on?
or would it be possible for me to make an opengl backend to embed an avalonia control or two into my game?
braca
@braca
Nov 13 2018 14:17
@ahopper @donandren I'll try that version, thanks
Nikita Tsukanov
@kekekeks
Nov 13 2018 14:20
@Gillibald skia backend is currently capable of using ANGLE
Whether we want to get rid of Direct2D is a different question
@CallumDev it's possible, but you need to basically implement a windowing platform backend
Most of the interfaces could be implemented as stubs but IPlathormThreadingInterface, ITopLevelImlp and IPopupImpl are mandatory
You'll also need to provide opengl-related interfaces if you want hw-acceleration
MonkAlex
@MonkAlex
Nov 13 2018 16:58
Can anyone open #1801 or i need create new issue?
Steven Kirk
@grokys
Nov 13 2018 17:00
reopened
Benedikt Schroeder
@Gillibald
Nov 13 2018 17:01
I thought we were were already using GetProcAddress for that call.
Nikita Tsukanov
@kekekeks
Nov 13 2018 17:02
P/Invoke layers uses GetProcAddress on first call, so we could just check if it throws an exception
MonkAlex
@MonkAlex
Nov 13 2018 19:04
Has avalonia any api to get display settings changed?
In wpf use Microsoft.Win32.SystemEvents.DisplaySettingsChanged event
Want to move app, when second monitor disabled
MonkAlex
@MonkAlex
Nov 13 2018 19:28
How to set window size and position on load?
In wpf used:
          main.Top = ...;
          main.Left = ...;
          main.Width = ...;
          main.Height = ...;
Wiesław Šoltés
@wieslawsoltes
Nov 13 2018 19:32
set Position, Width and Height
MonkAlex
@MonkAlex
Nov 13 2018 19:32
Oh, thanks
MonkAlex
@MonkAlex
Nov 13 2018 19:46
So hard change terms
main.Position = new Point(config.Left, config.Top);
two times try to change left and top in point :D
Nikita Tsukanov
@kekekeks
Nov 13 2018 20:06
BTW, you won't be able to do that with Wayland on Linux
They don't have window positioning API
ahopper
@ahopper
Nov 13 2018 21:30
I've been working on a VirtualizingGridPanel that initially just wraps as many fixed size items as it can on a line. To make scrolling work in a line by line basis I've had to tweak the IVirtualizingPanel interface to include a ScrollQuantum property and fight with ItemVirtualizerSimple which rather assumes only 1 item of overflow and 1d virtualization. I just wondered if anyone had a long term plan/ thoughts or WIP on more flexible virtualization.
ahopper
@ahopper
Nov 13 2018 21:37
or smooth scrolling
Wiesław Šoltés
@wieslawsoltes
Nov 13 2018 21:53
Is it possible to validate TextBox.TextProperty without data binding ?
I want to set Text property from code behind or by user and do not use data binding.
something like _hexText.GetObservable(TextBox.TextProperty).Validate(x => ??).Subscribe(x => UpdateOnHexChange());
ahopper
@ahopper
Nov 13 2018 22:33
I've not tried that but why not just bind your TextBox to the view/code behind.
Wiesław Šoltés
@wieslawsoltes
Nov 13 2018 22:35
I am observing 4 properties from another control and emulate two-way multi value binding
Wiesław Šoltés
@wieslawsoltes
Nov 13 2018 22:46
Managed to solve the issue by creating AvaloniaProperty on UserControl
Anyway it would be nice to have some quick validation hooks for properties
nicolasr75
@nicolasr75
Nov 13 2018 23:00
Is it possible to change the width of scrollbars in a scrollviewer? I have an app that runs on a Raspberry with touchscreen only. Scrolling by dragging the content doesn't yet seem to work so it would be nice to have larger scrollbars.
Wiesław Šoltés
@wieslawsoltes
Nov 13 2018 23:06
        <Style Selector="ScrollBar:vertical">
            <Setter Property="Width" Value="20" />
        </Style>
Steven Kirk
@grokys
Nov 13 2018 23:17
yeah we should probably add resources for stuff like that
so it can be overridden
Wiesław Šoltés
@wieslawsoltes
Nov 13 2018 23:21
something like <sys:Double x:Key="ScrollBarSize">10</sys:Double> ?
or
        <sys:Double x:Key="ScrollBarWidth">10</sys:Double>
        <sys:Double x:Key="ScrollBarHeight">10</sys:Double>
Wiesław Šoltés
@wieslawsoltes
Nov 13 2018 23:29
my proposal
:smile: