59 lines
1.4 KiB
C#
59 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
|
|
namespace Main.Test;
|
|
|
|
public class DataGridHelper
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
/// <returns></returns>
|
|
public static string GetNoDataTips(DependencyObject obj)
|
|
{
|
|
return (string)obj.GetValue(NoDataTipsProperty);
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
/// <param name="value"></param>
|
|
public static void SetNoDataTips(DependencyObject obj, string value)
|
|
{
|
|
obj.SetValue(NoDataTipsProperty, value);
|
|
}
|
|
|
|
public static readonly DependencyProperty NoDataTipsProperty =
|
|
DependencyProperty.RegisterAttached("NoDataTips", typeof(string), typeof(DataGridHelper),new PropertyMetadata("无数据"));
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
/// <returns></returns>
|
|
public static bool GetIsActive(DependencyObject obj)
|
|
{
|
|
return (bool)obj.GetValue(IsActiveProperty);
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
/// <param name="value"></param>
|
|
public static void SetIsActive(DependencyObject obj, bool value)
|
|
{
|
|
obj.SetValue(IsActiveProperty, value);
|
|
}
|
|
|
|
public static readonly DependencyProperty IsActiveProperty =
|
|
DependencyProperty.RegisterAttached("IsActive", typeof(bool), typeof(DataGridHelper));
|
|
|
|
}
|