I am creating a ListView Grouped by ServiceName, but I am not able to display the FileName and FilePath, here are the classes and the Xaml:
public class SOService
{
string _ServiceName;
List<SOFileInfo> _SOFiles;
public string ServiceName
{
get { return _ServiceName; }
set { _ServiceName = value; }
}
public List<SOFileInfo> SOFiles
{
get { return _SOFiles; }
set { _SOFiles = value; }
}
}
public class SOFileInfo
{
string _FileName;
string _FilePath;
public string FileName
{
get
{ return _FileName; }
set { _FileName = value; }
}
public string FilePath
{
get { return _FilePath; }
set { _FilePath = value; }
}
}
the ViewModel:
public class SOServiceViewModel
{
public SOServiceViewModel()
{
_Services = new List<SOService>();
_Services.Add(new SOService()
{
ServiceName = "service1",
SOFiles = new List<SOFileInfo>() { new SOFileInfo() { FileName = "File1", FilePath = "c:" } }
});
}
List<SOService> _Services;
public List<SOService> Services
{
get { return _Services; }
set { _Services = value; }
}
}
and the Xaml:

Here is the solution I found:
Add properties to retrieve the list of
FileNamesandFilePaths:then in the Xaml File: