<Window x:Class="AdbTools.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:AdbTools"
        mc:Ignorable="d"
        Title="Adb无线连接工具" Height="450" Width="350" FontSize="16" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded" Unloaded="Window_Unloaded">
    <Window.Resources>
        <ContextMenu x:Key="ListBoxItemContextMenu">
            <MenuItem x:Name="installApkItem" Header="安装应用" Click="installApkItem_Click" Cursor="Hand" />
            <MenuItem x:Name="disconnectDeviceItem" Header="断开设备" Click="disconnectDeviceItem_Click"  Cursor="Hand"/>
            <Separator/>
            <MenuItem x:Name="disconnectAllDeviceItem" Header="断开所有设备" Click="disconnectAllDeviceItem_Click" Cursor="Hand" />
        </ContextMenu>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0" Grid.ColumnSpan="3">
            <Label Content="已连接列表(每10秒自动刷新)" Margin="10,125,10,0" VerticalAlignment="Top" HorizontalContentAlignment="Center"/>
            <ListBox x:Name="deviceList" Margin="10,160,10,10" ToolTip="右键连接的设备进行操作">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" ContextMenu="{StaticResource ListBoxItemContextMenu}" Cursor="Hand"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>

        <Grid Grid.Column="0" Grid.ColumnSpan="3">
            <Label Content="指定连接设备的IP和端口" Margin="10,10,10,0" VerticalAlignment="Top" HorizontalContentAlignment="Center"/>
            <ComboBox x:Name="deviceAddress" IsEditable="True" Margin="10,45,10,0" Height="30" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
            <Button x:Name="connectDevice" Content="连接设备" ToolTip="输入连接的IP和端口进行连接" Margin="10,85,0,0" VerticalAlignment="Top" Height="30" HorizontalAlignment="Left" Width="90" Click="connectDevice_Click" Cursor="Hand"/>
            <Button x:Name="deleteAllHistory" ToolTip="删除所有历史记录" Content="清空历史" Margin="0,85,0,0" VerticalAlignment="Top" Height="30" HorizontalAlignment="Center" Width="90" Click="deleteAllHistory_Click" Cursor="Hand"/>
            <Button x:Name="pairDevice" Content="配对设备" ToolTip="输入配对的IP和端口进行配对" Margin="0,85,10,0" VerticalAlignment="Top" Height="30" HorizontalAlignment="Right" Width="90" Click="pairDevice_Click" Cursor="Hand"/>
           
        </Grid>


    </Grid>
</Window>
