I have a WPF DataGrid UserControl with enum property.
public List<myEnum> dataList = new List<myEnum>();
public enum myEnum
{
Info,
Error,
Warning,
Debug,
Success
}
I want to expose this property to the MainWindow where the usercontrol will be hosted. So that I can access it in code like..
dataGrid1.dataList.Add(logDataGrid1.myEnum.Info);
dataGrid1.dataList.Add(logDataGrid1.myEnum.Warning);
dataGrid1.dataList.Add(logDataGrid1.myEnum.Success);
Please advise. Or whether any alternative solution for this available?
Thanks all for the answers!
I found the answer.
Public enum in your usercontrol can be accessed by Namespace.Class.PublicEnumName
Ex)
WpfControlLibrary1.UserDataGrid.myEnum.Info