本文整理匯總了C#中System.Windows.Controls.DataGridHyperlinkColumn類的典型用法代碼示例。如果您正苦於以下問題:C# DataGridHyperlinkColumn類的具體用法?C# DataGridHyperlinkColumn怎麽用?C# DataGridHyperlinkColumn使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DataGridHyperlinkColumn類屬於System.Windows.Controls命名空間,在下文中一共展示了DataGridHyperlinkColumn類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Window1
public Window1()
{
InitializeComponent();
//GetData() creates a collection of Customer data from a database
ObservableCollection<Customer> custdata = GetData();
//Bind the DataGrid to the customer data
DG1.DataContext = custdata;
}
示例2:
//Defines the customer object
public class Customer
{
public string FirstName { get; set; }
public string LastName { get; set; }
public Uri Email { get; set; }
public bool IsMember { get; set; }
public OrderStatus Status { get; set; }
}
示例3: Convert
//Converts the mailto uri to a string with just the customer alias
public class EmailConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value != null)
{
string email = value.ToString();
int index = email.IndexOf("@");
string alias = email.Substring(7, index-7);
return alias;
}
else
{
string email = "";
return email;
}
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Uri email = new Uri((string)value);
return email;
}
}