forked from AvaloniaUI/Avalonia.Controls.TreeDataGrid
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request AvaloniaUI#86 from AvaloniaUI/feature/templates-fr…
…om-resources Allow defining TemplateColumn cells in XAML
- Loading branch information
Showing
7 changed files
with
134 additions
and
62 deletions.
There are no files selected for viewing
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
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
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
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
7 changes: 4 additions & 3 deletions
7
src/Avalonia.Controls.TreeDataGrid/Models/TreeDataGrid/TemplateCell.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
| ||
using System; | ||
using Avalonia.Controls.Templates; | ||
|
||
namespace Avalonia.Controls.Models.TreeDataGrid | ||
{ | ||
public class TemplateCell : ICell | ||
{ | ||
public TemplateCell(object? value, IDataTemplate? cellTemplate) | ||
public TemplateCell(object? value, Func<IControl, IDataTemplate> getCellTemplate) | ||
{ | ||
CellTemplate = cellTemplate; | ||
GetCellTemplate = getCellTemplate; | ||
Value = value; | ||
} | ||
|
||
public bool CanEdit => false; | ||
public IDataTemplate? CellTemplate { get; } | ||
public Func<IControl, IDataTemplate> GetCellTemplate { get; } | ||
public object? Value { get; } | ||
} | ||
} |
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
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