<UserControl x:Class="OliviaAddInPro.PaneLimpiezaSub1View"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
             xmlns:ui="clr-namespace:OliviaAddInPro"             
             mc:Ignorable="d" d:DesignWidth="300" Height="396"
             d:DataContext="{Binding Path=ui.PaneLimpiezaSub1ViewModel}" Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded" >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>    
        <StackPanel Orientation="Vertical" Height="Auto" Margin="0,0,0,-44">
        <Label Content="Capa de Limpieza" HorizontalAlignment="Left" Margin="15,5,0,0" VerticalAlignment="Top" FontWeight="DemiBold"/>
        <Grid Margin="0,5,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="45"/>
                    <ColumnDefinition Width="200"/>
                </Grid.ColumnDefinitions>
                <Button Content="" HorizontalAlignment="Left" Margin="20,3,0,0" VerticalAlignment="Top" Width="16" Height="16" BorderThickness="0" Click="Button_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="../../Images/openfolder.png"/>
                    </Button.Background>
                </Button>
            <Label x:Name="label_capalimp" Content="{Binding Path=LblCapaElems, Mode = TwoWay}" Grid.Column="1" HorizontalAlignment="Left" Margin="13,0,0,0" VerticalAlignment="Top" Width="221" Height="30" Grid.ColumnSpan="3"/>
            </Grid>
            <Label  Content="Tipo de Tratamiento" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" FontWeight="DemiBold"/>
            <ComboBox x:Name="comboBox_tto" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=TiposTto, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0" 
                      VerticalAlignment="Top" Width="260" DropDownOpened="ComboBox_DropDownOpened" SelectionChanged="comboBox_tto_SelectionChanged"
                      SelectedIndex="{Binding Path=TipoTto, Mode = TwoWay}"/>
            <Label  Content="Ámbitos de Trabajo" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.391,-0.203" FontWeight="DemiBold"/>
            <ComboBox x:Name="comboBox_ambitos" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=OpsAmbs, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0" 
                      VerticalAlignment="Top" Width="260" SelectionChanged="comboBox_ambitos_SelectionChanged"
                      SelectedIndex="{Binding Path=SelOpAmb, Mode = TwoWay}"/>
        <ListBox x:Name="listBox_ambitos" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=Ambitos, Mode = TwoWay}" HorizontalAlignment="Left" Height="100" 
            ItemContainerStyle="{DynamicResource Esri_ListBoxItemHighlightBrush}" Margin="20,10,0,0" VerticalAlignment="Top" Width="260">
            <ListBox.ItemTemplate>
            <DataTemplate>
                    <ListBoxItem IsEnabled="{Binding IsEnabled}" >
                        <CheckBox IsChecked="{Binding IsChecked}" Content="{Binding Path=Item}" />
                    </ListBoxItem>
                </DataTemplate>
        </ListBox.ItemTemplate>
        </ListBox>
            <CheckBox x:Name="checkBox_sentidocirc" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" 
                      Content="Respeta el sentido de circulación" IsChecked="{Binding RespCirc}" HorizontalAlignment="Left" Margin="20,5,0,0" VerticalAlignment="Top"/>

        <Grid Margin="0,5,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="185"/>
                <ColumnDefinition Width="75"/>
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>
            <Label x:Name="label_velodespl" Margin="15,0,0,0" Content="Velocidad de desplazamiento"/>
            <TextBox x:Name="txtBox_velodespl" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" Grid.Column="1" Margin="10,2,10,4" TextWrapping="NoWrap" Text="{Binding Path=TextVeloDespl, Mode = TwoWay}" TextAlignment="Right" MaxLength="4" PreviewTextInput="TextBox_velodespl_PreviewTextInput"/>
            <Label x:Name="label_udsvelodespl" Grid.Column="2" Content="{Binding LblUdsVeloDespl}" Margin="0,0,0,0"/>            
        </Grid>
        <Grid Margin="0,5,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="185"/>
                <ColumnDefinition Width="75"/>
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>
            <Label x:Name="label_tiempotto" Margin="15,0,0,0" Content="{Binding LblTimeTto}"/>
            <TextBox x:Name="txtBox_tiempotto" Grid.Column="1" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" Margin="10,2,10,4" TextWrapping="Wrap" Text="{Binding Path=TimeTto, Mode = TwoWay}" TextAlignment="Right" MaxLength="4" PreviewTextInput="TextBox_tiempotto_PreviewTextInput"/>
            <Label x:Name="label_udstiempotto" Grid.Column="2" Content="{Binding LblUdsTimeTto}" Margin="0,0,0,0"/>
        </Grid>
        <Grid Margin="0,5,0,0" Visibility="{Binding Path=VisTextAnchoVia, Mode = TwoWay}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="185"/>
                <ColumnDefinition Width="75"/>
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>
            <Label x:Name="label_ancho_via" Margin="15,0,0,0" Content="Ancho medio de la vía"/>
            <TextBox x:Name="txtBox_ancho_via" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" Grid.Column="1" Margin="10,2,10,4" TextWrapping="NoWrap" Text="{Binding Path=TextAnchoVia, Mode = TwoWay}" TextAlignment="Right" MaxLength="2" PreviewTextInput="txtBox_ancho_via_PreviewTextInput" />
            <Label x:Name="label_ancho_via_uds" Grid.Column="2" Content="m" Margin="0,0,0,0"/>
        </Grid>
    </StackPanel>
</UserControl>
