Comments (4)
Hello,
Going to have a look in next few days :)
from neumorphism.avalonia.
Just commited the fix in master.
Fixed in ListBoxItem.xaml control theme, strange bug because of ContentTemplate="{TemplateBinding ContentTemplate}" in RippleEffect.
Also updated ListBox demo page with ItemsSource cases and with click command cases also.
from neumorphism.avalonia.
@wanghonghust can you confirm the fix is working for you please ?
from neumorphism.avalonia.
您能确认该修复程序对您有用吗?
Very helpful, I tested it and the problem is fixed.
Code
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Neumorphism.Demo.ViewModels"
xmlns:icons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Neumorphism.Demo.Views.MainView"
x:DataType="vm:MainViewModel">
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE,
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
<vm:MainViewModel />
</Design.DataContext>
<StackPanel>
<ListBox Width="400" Height="224"
ItemsSource="{CompiledBinding ListItems}"
ItemContainerTheme="{StaticResource ListBoxItemOutset}"
ToolTip.Tip='List box with data binding, click command and theme "ListBoxItemInset" applied'>
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="Height" Value="50"/>
<Setter Property="CornerRadius" Value="100"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Margin" Value="8,3,8,3"/>
<Setter Property="Padding" Value="10,0,5,0"/>
</Style>
</ListBox.Styles>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" Margin="0"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="Auto,*,Auto" HorizontalAlignment="Stretch" Background="Transparent">
<icons:MaterialIcon Grid.Column="0" Kind="{CompiledBinding Icon}" Width="24" Height="24" Margin="0,0,8,0" Foreground="Gray" />
<TextBlock Grid.Column="1" Text="{CompiledBinding Title}" VerticalAlignment="Center" Foreground="{DynamicResource MaterialDesignToolForeground}" />
<icons:MaterialIcon Grid.Column="2" Kind="ChevronRight" Width="24" Height="24" HorizontalAlignment="Right" Foreground="Gray" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<icons:MaterialIcon Kind="About"/>
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</StackPanel>
</UserControl>
ListItems = new ObservableCollection<ListItem>() {
new ListItem(){ Title="Home",Icon="Home" },
new ListItem(){ Title="About",Icon="About"},
};
from neumorphism.avalonia.
Related Issues (8)
- Inflexible sizing HOT 3
- Terms of use HOT 2
- support avalonia 11 rc 1.1 HOT 6
- Could not find control 'PART_MinimizeButton'.' when ExtendClientAreaToDecorationsHint="True" HOT 5
- Hope to have an amazing data table HOT 1
- Null Reference exception at startup HOT 1
- Problem with TabControl' size since 11.0 version HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neumorphism.avalonia.