Eventos

[WP8] ¿Cómo obtener el ancho de banda?

1. Agregamos las referencias necesarias:


using Microsoft.Phone.Net.NetworkInformation;


2. Creamos una lista para visualizar la información:


            <ItemsControl x:Name="lbNetworkInterfaces">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="27">
                            <TextBlock Text="{Binding Bandwidth, StringFormat='Bandwidth: {0}'}" />
                            <TextBlock Text="{Binding Characteristics, StringFormat='Characteristics: {0}'}" />
                            <TextBlock Text="{Binding Description, StringFormat='Description: {0}'}"/>
                            <TextBlock Text="{Binding InterfaceName, StringFormat='InterfaceName: {0}'}"/>
                            <TextBlock Text="{Binding InterfaceState, StringFormat='InterfaceState: {0}'}"/>
                            <TextBlock Text="{Binding InterfaceSubtype, StringFormat='InterfaceSubtype: {0}'}"/>
                            <TextBlock Text="{Binding InterfaceType, StringFormat='InterfaceType: {0}'}"/>
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>


3. Finalmente llenamos la lista con el detalle de las interfaces de red:


protected override void OnNavigatedTo(NavigationEventArgs e)
{
this.lbNetworkInterfaces.ItemsSource = new NetworkInterfaceList();
}


No hay comentarios.:

Publicar un comentario

Epicalsoft — Superheroic Software Development Blog Designed by Templateism.com Copyright © 2014

Con tecnología de Blogger.