Created
May 21, 2021 17:06
-
-
Save habibg1232191/4ffa66b5346819fe3a5df6c37774a2b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<controls:MList Items="{Binding Photos}"> | |
<controls:MList.ItemTemplate> | |
<DataTemplate> | |
<Grid> | |
<TextBlock Text="{Binding urls}"></TextBlock> | |
</Grid> | |
</DataTemplate> | |
</controls:MList.ItemTemplate> | |
</controls:MList> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Styles xmlns="https://github.com/avaloniaui" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:controls="using:Switch_Wallparer.Views.Controls"> | |
<Design.PreviewWith> | |
<controls:MList /> | |
</Design.PreviewWith> | |
<Style Selector="controls|MList"> | |
<!-- Set Defaults --> | |
<Setter Property="Template"> | |
<ControlTemplate> | |
<Grid></Grid> | |
</ControlTemplate> | |
</Setter> | |
</Style> | |
</Styles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Avalonia; | |
using Avalonia.Controls; | |
using Avalonia.Controls.Primitives; | |
using Avalonia.Interactivity; | |
namespace Switch_Wallparer.Views.Controls | |
{ | |
public class MList : ListBox | |
{ | |
public MList() | |
{ | |
AddHandler(PointerPressedEvent, (_, _) => | |
{ | |
Console.WriteLine("Pressed"); | |
foreach (var item in DataTemplates) | |
{ | |
Console.WriteLine(item); | |
} | |
}, RoutingStrategies.Tunnel); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment