These are chat archives for AvaloniaUI/Avalonia

18th
Aug 2016
Andrew
@zezba9000
Aug 18 2016 02:39
blob
I'm getting that error in AvaloniaVS
...when trying to open the xaml from the MainWindow
blob
Or sometimes I get that one
Restated VS fixed it but odd issue.
Andrew
@zezba9000
Aug 18 2016 03:39

Is there a password box?
or a way to hide passwords text with dots?
Jason Jarvis
@jazzay
Aug 18 2016 06:28
hey guys. I was trying to help @galvesribeiro get his project set up, and we noticed that Avalonia.Win32 is missing from the Avalonia.Desktop nuget. Can someone fix that soon?
James Walmsley
@jameswalmsley
Aug 18 2016 07:26
@galvesribeiro to make it work on linux with Gtk you have to build a native-library of Skia for SkiaSharp. I couldn't make it work with the Avalonia.Skia shared project because I couldn't get at the Gtk references. So that I could just get-on with it, I copied the sources into my own Avalonia.Skia.Linux project where I could manage the references.
You can see that on my pull request: #685 - I ignored the other platforms code, and adapted for Gtk. I need to clean up the whole thing and merge it correctly. Possibly optimise the way it works a little.
As regards to the HW acceleration, I think that Skia by default tries to use it, and they have an option that allows you to force sw rendering on if you want. So if you have no GPU available it will fall back to SW rendering nicely.
Steven Kirk
@grokys
Aug 18 2016 09:16
@zezba9000 no TextBox.PasswordChar or similar yet
danwalmsley
@danwalmsley
Aug 18 2016 11:55
@grokys could I just disable the failing cairo tests for now? to get builds through?
Steven Kirk
@grokys
Aug 18 2016 11:59
let me try and fix the tests
Steven Kirk
@grokys
Aug 18 2016 12:07
ok, it's not the tests that are broken, it's the code
Steven Kirk
@grokys
Aug 18 2016 12:14
reverted the PR which introduced the problem
Steven Kirk
@grokys
Aug 18 2016 12:22
arrgh that one intermittently failing test is really annoying! i have no idea why its happening
danwalmsley
@danwalmsley
Aug 18 2016 12:26
not again!!!
Steven Kirk
@grokys
Aug 18 2016 12:47
ok, i've maybe fixed that intermittent fail
hard to say for definite though
CI now building on master
danwalmsley
@danwalmsley
Aug 18 2016 12:48
:) awesome thanks
do we have render tests for skia backend?
Gutemberg Ribeiro
@galvesribeiro
Aug 18 2016 13:53
@jameswalmsley yeah I did copied the shared project in my own platform project. All the rest is using the nugets. @jazzay built for me a barebone project for testing which is based on win32 but already using my modified project. I will now start moving the building blocks to make it work.
Somethhing I dont know is how should I make that thread loop thing
all other platforms has a Window manager and it has its own main thread
I just dont knwo how to implement mine properly there
But lets try
Nelson Carrillo
@nc4rrillo
Aug 18 2016 14:10
sorry I broke Cairo render tests! D:
Steven Kirk
@grokys
Aug 18 2016 14:33
:D
danwalmsley
@danwalmsley
Aug 18 2016 14:44
@galvesribeiro I have managed to implement a thread loop in AvalonStudio,,, I think it might work for you
let me find link to code...
its a modification of the one inside avalonia
to support general purpose job queueing
ok you start the queue like this...
transmitRunner = new JobRunner();

            Task.Factory.StartNew(() =>
            {
                closeTokenSource = new CancellationTokenSource();

                transmitRunner.RunLoop(closeTokenSource.Token);

                transmitRunner = null;
            });
and then you can post work to the queue like this...
await transmitRunner.InvokeAsync(() =>
            {
                                //DO Work here
            });
(you can choose if you need to await the job to complete or not.)
might work for your thread loop?
danwalmsley
@danwalmsley
Aug 18 2016 14:49
the close token source gives you a way to terminate the thread at anytime.
Gutemberg Ribeiro
@galvesribeiro
Aug 18 2016 15:04
@danwalmsley hummm interesting
let me experiment with that. thanks
so I should probably implement IPlatformThreadingInterfacewith that
danwalmsley
@danwalmsley
Aug 18 2016 15:06
the runloop bit you can, the start timer but you would have to add something for that
Gutemberg Ribeiro
@galvesribeiro
Aug 18 2016 15:09
I basically got the iOS implementation here
captured the main thread when it is created
 PlatformThreadingInterface()
        {
            _mainThread = Thread.CurrentThread;
        }
 public void RunLoop(CancellationToken cancellationToken)
        {
            do
            {
                OnFrame();
                Thread.Sleep(30);
            } while (!cancellationToken.IsCancellationRequested);
        }
 public IDisposable StartTimer(TimeSpan interval, Action tick)
        {
            lock (_lock)
            {
                var timer = new Timer(tick, interval);
                _timers.Add(timer);
                return Disposable.Create(() =>
                {
                    lock (_lock) _timers.Remove(timer);
                });
            }
        }
