Good Morning:
I have the following code to display a list of a objects in my listview.
Main:
<syncfusion:SfListView
ItemsSource="{Binding ListaEquipos}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
Grid.Row="1" Grid.Column="0"
BackgroundColor="{StaticResource Paneles}"
Orientation="Horizontal"
IsScrollBarVisible="false"
AutoFitMode="Height">
<syncfusion:SfListView.ItemTemplate >
<DataTemplate >
<templates:VistaEquiposTemplate/>
</DataTemplate>
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView>
Template:
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="DISAR_XAMARIN.View.Templates.VistaEquiposTemplate"
xmlns:extensions="clr-namespace:DISAR_XAMARIN.Models">
<ContentView.Content >
<Grid HorizontalOptions="CenterAndExpand" VerticalOptions="StartAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Grid.Row="0"
Grid.Column="1"
Text="{Binding Ubicacion}"
Style="{StaticResource Corriente}"
TextColor="Black"/>
<Image Grid.RowSpan="5"
Grid.Row="1"
Grid.Column="1"
Source="{Binding Imagen}"
Aspect="AspectFill"
WidthRequest="125"
HeightRequest="125"/>
<Label Grid.Row="3"
Grid.Column="3"
IsVisible="{Binding NumEntradasVisible}"
Text="{Binding NumEntradas}"
FontSize="15"/>
<Label Grid.Row="5"
Grid.Column="3"
Text="{Binding NumSalidas}"
IsVisible="{Binding NumSalidasVisible}"
FontSize="15"/>
<Label Grid.Row="2"
Grid.Column="2"
Text= "{Binding Entrada}"
IsVisible="{Binding EntradaVisible}"
TextColor="{Binding ColorEntrada}"
FontSize="15"/>
<Label Grid.Row="2"
Grid.Column="3"
Text="{Binding EstadoEntrada}"
TextColor="{Binding ColorEntrada}"
IsVisible="{Binding EstadoEntradaVisible}"
FontSize="15"/>
<Label Grid.Row="4"
Grid.Column="2"
Text="{Binding Salida}"
IsVisible="{Binding salidaVisible}"
TextColor="{Binding ColorSalida}"
FontSize="15"/>
<Label Grid.Row="4"
Grid.Column="3"
Text="{Binding EstadoSalida}"
TextColor="{Binding ColorSalida}"
IsVisible="{Binding EstadoSalidaVisible}"
FontSize="15"/>
<Label Grid.Row="6"
Grid.Column="1"
Text="{Binding EstadoEquipo}"
FontSize="15"
HorizontalOptions="Center"/>
</Grid>
</ContentView.Content>
</ContentView>
This listview is refreshing every x time to see if the objects are connected to a server, if some equipment is connected changes the image of the computer and some new data that do not appear when it is disconnected.
The problem is good because the app that recognizes that the computer changed status does not refresh the list and I do not appear as connected, but I continue to show is as when I enter the programfor the first time. I would like to know why I do not refresh it, since if I use a normal listview of xamarin the code works perfectly, what happens that I like more your design and the option to be able to change the view forms horizontal to vertical.
Thank you so much.
Maria Chillon