I'm making the population a DataGrid , but I do not know why it's not showing.
Result:
Onlyemptyrowsarereturned.
Inspection.cs
publicclassFiscalizacoes{privateStringConcessionaria{get;set;}privateStringMunicipio{get;set;}privateStringSistemas{get;set;}privateDateTimeDataInicio{get;set;}privateDateTimeDataFim{get;set;}privateStringStatus{get;set;}publicFiscalizacoes(){}publicFiscalizacoes(Stringconcessionaria,Stringmunicipio,Stringsistemas,DateTimedatainicio,DateTimedatafim,Stringstatus){Concessionaria=concessionaria;Municipio=municipio;Sistemas=sistemas;DataInicio=datainicio;DataFim=datafim;Status=status;}}
populaGrid()
privatestaticIEnumerable<Fiscalizacoes>popularGrid(){varlistaFiscalizacao=newList<Fiscalizacoes>{newFiscalizacoes("SABESP", "São Paulo", "Abastecimento Água", new DateTime(2014, 12, 1),
new DateTime(2014, 12, 10), "Não Respondido"),
new Fiscalizacoes("Mairinque", "Taubaté", "Esgotamento Sanitário", new DateTime(2014, 12, 1),
new DateTime(2014, 12, 10), "Respondido"),
new Fiscalizacoes("Foz Gertrudes", "São José dos Campos", "Esgotamento Sanitário", new DateTime(2014, 12, 1),
new DateTime(2014, 12, 10), "Transmitido")
};
return listaFiscalizacao;
}
XAML
<DataGrid x:Name="dataGridFiscalizacoes" ItemsSource="{Binding listaFiscalizacao}" AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTextColumn Header="Concessionária" Binding="{Binding Concessionaria}" />
<DataGridTextColumn Header="Município" Binding="{Binding Municipio}" />
<DataGridTextColumn Header="Sistemas" Binding="{Binding Sistemas}" />
<DataGridTextColumn Header="Data Início" Binding="{Binding DataInicio}" />
<DataGridTextColumn Header="Data Fim" Binding="{Binding DataFim}" />
<DataGridTextColumn Header="Status Checklist" Binding="{Binding Status}" />
</DataGrid.Columns>
</DataGrid>
window
public ChecklistListagem(InicioWindow w)
{
InitializeComponent();
this.w = w;
dataGridFiscalizacoes.ItemsSource = popularGrid();
}