Repository navigation
Replies: 5 comments
|
Okay I got the Chevron working in the TreeView. Looks like you can have multiple columns but only one child? In my case it would be: |
0 replies
|
I weren't thinking about it roight! Just add records to Children. Let OO sort it. Uno does support TreeView with multiple columns if you think about it that way. I would change the example to reflect this. |
0 replies
|
I don't need any more help... |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
Hope you are well.
Not sure what I am doing here. I don't need sorting or caching. I don't need column sizing. I am trying to make a rudimentary multicolumn treeview in mvux. My GenerationTreeItem data template is not being selected by the TreeItemTemplateSelector?
HomePage.xaml
HomePage.xaml.cs
[using System.Collections.ObjectModel;
namespace SomeDumbApp.Presentation;
public partial class HomePage : Page
{
public HomePage()
{
InitializeComponent();
}
}
public interface ITreeItem
{
string Type { get; }
IReadOnlyList Children { get; }
}
public partial record PoolTreeItem(
string? Id,
string Type,
IReadOnlyList Children
) : ITreeItem;
public partial record GenerationTreeItem
(
int? Count,
string Type,
IReadOnlyList Children = null
) : ITreeItem
{
public IReadOnlyList Children { get; init; } = Array.Empty();
}
public class TreeItemTemplateSelector : DataTemplateSelector
{
public DataTemplate PoolTemplate { get; set; }
public DataTemplate GenerationTemplate { get; set; }
protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
{
return item switch
{
PoolTreeItem => PoolTemplate,
GenerationTreeItem => GenerationTemplate,
_ => base.SelectTemplateCore(item, container)
};
}
](url)
HomeModel.cs
using System.Runtime.CompilerServices;
using SomeDumbApp.Domain;
usin```
g SomeDumbApp.Services;
using Uno.Extensions.Reactive;
using System.Collections.Immutable;
using Uno.Extensions.Reactive.Config;
using Uno.Extensions.Reactive.Bindings;
namespace SomeDumbApp.Presentation;
[Uno.Extensions.Reactive.ReactiveBindable(false)]
public partial record HomeModel
{
private readonly ISignalRService _signalRService;
public IListFeed Pools => ListFeed.AsyncEnumerable(FetchPoolsAsync);
public HomeModel(ISignalRService signalRService)
{
}
private async IAsyncEnumerable<IImmutableList> FetchPoolsAsync([EnumeratorCancellation] CancellationToken ct)
{
await _signalRService.StartAsync(ct);
}
~HomeModel()
{
_signalRService?.StopAsync().GetAwaiter();
}
All reactions