These are chat archives for AvaloniaUI/Avalonia

24th
Mar 2018
Sebastian Holmqvist
@csholmq
Mar 24 2018 01:13
Hi, sorry to barge in, but the link to the quickstart guide on the website is a 404.
It links to /guide/quickstart.html when it should link to /guides/quickstart.html
If anyone in here is in charge of the website that is
Sebastian Holmqvist
@csholmq
Mar 24 2018 01:23
Also, dotnet install -i seems deprecated. dotnet new --install "VitalElement.AvalonStudio.Templates" did the trick
danwalmsley
@danwalmsley
Mar 24 2018 07:29
@csholmq how did you find the AvalonStudio templates? For command line use dotnet install -i Avalonia.Templates.NetCore is recommended.
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 09:18
So can I declare color/brush in resource and then reference it in style?
DmitryZhelnin
@DmitryZhelnin
Mar 24 2018 09:19
<SolidColorBrush x:Key="ThemeBackgroundBrush">#FFFFFFFF</SolidColorBrush>
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}"/>
yes, you can)
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 09:23
image.png
image.png
but toolbar is black&
may be wrong location of resource?
DmitryZhelnin
@DmitryZhelnin
Mar 24 2018 09:25
try to place it inside
<Style>
  <Style.Resources>
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 09:27
same effect.. and it makes no sense, since I want to use it for several styles...
oh
it was typo
yeah now it's working
with declaration in <Application.Resources>
thanks!
DmitryZhelnin
@DmitryZhelnin
Mar 24 2018 09:30
nice!
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 11:46
Miss intellisense in styles so much!
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 14:00
image.png
ImageSource not found(
DmitryZhelnin
@DmitryZhelnin
Mar 24 2018 14:02
it is just Source
I mean the property of Image control
its type is IBitmap
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 15:09
Yep, that hepled again
thnx
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 15:31
oh.. I just looked at 5 year old repository
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 16:45
image.png
At last it looks like real app)
DmitryZhelnin
@DmitryZhelnin
Mar 24 2018 18:12
@Igor_Gritsenko_twitter what control do you use to let user to pick color?
Matthijs ter Woord
@mterwoord
Mar 24 2018 18:14
i have a port of the winrt utilities' hue ring picker..
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 18:47
@DmitryZhelnin I have my own implementation in uwp and wpf, but haven't ported it yet to avalonia. Still have problems with commands :-) now I want to bind command in my custom control and nothing happens
@mterwoord Can you share your port of ring picker? What project do you use it for?
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 19:57
changed Command to directProperty and subscribed to it's changing.. and it's working too
DmitryZhelnin
@DmitryZhelnin
Mar 24 2018 20:00
@Igor_Gritsenko_twitter this is how Command property is defined in Button control
/// <summary>
        /// Defines the <see cref="Command"/> property.
        /// </summary>
        public static readonly DirectProperty<Button, ICommand> CommandProperty =
            AvaloniaProperty.RegisterDirect<Button, ICommand>(nameof(Command),
                button => button.Command, (button, command) => button.Command = command, enableDataValidation: true);
and the property itself
public ICommand Command { get { return _command; } set { SetAndRaise(CommandProperty, ref _command, value); } }
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 20:01
Yep, thats where I found out how to that correct
Now I need to decide... what layout to choose)
image.png
old one
or new:
image.png
Steven Kirk
@grokys
Mar 24 2018 20:29
thanks @csholmq - yeah we've fixed the broken link but only @kekekeks can update the website at the moment and he's been too busy recently. hopefully we will get CI publishing automatically to the website soon
new one looks better to me @Igor_Gritsenko_twitter :)
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 20:40
@grokys thanks :-) may be I should find compromise between them...
danwalmsley
@danwalmsley
Mar 24 2018 20:46
No need to compromise new one looks spot on
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 21:23
I worried about usability, not only how it looks
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 21:50
e.Device.Capture(null);
not really obvious for releasing pointer...
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 22:11
and Bounds instead of ActualWidth & ActualHeight was little confusing first
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 23:11
hmm... it looks like that F7 stops working on other xaml files beside Avalonia's after VS extension is installed
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 24 2018 23:22
https://youtu.be/ClAzC_jWzHM
Implemented simple color picker in avalonia
but color tone area is not that accurate as in wpf, since I can't change interpolation mode of linear gradients in avalonia
so I'll have to draw that gradient manually...