|
@@ -9,14 +9,16 @@ using Label = System.Windows.Controls.Label;
|
|
|
|
|
|
namespace InABox.DynamicGrid
|
|
|
{
|
|
|
-
|
|
|
public abstract class DynamicActionColumn : DynamicColumnBase
|
|
|
{
|
|
|
public DynamicActionColumnPosition Position { get; set; }
|
|
|
-
|
|
|
- public Func<CoreRow?, bool>? Action { get; set; }
|
|
|
|
|
|
- public Func<DynamicActionColumn, CoreRow?, FrameworkElement?>? ToolTip { get; set; }
|
|
|
+ public delegate bool ActionDelegate(CoreRow? row);
|
|
|
+ public delegate FrameworkElement? ActionColumnToolTip(DynamicActionColumn column, CoreRow? row);
|
|
|
+
|
|
|
+ public ActionDelegate? Action { get; set; }
|
|
|
+
|
|
|
+ public ActionColumnToolTip? ToolTip { get; set; }
|
|
|
|
|
|
public string[] SelectedFilters { get; set; }
|
|
|
public string[] Filters { get; set; }
|
|
@@ -79,11 +81,13 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
public class DynamicTextColumn : DynamicActionColumn
|
|
|
{
|
|
|
- public Func<CoreRow?, String> Text { get; private set; }
|
|
|
+ public delegate string GetTextDelegate(CoreRow? row);
|
|
|
+
|
|
|
+ public GetTextDelegate Text { get; private set; }
|
|
|
|
|
|
public Alignment Alignment { get; set; }
|
|
|
|
|
|
- public DynamicTextColumn(Func<CoreRow?, String?> text, Func<CoreRow?, bool>? action = null)
|
|
|
+ public DynamicTextColumn(GetTextDelegate text, ActionDelegate? action = null)
|
|
|
{
|
|
|
Alignment = Alignment.MiddleCenter;
|
|
|
Text = text;
|
|
@@ -96,20 +100,22 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
public class DynamicImageColumn : DynamicActionColumn
|
|
|
{
|
|
|
- public DynamicImageColumn(Func<CoreRow?, BitmapImage?> image, Func<CoreRow?, bool>? action = null)
|
|
|
+ public delegate BitmapImage? GetImageDelegate(CoreRow? row);
|
|
|
+
|
|
|
+ public DynamicImageColumn(GetImageDelegate image, ActionDelegate? action = null)
|
|
|
{
|
|
|
Image = image;
|
|
|
Action = action;
|
|
|
VerticalHeader = true;
|
|
|
}
|
|
|
|
|
|
- public DynamicImageColumn(BitmapImage image, Func<CoreRow?, bool>? action = null)
|
|
|
+ public DynamicImageColumn(BitmapImage image, ActionDelegate? action = null)
|
|
|
{
|
|
|
Image = r => image;
|
|
|
Action = action;
|
|
|
}
|
|
|
|
|
|
- public Func<CoreRow?, BitmapImage?> Image { get; protected set; }
|
|
|
+ public GetImageDelegate Image { get; protected set; }
|
|
|
|
|
|
|
|
|
public bool AllowHeaderClick { get; set; }
|