EscribePassword/MainWindow.xaml

42 lines
2.5 KiB
Plaintext
Raw Normal View History

2024-06-15 06:24:07 -03:00
<Window x:Class="EscribePassword.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"
2024-06-15 14:33:52 -03:00
xmlns:local="clr-namespace:EscribePassword" mc:Ignorable="d" Title="MainWindow" Height="450" Width="300"
AllowsTransparency="True" WindowStyle="None" MouseDown="Window_MouseDown">
2024-06-15 06:24:07 -03:00
<Window.DataContext>
<local:MView />
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
2024-06-15 14:33:52 -03:00
<DataGrid Grid.Row="0" ItemsSource="{Binding Passwords}" SelectedItem="{Binding SelectedPassword}"
AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False">
2024-06-15 06:24:07 -03:00
<DataGrid.Columns>
<DataGridTextColumn Header="Usuario" Binding="{Binding Usuario}" Width="*" />
<DataGridTextColumn Header="Contraseña" Binding="{Binding Password}" Width="*" />
<DataGridTemplateColumn Header="Acciones" Width="Auto">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2024-06-15 14:33:52 -03:00
<StackPanel Orientation="Horizontal">
<Button Content="Eliminar"
Command="{Binding DataContext.EliminarCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
CommandParameter="{Binding}" />
<Button Content="Utilizar"
Command="{Binding DataContext.UtilizarCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
CommandParameter="{Binding}" Margin="5,0,0,0" />
</StackPanel>
2024-06-15 06:24:07 -03:00
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
2024-06-15 14:33:52 -03:00
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" Margin="10,10,10,10">
2024-06-15 06:24:07 -03:00
<Button Content="Agregar" Command="{Binding AgregarCommand}" Margin="5" />
2024-06-15 14:33:52 -03:00
<Button Content="Cerrar" Command="{Binding CerrarCommand}" Margin="5" />
2024-06-15 06:24:07 -03:00
</StackPanel>
</Grid>
</Window>