csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
// This source file is adapted from the WinUI project.
|
|
// (https://github.com/microsoft/microsoft-ui-xaml)
|
|
//
|
|
// Licensed to The Avalonia Project under MIT License, courtesy of The .NET Foundation.
|
|
|
|
using System;
|
|
|
|
#nullable enable
|
|
|
|
namespace Avalonia.Controls
|
|
{
|
|
public class SelectionModelChildrenRequestedEventArgs : EventArgs
|
|
{
|
|
private object? _source;
|
|
private SelectionNode? _sourceNode;
|
|
|
|
internal SelectionModelChildrenRequestedEventArgs(object source, SelectionNode sourceNode)
|
|
{
|
|
_source = source;
|
|
_sourceNode = sourceNode;
|
|
}
|
|
|
|
public object? Children { get; set; }
|
|
|
|
public object Source
|
|
{
|
|
get
|
|
{
|
|
if (_source == null)
|
|
{
|
|
throw new ObjectDisposedException(nameof(SelectionModelChildrenRequestedEventArgs));
|
|
}
|
|
|
|
return _source;
|
|
}
|
|
}
|
|
|
|
public IndexPath SourceIndex
|
|
{
|
|
get
|
|
{
|
|
if (_sourceNode == null)
|
|
{
|
|
throw new ObjectDisposedException(nameof(SelectionModelChildrenRequestedEventArgs));
|
|
}
|
|
|
|
return _sourceNode.IndexPath;
|
|
}
|
|
}
|
|
|
|
internal void Initialize(object? source, SelectionNode? sourceNode)
|
|
{
|
|
_source = source;
|
|
_sourceNode = sourceNode;
|
|
}
|
|
}
|
|
}
|
|
|