Git Product home page Git Product logo

Comments (4)

flarive avatar flarive commented on May 23, 2024

Hello,

Going to have a look in next few days :)

from neumorphism.avalonia.

flarive avatar flarive commented on May 23, 2024

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.

flarive avatar flarive commented on May 23, 2024

@wanghonghust can you confirm the fix is working for you please ?

from neumorphism.avalonia.

wanghonghust avatar wanghonghust commented on May 23, 2024

您能确认该修复程序对您有用吗?

Very helpful, I tested it and the problem is fixed.
image

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.