* UIPagination:增加DataSource切换事件,TotalCount总数,PageCount总页数,ActivePage选中页码
This commit is contained in:
parent
fc65d3a5cb
commit
1401d26d43
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
BIN
Bin/SunnyUI.pdb
BIN
Bin/SunnyUI.pdb
Binary file not shown.
Binary file not shown.
@ -75,9 +75,21 @@ namespace Sunny.UI
|
||||
|
||||
public UIPieSeriesLabel Label = new UIPieSeriesLabel();
|
||||
|
||||
public delegate Color OnDataColorChangeEventHandler(double data);
|
||||
|
||||
public event OnDataColorChangeEventHandler DataColorChange;
|
||||
|
||||
public void AddData(string name, double value)
|
||||
{
|
||||
Data.Add(new UIPieSeriesData(name, value));
|
||||
if (DataColorChange != null)
|
||||
{
|
||||
Color color = DataColorChange.Invoke(value);
|
||||
Data.Add(new UIPieSeriesData(name, value,color));
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.Add(new UIPieSeriesData(name, value));
|
||||
}
|
||||
}
|
||||
|
||||
public void AddData(string name, double value, Color color)
|
||||
|
@ -65,7 +65,11 @@ namespace Sunny.UI
|
||||
private bool inSetDataConnection;
|
||||
private UIPanel p1;
|
||||
|
||||
private int PageCount;
|
||||
/// <summary>
|
||||
/// 总页数
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public int PageCount { get; private set; }
|
||||
|
||||
private int pagerCount = 7;
|
||||
|
||||
@ -215,6 +219,8 @@ namespace Sunny.UI
|
||||
set => p1.Visible = value;
|
||||
}
|
||||
|
||||
public event EventHandler DataSourceChanged;
|
||||
|
||||
[DefaultValue(null)]
|
||||
[RefreshProperties(RefreshProperties.Repaint)]
|
||||
[AttributeProvider(typeof(IListSource))]
|
||||
@ -235,6 +241,7 @@ namespace Sunny.UI
|
||||
dataSource = value;
|
||||
activePage = 1;
|
||||
TotalCount = dataManager?.List.Count ?? 0;
|
||||
DataSourceChanged?.Invoke(this,null);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user