Open Flithor opened 1 year ago
Look at code. Remove ph in mc:Ignorable will make PlaceHolder.BackGround works, but add will make it not work.
ph
mc:Ignorable
PlaceHolder.BackGround
btw: d:Background not work.
d:Background
using Avalonia; using Avalonia.Controls; using Avalonia.Media; namespace MyNamespace { namespace PlaceHolder { public static class PlaceHolder { public static readonly AttachedProperty<IBrush> BackGroundProperty = AvaloniaProperty.RegisterAttached<IControl, IControl, IBrush>( "BackGround"); /// <summary> /// Accessor for Attached property <see cref="BackGroundProperty"/>. /// </summary> public static void SetBackGround(AvaloniaObject element, IBrush value) { if (Design.IsDesignMode) { var bg = element.GetType()!.GetProperty("Background", returnType: typeof(IBrush)); if (bg != null) bg.SetValue(element, newValue); } element.SetValue(BackGroundProperty, value); } /// <summary> /// Accessor for Attached property <see cref="BackGroundProperty"/>. /// </summary> public static IBrush GetBackGround(AvaloniaObject element) { return element.GetValue(BackGroundProperty); } } } }
<UserControl balabalabala xmlns:ph="clr-namespace:MyNamespace.PlaceHolder" d:DesignHeight="600" d:DesignWidth="1200" ph:PlaceHolder.BackGround="#77FF0000" mc:Ignorable="d ph">
0.10.18.4
0.10.21
17.4.4
Nolog
No response
Describe the bug
Look at code. Remove
ph
inmc:Ignorable
will makePlaceHolder.BackGround
works, but add will make it not work.btw:
d:Background
not work.To Reproduce
AvaloniaVS plugin version
0.10.18.4
Avalonia version
0.10.21
Visual Studio version
17.4.4
Relevant log output
Additional context
No response