feat: layout calculation.
This commit is contained in:
@@ -28,7 +28,6 @@ public class ToolBarItemTemplateSelector: IDataTemplate
|
||||
{
|
||||
[!ContentControl.ContentProperty] = new Binding() { Path = "Content" },
|
||||
[!ToggleButton.IsCheckedProperty] = new Binding() { Path = "IsChecked" },
|
||||
[!Button.CommandProperty] = new Binding() { Path = "Command" },
|
||||
[!ToolBar.OverflowModeProperty] = new Binding(){ Path = "OverflowMode" }
|
||||
};
|
||||
}
|
||||
@@ -39,7 +38,7 @@ public class ToolBarItemTemplateSelector: IDataTemplate
|
||||
[!ContentControl.ContentProperty] = new Binding() { Path = "Content" },
|
||||
[!SelectingItemsControl.SelectedItemProperty] = new Binding() { Path = "SelectedItem" },
|
||||
[!ItemsControl.ItemsSourceProperty] = new Binding() { Path = "Items" },
|
||||
[!ToolBar.OverflowModeProperty] = new Binding(){ Path = "OverflowMode" }
|
||||
[ToolBar.OverflowModeProperty] = OverflowMode.Always,
|
||||
};
|
||||
}
|
||||
return new Button() { Content = "Undefined Item" };
|
||||
|
||||
@@ -10,15 +10,16 @@
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Ursa.Demo.Pages.ToolBarDemo">
|
||||
<StackPanel>
|
||||
<u:ToolBar>
|
||||
<u:ToolBar HorizontalAlignment="Left">
|
||||
<Button Content="Button 1" />
|
||||
<Button Content="Button 2" />
|
||||
<Button Content="Button 3" />
|
||||
<Button Content="Button 3" u:ToolBar.OverflowMode="Always" />
|
||||
</u:ToolBar>
|
||||
<u:ToolBar ItemsSource="{Binding Items}">
|
||||
<u:ToolBar ItemsSource="{Binding Items}" HorizontalAlignment="Left">
|
||||
<u:ToolBar.ItemTemplate>
|
||||
<template:ToolBarItemTemplateSelector/>
|
||||
</u:ToolBar.ItemTemplate>
|
||||
</u:ToolBar>
|
||||
<CheckBox Content="Check"></CheckBox>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace Ursa.Demo.Views;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user