<dx:DXWindow
    x:Class="VentanaProgreso"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"    
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"   
    ContentRendered="Window_ContentRendered" 
    Title="Progreso" Height="209" Width="833" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow">
    <Window.Resources>
        <dx:FormatStringConverter x:Key="FormatStringConverter" FormatString="0" />
        <ControlTemplate x:Key="InplaceProgressBarTemplate" TargetType="{x:Type ProgressBar}">
            <Grid>
                <Border Name="PART_Track">
                    <Border Name="PART_Indicator" HorizontalAlignment="Left" Background="#FFBA4F8C" Opacity="0.5" />
                </Border>
                <Border BorderBrush="#1F000000" BorderThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" Background="#FFFFFFFF" CornerRadius="2,2,2,2">
                    <TextBlock TextAlignment="Center" TextWrapping="NoWrap" Margin="5,-2,5,-2" Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource FormatStringConverter}}" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
            </Grid>
        </ControlTemplate>
        <DataTemplate x:Key="progressTemplate">
            <ProgressBar Margin="2,1,2,1" Minimum="0" Maximum="100" DataContext="{Binding Path=Data, ConverterParameter=AnimationElement}" Value="{Binding Path=Progreso}" Template="{StaticResource InplaceProgressBarTemplate}"  />
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="4" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <dxg:GridControl x:Name="gc" Grid.Row="0" >
            <dxg:GridControl.Columns>
                <dxg:GridColumn FieldName="FechaInicio" Header="Hora Inicio" >
                    <dxg:GridColumn.EditSettings>
                        <dxe:TextEditSettings MaskType="DateTime" Mask="dd-MMMM-yyyy HH:mm:ss"/>
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
                <dxg:GridColumn FieldName="Descripcion" Header="Descripción" IsSmart="True" Width="530"/>
                <dxg:GridColumn FieldName="Progreso"  Width="100" CellTemplate="{StaticResource progressTemplate}"  />
            </dxg:GridControl.Columns>
            <dxg:GridControl.View>
                <dxg:TableView x:Name="tv" ShowTotalSummary="False" ShowGroupPanel="False" AllowFilterEditor="False" AllowEditing="False" AllowColumnFiltering="False" />
            </dxg:GridControl.View>
        </dxg:GridControl>
        <Grid Grid.Row="2" Height="20">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="80" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0"><Run Text="Progreso:"/></TextBlock>
            <dxe:ProgressBarEdit x:FieldModifier="Public" x:Name="ProgresoGeneral" Minimum="0" Maximum="100" EditValue="0" ContentDisplayMode="Value" Grid.Column="1">
            </dxe:ProgressBarEdit>
            <Button x:Name="btCancelar" x:FieldModifier="Public" Grid.Column="2" Padding="10,0,10,0" Content="Cancelar" Click="btCancelar_Click" />
        </Grid>
    </Grid>
</dx:DXWindow> 