public bool CurrentThreadIsLoopThread => _mainThread == Thread.CurrentThread;
thats it
but I'm pretty sure that will not work :)
Nelson Carrillo
@nc4rrillo
Aug 18 2016 16:44
I think I may have worked out why timers seem to fire after they're disabled
may have to do with timer messages sitting in the event queue after KillTimer has been called
We call PeekMessage with PM_NOREMOVE which may generate a WM_TIMER message, it'll sit in our queue and be processed next time we get a message out, sometime after IsEnabled = false
gotta do some testing when I get home to confirm :D
Steven Kirk
@grokys
Aug 18 2016 17:22
i can't see any mention of PM_NOREMOVE in our code
ah I see - PeekMessage with the last param as 0 is PM_NOREMOVE
Steven Kirk
@grokys
Aug 18 2016 17:42
blob
new data validation stuff coming along...
blob
Nelson Carrillo
@nc4rrillo
Aug 18 2016 17:54
That's awesome!
Reed Copsey, Jr.
@ReedCopsey
Aug 18 2016 17:59
@grokys What types are you using for validation?
IDataErrorInfo/INotifyDataErrorInfo? or other approaches?
Steven Kirk
@grokys
Aug 18 2016 18:00
ah ok. yeah at the moment exceptions and INotifyDataErrorInfo, but intending to put in IDataErrorInfo and data annotations support
the validation system is pluggable though :)
Reed Copsey, Jr.
@ReedCopsey
Aug 18 2016 18:00
nice
INotifyDataErrorInfo should amke a lot of things "just work" then ;)
Nelson Carrillo
@nc4rrillo
Aug 18 2016 18:21
only strange thing re:timers is that it also happens on Linux/GTK. I wonder if its related to how we currently cancel them though, we only abort on the very next tick
since we return false from the callback
Steven Kirk
@grokys
Aug 18 2016 18:22
hmm yeah that might be it
Steven Kirk
@grokys
Aug 18 2016 18:31
oh it seems that IDataErrorInfo isn't available on our PCL profile
Steven Kirk
@grokys
Aug 18 2016 18:59
neither are System.ComponentModel.DataAnnotations...
Steven Kirk
@grokys
Aug 18 2016 19:21
ah! awesome!
Steven Kirk
@grokys
Aug 18 2016 19:30
hmm
Multiple assemblies with equivalent identity have been imported: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile7\System.ComponentModel.Annotations.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6\Facades\System.ComponentModel.Annotations.dll'. Remove one of the duplicate references.
any idea?
that happens when i add the nuget to Avalonia.Markup and then try to use the RangeAttribute in Avalonia.Markup.UnitTests
Wiesław Šoltés
@wieslawsoltes
Aug 18 2016 19:33
maybe unit test projects is targeting .NET 4.6
Steven Kirk
@grokys
Aug 18 2016 19:35
yeah it is, but that's not the problem
the problem is that there are two assemblies that define the attribute
Wiesław Šoltés
@wieslawsoltes
Aug 18 2016 19:37
maybe dependencies (NuGet's) referenced in Avalonia.Markup.UnitTests depended on 'Assemblies\Microsoft\Framework.NETFramework\v4.6\Facades\System.ComponentModel.Annotations.dll'
usually when I retarget .NET 4.6 to .NET 4.5 I also reinstall all nugets
so they pull correct version of dependencies
Steven Kirk
@grokys
Aug 18 2016 19:41
let me try that then
Steven Kirk
@grokys
Aug 18 2016 20:04
ok thanks - that seems to have worked... no idea what was wrong before
danwalmsley
@danwalmsley
Aug 18 2016 20:26
@grokys I'm keen to try and implement embedding custom fonts, do you have any thoughts on how I could approach it?
Steven Kirk
@grokys
Aug 18 2016 20:26
n.o.i.d.e.a - sorry!
danwalmsley
@danwalmsley
Aug 18 2016 20:26
ok, no worries
Darnell Williams
@Seeker1437
Aug 18 2016 21:13
@galvesribeiro trying to get Avalonia on Pi again?
Gutemberg Ribeiro
@galvesribeiro
Aug 18 2016 21:16
@Seeker1437 yes, this time close :)
Darnell Williams
@Seeker1437
Aug 18 2016 21:17
Woot
Steven Kirk
@grokys
Aug 18 2016 21:22
blob
Gutemberg Ribeiro
@galvesribeiro
Aug 18 2016 21:24
@grokys :+1:
Darnell Williams
@Seeker1437
Aug 18 2016 21:31
@galvesribeiro how off was I when I was trying to help? Lol.
Gutemberg Ribeiro
@galvesribeiro
Aug 18 2016 21:31
I tried all over from scratch
James Walmsley
@jameswalmsley
Aug 18 2016 21:40
Can bindings implement format string yet?
i.e. {Binding Value, FormatString= #.00}
Nelson Carrillo
@nc4rrillo
Aug 18 2016 22:47
Validation stuff is so hot 🙂
Darnell Williams
@Seeker1437
Aug 18 2016 23:02
@jameswalmsley I dont believe so atm
James Walmsley
@jameswalmsley
Aug 18 2016 23:10
blob
I've been making a little remote control for my lab power-supply in Avalonia, it controls a Rigol DP832 over the network.