These are chat archives for AvaloniaUI/Avalonia

21st
Aug 2018
Sergey
@PurpleGray
Aug 21 2018 10:50
what is this??
image.png
How double bang works here?
Wiesław Šoltés
@wieslawsoltes
Aug 21 2018 11:15
Two way binding? Just add two bangs:

var control = new Control
{
    Property1 = "Foo",
    [Attached.Property] = "Bar",
    [!!Property2] = anotherControl[!!Property1],
}
at least if it still valid :smile:
Nicolas Musset
@Kryptos-FR
Aug 21 2018 12:13

Created a new PR #1823 following #1810. One of the build failed for an obscure reason:

========================================
Inspect-Impl
========================================
Executing task: Inspect-Impl
Running code inspections
Cake.exe : Warning: Unknown LangVersion = latest
At line:1 char:1
+ & "C:\projects\Avalonia\tools\Cake\Cake.exe" "build.cake" -target="Ap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Warning: Unknown LangVersion = latest:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Warning: Unknown LangVersion = latest

Any idea what it means?

Benedikt Schroeder
@Gillibald
Aug 21 2018 12:41

I have this style:

<Style Selector="TabControl[TabStripPlacement=Bottom] /template/ #PART_TapStrip">
        <Setter Property="DockPanel.Dock" Value="Bottom"/>
    </Style>

If TabStripPlacement changes the matching Style doesn't get applied. Do I Need to do something special to get this to work?

Siegfried Pammer
@siegfriedpammer
Aug 21 2018 13:01
hi, I am in the process of implementing AvaloniaUI/Avalonia#1782. I have a working implementation, but the unit test I wrote fails. Seems I don't quite understand how Direct Properties are supposed to work.
public static readonly DirectProperty<RadioButton, string> GroupNameProperty =
            AvaloniaProperty.RegisterDirect<RadioButton, string>(
                nameof(GroupName),
                o => o.GroupName,
                SetGroupName,
                unsetValue: null,
                defaultBindingMode: BindingMode.TwoWay);
I would expect that SetGroupNameis called, when I do the following:
        public string GroupName
        {
            get { return _groupName; }
            set { SetAndRaise(GroupNameProperty, ref _groupName, value); }
        }
so when SetAndRaise is called, I would expect SetGroupName to be executed. Is this correct?
or should I use a different kind of property for GroupName?
Sergey
@PurpleGray
Aug 21 2018 13:24
@danwalmsley Is there any approach to add documents not only at center of Shell, but at any other side of view? Setting Dock property to Dock.Left, for example, doesnt work.
Its about AvalonStudio.Shell
danwalmsley
@danwalmsley
Aug 21 2018 14:22
@Stratocast3r not currently, I am going to soon add an api for docking to the left, right, top or bottom of an existing instance
if you can open an issue to remind me
it wont happen for a couple of weeks though as im immensely busy trying to fix mac issues and with day job too :)
Sergey
@PurpleGray
Aug 21 2018 14:32
ofc, Im just wondering) Will open issue today.
Benedikt Schroeder
@Gillibald
Aug 21 2018 14:57
@siegfriedpammer Did you have a look at referencesource.microsoft.com to implement GroupName? Your implementation looks like you did.
Siegfried Pammer
@siegfriedpammer
Aug 21 2018 15:38
@Gillibald is that a problem? Honestly I used a decompiler...
I thought about changing the implementation a bit, but I think using WeakReference is the only way of implementing it correctly
Benedikt Schroeder
@Gillibald
Aug 21 2018 15:44
We can't use your code if you copy it from Microsoft. Never use referencesource.microsoft.com or a decompiler for this project.
Siegfried Pammer
@siegfriedpammer
Aug 21 2018 15:45
OK... I will change it
that wasn't copying, I took some inspiration, in my defense, but I perfectly understand :)
Benedikt Schroeder
@Gillibald
Aug 21 2018 15:46
Y but often it is hard not to copy things if you already had a look on the code :)
Siegfried Pammer
@siegfriedpammer
Aug 21 2018 15:47
any better idea than using WeakReference?
Benedikt Schroeder
@Gillibald
Aug 21 2018 15:50
Using WeakReference is totaly fine just don't let it look like you copied it. Some parts are very simlilar. I get that it is not by intention we just have to make sure this is totaly legal code.
In the future just use the docs and dont't have a look at existing code. Using code that complies to our licence is fine. Code from referencesource.microsoft.com and code from a decompiler is not.
Siegfried Pammer
@siegfriedpammer
Aug 21 2018 15:53
OK thank you
danwalmsley
@danwalmsley
Aug 21 2018 18:14
You can portand use stuff from silverlight since parts of it are open 😉
Siegfried Pammer
@siegfriedpammer
Aug 21 2018 18:15
Good to know, thanks :)