These are chat archives for AvaloniaUI/Avalonia

28th
Jan 2019
it seems the stroke prop is not being read or written.
nvm it seems to have fixed it self when I changed it to the stroke to blue...
still starts off in the wrong spot.
James Burnside
@JCBurnside
Jan 28 04:29
I must be doing something wrong with my styling or how I am declaring my StyledProperty
ahopper
@ahopper
Jan 28 05:45
Glad it's working, I think the initial positioning is because Bounds is not properly set by the time the first time Lines is calculated
James Burnside
@JCBurnside
Jan 28 06:07
am I doing something wrong with the StrokeProperty?
ahopper
@ahopper
Jan 28 06:09
what is it doing wrong?
James Burnside
@JCBurnside
Jan 28 06:11
Portable.Xaml.XamlObjectWriterException: Could not convert object 'Stroke' (of type System.String) to {clr-namespace:Avalonia;assembly=Avalonia.Base}AvaloniaProperty: Could not find property 'Control.Stroke'. ---> Avalonia.Markup.Xaml.XamlLoadException: Could not find property 'Control.Stroke'. is the error it is giving (as well as something about Lines idk about that one) when I have
    <Window.Styles>
        <Style Selector="Star.Blue">
            <Setter Property="Stroke" Value="Blue"/>
        </Style>
ahopper
@ahopper
Jan 28 06:26
I think you need Selector="v|Star.Blue"
James Burnside
@JCBurnside
Jan 28 06:37
ah. I had tried v:Star.blue. so | is the namespace op in the selectors? that isn't documented anywhere I could find.
well it seems to have fixed the error but still doesn't work.
still comes out silver
ahopper
@ahopper
Jan 28 06:40
James Burnside
@JCBurnside
Jan 28 06:41
welp I just missed it then.
ahopper
@ahopper
Jan 28 06:44
odd that it doesn't work though
James Burnside
@JCBurnside
Jan 28 06:46
ahopper
@ahopper
Jan 28 06:48
yep that is normal, the system does not call those methods, they are just nice accessors for humans to call
James Burnside
@JCBurnside
Jan 28 06:48
Got it. I figured it was because of reflection magic
ahopper
@ahopper
Jan 28 07:02
there does appear to be something odd about styling usercontrols
setting the background using that selector also does nothing
James Burnside
@JCBurnside
Jan 28 07:10
Bug?
ahopper
@ahopper
Jan 28 07:12
not sure, I'll have a play.
ahopper
@ahopper
Jan 28 07:59
I think part of the problem is the StyleKey for all UserControls is UserControl so you can match on UserControl.blue but then stroke is not a valid property @grokys ?
Steven Kirk
@grokys
Jan 28 08:37
hmm, yeah, i think the problem is like @ahopper says @JCBurnside. the style key for controls derived from UserControl is UserControl so Star isn't matching anything
you could set the style key to Star but then you'll have to provide your own control template
i wonder how this works on WPF/UWP?
Benedikt Schroeder
@Gillibald
Jan 28 08:51
Maybe under WPF you can use TargetType=Star and by default the base template is inherited?
Steven Kirk
@grokys
Jan 28 09:03
need to check
Luis von der Eltz
@toytonics
Jan 28 09:51
        private IEnumerable<TickViewModel> _ticks;

        public IEnumerable<TickViewModel> Ticks
        {
            get => _ticks;
            set => SetAndRaise(TicksProperty, ref _ticks, value);
        }

        static TickMarksControl()
        {
            MaximumProperty.Changed.Subscribe(x =>
            {
                (x.Sender as TickMarksControl)?.GenerateTicks();
            });
        }

        private void GenerateTicks()
        {
            if (Maximum == 0 || Step == 0)
            {
                return;
            }

            var output = new List<TickViewModel>();
            for (var i = 0; i <= 200; i += 2)
            {
                output.Add(new TickViewModel(i, false, false));
            }

            Ticks = output;
        }
This code is freezing in StableCompositeDisposable.cs:119. The higher I set the 200 the longer it freezes. Any ides why this isn't working?
ReIaxo
@ReIaxo
Jan 28 10:40
@kekekeks I tried your nuGet package. the MVVM-Template now works on my RaspberryPi 2B with your libSkiaSharp.so.
Thank your for the NuGet package!
Luis von der Eltz
@toytonics
Jan 28 13:13
It seems to be a virtualization issue. Using a ListBox resolved the probkem. ItemsControls does not support virtualization ,right?
Benedikt Schroeder
@Gillibald
Jan 28 13:16
It doesn't yes. Consider ItemsControl as a base class.
Luis von der Eltz
@toytonics
Jan 28 14:07
all right! is there any way to disable scrolling for listboxes?
ahopper
@ahopper
Jan 28 14:27
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
in listbox tag
Benedikt Schroeder
@Gillibald
Jan 28 17:31
I wonder how much of an improvement it would give compiling Skia with Clang for Windows. Sadly I am not used to all these tool chains. Using gn or cmake to generate build targets would be ideal. That way it is easier to support more platforms and archs etc. Hopefully the Android builds use Clang by default. On mobile this is even more important.
ahopper
@ahopper
Jan 28 18:05
my guess is that that ( as skia uses lots of optimized simd code for key stuff) the compiler won't make that much difference but I'm interested to know the reality
jp2masa
@jp2masa
Jan 28 22:19
it looks like #2209 broke something for custom controls: the properties aren't listed in dev tools for most custom controls, and sometimes if I open the dev tools, then ctrl + shift on a control, and click on the dev tools window, an exception is thrown (duplicate key), I reverted to the version before it was merged and it works fine
Steven Kirk
@grokys
Jan 28 22:27
oh, crap :(
@mstr2 :point_up: any idea what might be going wrong?