<UserControl x:Class="Tgw.SouthHub.UI.Administration.Views.WareHouseMapView"
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:local="clr-namespace:Tgw.SouthHub.UI.Administration.Views"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:conv="clr-namespace:Tgw.SouthHub.UI.Administration.Views.Converters"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<Style x:Key="NameCellStyle" TargetType="DataGridCell">
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Button Height="50" Width="100" Command="{Binding UpdateAisleOne}" Margin="10,10,10,10">Pasillo 1</Button>
<Button Height="50" Width="100" Command="{Binding UpdateAisleTwo}" Margin="10,10,10,10">Pasillo 2</Button>
<Button Height="50" Width="150" Command="{Binding UpdateConventional}" Margin="10,10,10,10">Convencional</Button>
<Button Height="50" Width="150" Command="{Binding bloqCell_Click}" Margin="10,10,10,10">Bloq Celda</Button>
<Button Height="50" Width="150" Command="{Binding habiCell_Click}" Margin="10,10,10,10">Habi Celda</Button>
<Button Height="50" Width="150" Command="{Binding cmdMapInventory_Click}" Margin="10,10,10,10">Inventariar</Button>
<Button Height="50" Width="150" Command="{Binding cmdMapCancelReservation_Click}" Margin="10,10,10,10">Cencelar Reserva</Button>
</StackPanel>
<DataGrid AutoGenerateColumns="True" Margin="10,10,10,10" ItemsSource="{Binding ContentAisle}" MinRowHeight="9"
FontSize="9" IsReadOnly="True" SelectionUnit="Cell" SelectionMode="Extended" CellStyle="{StaticResource NameCellStyle}" CurrentCell="{Binding CeldaSeleccionada, Mode=OneWayToSource}">
</DataGrid>
<DataGrid AutoGenerateColumns="True" Margin="10,10,10,10" ItemsSource="{Binding ContentAisle2}" MinRowHeight="9"
FontSize="9" IsReadOnly="True" SelectionUnit="Cell" SelectionMode="Extended" CellStyle="{StaticResource NameCellStyle}" CurrentCell="{Binding CeldaSeleccionada, Mode=OneWayToSource}">
</DataGrid>
</StackPanel>
</Grid>
private DataGridCellInfo celdaSeleccionada;
private ICommand _bloq_Cell;
public ICommand bloqCell_Click
{
get
{
return _bloq_Cell ?? (_bloq_Cell = new CommandHandler((object param) => bloqCell(), true));
}
}
private void bloqCell()
{
var celda = GetDataGridCell(celdaSeleccionada);
}
public DataGridCellInfo CeldaSeleccionada
{
get
{
return this.celdaSeleccionada;
}
set
{
this.celdaSeleccionada = value;
this.NotifyOfPropertyChange("CellInfo");
}
}
public DataGridCell GetDataGridCell(DataGridCellInfo cellInfo)
{
var cellContent = cellInfo.Column.GetCellContent(cellInfo.Item);
if (cellContent != null)
return (DataGridCell)cellContent.Parent;
return null;
}
El ultimo metodo al hacer debug se ve como cellinfo.Item esta vacio y no puede continuar.