<UserControl x:Class="ContenedorAplicacion" 
             x:ClassModifier="Public"
             x:Name="ContenedorAplicacion"             
             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:lc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
             xmlns:my="clr-namespace:tsWPF"
             xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"   
             xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
             xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"                          
             mc:Ignorable="d" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" d:DesignHeight="497" d:DesignWidth="1280" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar">    
    <UserControl.Resources>
        <Storyboard x:Key="sbDesvanecer">
            <DoubleAnimation Storyboard.TargetProperty="(TextBlock.Opacity)"
                                                    From="1.0" To="0.0" Duration="0:0:2" 
                                                    AutoReverse="False" />
        </Storyboard>
        <Style TargetType="dxdo:LayoutPanel" x:Key="estilomensaje">
            <Setter Property="Appearance">
                <Setter.Value>
                    <dxdo:Appearance>
                        <dxdo:Appearance.Normal>
                            <dxdo:AppearanceObject Background="LightCoral" Foreground="White" />
                        </dxdo:Appearance.Normal>

                        <dxdo:Appearance.Active>
                            <dxdo:AppearanceObject Background="LightCoral" Foreground="White" />
                        </dxdo:Appearance.Active>
                    </dxdo:Appearance>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Key="tsBlink">
            <DoubleAnimation Storyboard.TargetProperty="(TextBlock.Opacity)"
                                                    From="1.0" To="0.0" Duration="0:0:0.7" 
                                                    AutoReverse="True" RepeatBehavior="Forever"  />
        </Storyboard>
    </UserControl.Resources>
    
    <Grid>
        <dxb:BarManager Name="BarraBotones" x:FieldModifier="public" ShowScreenTips="true" AllowCustomization="False" AllowQuickCustomization="False">
            <dxb:BarManager.Items>
                <dxb:BarButtonItem Name="btGuardarYBuscar" Glyph="{dx:DXImageGrayscale Image=SaveAndClose_16x16.png}" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Guarda, cierra y busca otro registro (F1)"/>
                <dxb:BarButtonItem Name="btGuardar" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Save/Save_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Guardar (F2)"  />
                <dxb:BarButtonItem Name="btBuscar" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Find/Find_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Buscar Otro Registro (F3)"  />
                <dxb:BarButtonItem Name="btNuevo" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Actions/AddItem_32x32.png" x:FieldModifier="public" Focusable="True" Hint="Nuevo (F4)" />
                <dxb:BarButtonItem Name="btActualizar" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Actions/Refresh_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True"  Hint="Cargar datos de nuevo (F5)" />
                <dxb:BarSubItem Name="MenuExportar" Glyph="{dx:DXImageGrayscale Image=ExportFile_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Exportar/Imprimir">
                    <dxb:BarButtonItem Name="btExportar" Glyph="{dx:DXImageGrayscale Image=ExportToXLSX_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Exportar A Excel" ItemClick="BtExportar_ItemClick"/>
                    <dxb:BarButtonItem Name="btCapturar" Glyph="Images/Icons/capture.png" Content="Captura Pantalla" ItemClick="BtCapturar_ItemClick" />
                </dxb:BarSubItem>
                <dxb:BarCheckItem Name="btSeleccionar" Glyph="Images/Icons/checklist-25.png" x:FieldModifier="public" Focusable="False" CheckedChanged="btSeleccionar_CheckedChanged" Hint="Selección múltiple" />
                <dxb:BarButtonItem Name="btEliminar" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Actions/DeleteItem_16x16.png" x:FieldModifier="public" Focusable="False" Hint="Eliminar Registro" />
                <!--<dxb:BarButtonItem Name="btDiseño" Glyph="{dx:DXImageGrayscale Image=Fixed_Column_Width_32x32.png}" x:FieldModifier="public" Focusable="False" Hint="Ayuda" ItemClick="btDiseño_ItemClick" />-->
                
                <dxb:BarSubItem Name="MenuDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Diseño Columnas">
                    <dxb:BarButtonItem Name="btDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Guardar Diseño Columnas" ItemClick="btDiseño_ItemClick" />
                    <dxb:BarButtonItem Name="btRestaurarDiseño" Glyph="{dx:DXImageGrayscale Image=Columns_16x16.png}" Content="Restaurar Diseño Columnas" ItemClick="btRestaurarDiseño_ItemClick" />
                    <dxb:BarItemSeparator />
                    <dxb:BarButtonItem Name="btAbrirDiseñoGuardado" Glyph="Images/Icons/AbrirGrid.png" Content="Abrir Diseño Guardado" ItemClick="btAbrirDiseñoGuardado_ItemClick" />
                    <dxb:BarButtonItem Name="btGuardarDiseñoComo" Glyph="Images/Icons/GuardarGrid.png" Content="Guardar Diseño Como ..." ItemClick="btGuardarDiseñoComo_ItemClick" />                    
                </dxb:BarSubItem>
                <dxb:BarButtonItem Name="btAyuda" Glyph="{dx:DXImageGrayscale Image=Index_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Ayuda" ItemClick="btAyuda_ItemClick" />
                <dxb:BarStaticItem Name="siEstado" x:FieldModifier="public" Content="Operación Actual:" />
                <dxb:BarEditItem Name="bePlantilla" x:FieldModifier="public" Focusable="true" ForceCursor="True" IsEnabled="True" Hint="Modelo a Imprimir" 
                                 EditWidth="300" EditValueChanged="bePlantilla_EditValueChanged"  >
                    <dxb:BarEditItem.EditSettings>
                        <dxe:ComboBoxEditSettings x:Name="cbPlantillaAImprimir" x:FieldModifier="Public" ValueMember="idPlantilla" DisplayMember="Descripcion">
                        </dxe:ComboBoxEditSettings>
                    </dxb:BarEditItem.EditSettings>
                </dxb:BarEditItem>
                <dxb:BarButtonItem Name="btImprimirPlantilla" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Print/Print_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btImprimirPlantilla_ItemClick" Hint="Imprimir" />
                <dxb:BarEditItem Name="beAcciones" x:FieldModifier="public" Focusable="True" ForceCursor="True" IsEnabled="True" Hint="Accion a Ejecutar" EditWidth="390" EditValueChanged="beAcciones_EditValueChanged" >
                <dxb:BarEditItem.EditSettings>
                        <dxe:ComboBoxEditSettings x:Name="cbAcciones" x:FieldModifier="Public" ValueMember="idAccion" DisplayMember="Descripcion" />
                </dxb:BarEditItem.EditSettings>
                </dxb:BarEditItem>
                <dxb:BarButtonItem Name="btAcciones" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Arrows/Next_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btAcciones_ItemClick" Hint="Ejecutar Acción" />
                <dxb:BarStaticItem Name="siMensaje" ShowBorder="False">
                    <dxb:BarStaticItem.ContentTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding}" Name="tbMensaje" FontWeight="ExtraBold" />
                        </DataTemplate>
                    </dxb:BarStaticItem.ContentTemplate>
                </dxb:BarStaticItem>          
            </dxb:BarManager.Items>
            <dxb:BarManager.Bars>
                <dxb:Bar AllowDrop="False" AllowHide="False" x:Name="BarraPrincipal" x:FieldModifier="public" AllowCustomizationMenu="False" AllowQuickCustomization="False" ShowDragWidget="False" ShowSizeGrip="False" AllowCollapse="False">
                    <dxb:Bar.DockInfo>
                        <dxb:BarDockInfo ContainerType="Top" />
                    </dxb:Bar.DockInfo>
                    <dxb:BarButtonItemLink BarItemName="btGuardarYBuscar" x:Name="ilGuardarYBuscar" x:FieldModifier="Public" />
                    <dxb:BarButtonItemLink BarItemName="btGuardar" x:Name="ilGuardar" x:FieldModifier="Public" />
                    <dxb:BarButtonItemLink BarItemName="btBuscar" x:Name="ilBuscar" x:FieldModifier="Public" />
                    <dxb:BarButtonItemLink BarItemName="btNuevo" x:Name="ilNuevo" x:FieldModifier="Public" />
                    <dxb:BarButtonItemLink BarItemName="btActualizar" x:Name="ilActualizar" x:FieldModifier="Public" />
                    <dxb:BarSubItemLink BarItemName="MenuExportar" x:FieldModifier="Public" x:Name="ilExportar" />
                    <dxb:BarCheckItemLink BarItemName="btSeleccionar" x:FieldModifier="Public" x:Name="ilSeleccionar" />
                    <dxb:BarButtonItemLink BarItemName="btEliminar" x:Name="ilEliminar" x:FieldModifier="Public" />
                    <dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
                    <dxb:BarSubItemLink BarItemName="MenuDiseño" x:Name="ilDiseño" x:FieldModifier="Public" />                    
                    <dxb:BarButtonItemLink BarItemName="btAyuda" x:Name="ilAyuda" x:FieldModifier="Public" />
                    <dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>                    
                    <dxb:BarEditItemLink BarItemName="bePlantilla" x:FieldModifier="Public" x:Name="ilPlantilla" />
                    <dxb:BarButtonItemLink BarItemName="btImprimirPlantilla" />
                    <dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
                    <dxb:BarEditItemLink BarItemName="beAcciones" x:FieldModifier="Public" x:Name="ilAcciones" />
                    <dxb:BarButtonItemLink BarItemName="btAcciones" />
                    <dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
                    <dxb:BarStaticItemLink BarItemName="siEstado" x:FieldModifier="Public" x:Name="ilEstado" />
                    <dxb:BarStaticItemLink BarItemName="siMensaje" x:FieldModifier="Public" x:Name="ilMensaje" />
                </dxb:Bar>
            </dxb:BarManager.Bars>          
            <Grid>
                <dxdo:DockLayoutManager Name="dockManager" ClosedPanelsBarVisibility="Manual">
                    <dxdo:DockLayoutManager.AutoHideGroups>
                        <dxdo:AutoHideGroup DockType="Bottom">
                            <dxdo:LayoutPanel x:Name="lpMensajes" Caption="Mensajes" AllowDockToDocumentGroup="False" AllowDrag="False" AllowFloat="False" AllowMove="False" Visibility="Collapsed" AllowHide="True" IsHitTestVisible="True" AllowDock="True" AllowClose="False" ItemHeight="160" Style="{StaticResource estilomensaje}">
                                <!--<dxdo:LayoutPanel.Appearance>
                                    <dxdo:Appearance>
                                        <dxdo:Appearance.Normal>
                                            <dxdo:AppearanceObject Background="Red" />
                                        </dxdo:Appearance.Normal>
                                    </dxdo:Appearance>
                                </dxdo:LayoutPanel.Appearance>-->

                                <Grid>
                                    <Border BorderThickness="1" Background="Beige" BorderBrush="Black" CornerRadius="10">
                                        <Grid>
                                            <my:tsGridControl x:Name="gcErrores" ItemsSource="{Binding}" AutoPopulateColumns="True">
                                                <my:tsGridControl.Columns>
                                                    <dxg:GridColumn Name="GridColumn1" FieldName="Column" Header="Errores" />
                                                </my:tsGridControl.Columns>
                                                <my:tsGridControl.View>
                                                    <dxg:TableView Name="TableView1" ShowTotalSummary="True" AllowGrouping="False" ShowGroupPanel="False" ShowIndicator="True" ShowSearchPanelCloseButton="True" ShowHorizontalLines="True" AutoWidth="True" AllowEditing="False" />
                                                </my:tsGridControl.View>
                                            </my:tsGridControl>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </dxdo:LayoutPanel>
                        </dxdo:AutoHideGroup> 
                    </dxdo:DockLayoutManager.AutoHideGroups>
                    <dxdo:LayoutGroup x:Name="RootGroup" Orientation="Horizontal">
                        <dxdo:LayoutGroup Orientation="Vertical">
                            <dxdo:LayoutPanel AllowFloat="False" AllowHide="False" AllowMove="False" ShowCloseButton="False" Name="lpContenido" ShowCaption="False">
                                <Grid Name="contenido" />
                            </dxdo:LayoutPanel>
                        </dxdo:LayoutGroup>
                    </dxdo:LayoutGroup>
                </dxdo:DockLayoutManager>               
            </Grid>
        </dxb:BarManager>
    </Grid>
</UserControl>
