A multi-platform .NET UI framework. -!-!-!-!- VOTE FOR SUPPORT IN RIDER: https://youtrack.jetbrains.com/issue/RIDER-39247 -!-!-!-!-
//translage it to image source
ImageSource src = null;
return src;
}
<Style Selector="TabStripItem:selected">
<Setter Property="Background" Value="#AA0000" />
<Setter Property="Foreground" Value="{DynamicResource ApplicationAccentBrushLight}" />
<Setter Property="BorderThickness" Value="1 0 1 1" />
<Setter Property="Margin" Value="0 -1 0 0" />
</Style>
static Border()
{
AffectsRender(BackgroundProperty, BorderBrushProperty);
AffectsMeasure(BorderThicknessProperty);
}
AffectsRender
too? i don't think that will change anything, but worth a try
<DockPanel Margin="10">
<TabStrip Name="toolStrip" DockPanel.Dock="Bottom" ClipToBounds="False" Focusable="false" ZIndex="1">
<TabStrip.Items>
<TabStripItem>
<TextBlock Text="Item1" />
</TabStripItem>
<TabStripItem>
<TextBlock Text="Item2" />
</TabStripItem>
</TabStrip.Items>
</TabStrip>
<Border BorderThickness="1" BorderBrush="Black">
<Grid Background="#AA0000" />
</Border>
</DockPanel>
using (TestApplication())
{
Decorator decorator;
Border border;
Canvas canvas;
var tree = new TestRoot
{
Width = 100,
Height = 100,
Child = decorator = new Decorator
{
Margin = new Thickness(0, 10, 0, 0),
Child = border = new Border
{
Background = Brushes.Red,
Child = canvas = new Canvas(),
}
}
};
var layout = AvaloniaLocator.Current.GetService<ILayoutManager>();
layout.ExecuteInitialLayoutPass(tree);
var scene = new Scene(tree);
var sceneBuilder = new SceneBuilder();
sceneBuilder.UpdateAll(scene);
var borderNode = scene.FindNode(border);
var canvasNode = scene.FindNode(canvas);
Assert.Equal(Matrix.CreateTranslation(0, 10), borderNode.Transform);
Assert.Equal(Matrix.CreateTranslation(0, 10), canvasNode.Transform);
border.Margin = new Thickness(0, -1, 0, 0);
border.BorderThickness = new Thickness(1, 0, 1, 1);
layout.ExecuteLayoutPass();
scene = scene.CloneScene();
sceneBuilder.Update(scene, border);
var rects = scene.Layers.Single().Dirty.ToArray();
Assert.Equal(new[] { new Rect(0, 9, 100, 91) }, rects);
}
border.Margin = new Thickness(0, -1, 0, 0);
border.BorderThickness = new Thickness(1, 0, 1, 1);
<TabStrip Name="toolStrip" DockPanel.Dock="Bottom" ClipToBounds="False" Focusable="false" ZIndex="1">
Debug.WriteLine
at the top of https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Visuals/Rendering/DeferredRenderer.cs#L246
node.Visual.GetType().Name
or something
MainWindow
Border
AdornerDecorator
ContentPresenter
DockPanel
Border
Grid
TabStrip
ItemsPresenter
WrapPanel
TabStripItem
ContentPresenter
TextBlock
TabStripItem
AdornerLayer
MainWindow
Border
AdornerDecorator
ContentPresenter
DockPanel
Border
Grid
TabStrip
ItemsPresenter
WrapPanel
TabStripItem
ContentPresenter
TextBlock
TabStripItem
ContentPresenter
TextBlock
AdornerLayer
public static readonly AvaloniaProperty<Type> WindowTypeProperty =
AvaloniaProperty.Register<OpenCloseWindowBehavior, Type>(nameof(WindowType), defaultBindingMode: BindingMode.TwoWay);
public Type WindowType
{
get => GetValue(WindowTypeProperty);
set => SetValue(WindowTypeProperty, value);
}
<i:Interaction.Behaviors>
<beh:OpenCloseWindowBehavior DataContext="ModalDialog" IsOpen="{Binding IsVisible}" WindowType="cont:ModalDialog" />
</i:Interaction.Behaviors>
WindowType="cont:ModalDialog"
{x:Type cont:ModalDialog}
?
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
shouldn't
use AvaloniaProperty
ScrollingTextViewModel
class which contains your properties
ReactiveObject
which implement INPC for you :)
popup.Parent
?
PopupRoot
but the PopupRoot
still inherits styles and property values
IStyleHost.StylingParent
chain
private IBitmap _imgSource;
public IBitmap ImgSource
{
set => this.RaiseAndSetIfChanged(ref _imgSource, value);
get => _imgSource;
}
PopupRoot
a logical child of Popup
, i've wondered this many times
PopupRoot
isn't the logical child of Popup
<Popup>
<Button>Hello</Button>
</Popup>
Button
is the logical child of the popup
PopupRoot
: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Primitives/Popup.cs#L193