Squashed commit of the following: commit 724c487ff5feca1e5ed1e0f006dd1c8e0112954b Author: luxick <git@luxick.de> Date: Thu Mar 5 17:56:01 2020 +0100 Reorder player columns commit 5f56f73912122a42c3ee8fc64ed9760d18b9e706 Author: luxick <git@luxick.de> Date: Thu Mar 5 17:52:17 2020 +0100 Data column constructor fix commit fae314804b5bbe1be58ebdcb64690544bae76d1b Author: luxick <git@luxick.de> Date: Thu Mar 5 17:51:39 2020 +0100 Do not cast values in liststore to string
31 lines
806 B
C#
31 lines
806 B
C#
using System;
|
|
using Gtk;
|
|
|
|
namespace EstusShots.Gtk.Controls
|
|
{
|
|
public class DataColumn : TreeViewColumn
|
|
{
|
|
public DataColumn()
|
|
{
|
|
Resizable = true;
|
|
Reorderable = true;
|
|
}
|
|
|
|
public DataColumn(string propertyName) : this()
|
|
{
|
|
PropertyName = propertyName;
|
|
Title = propertyName;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The name of the property in the data source, that should be show nin the view
|
|
/// </summary>
|
|
public string PropertyName { get; }
|
|
|
|
/// <summary>
|
|
/// Applies the given transformation on each item in the column.
|
|
/// This changes only the display of the value.
|
|
/// </summary>
|
|
public Func<object, string> Format { get; set; }
|
|
}
|
|
} |