Melhorias no layout e usabilidade de MainWindow
- Associado o evento de carregamento da janela ao método `Window_Loaded` em MainWindow.xaml. - Ajustada a estrutura de `<Grid.RowDefinitions>` para melhorar o layout. - Adicionado `<TextBox>` `txtEmpresaSearch` vinculado ao ViewModel para busca de empresas. - Definida altura fixa de `213` no `<ListView>` para consistência visual. - Implementado o método `Window_Loaded` em MainWindow.xaml.cs para definir foco inicial no campo de busca.
This commit is contained in:
parent
674af18617
commit
50c5e390ba
@ -5,13 +5,14 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:BD_empresa"
|
||||
mc:Ignorable="d"
|
||||
Loaded="Window_Loaded"
|
||||
Title="Pesquisar Unidades" Height="650" Width="800">
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
@ -38,6 +39,7 @@
|
||||
Command="{Binding RefreshCommand}"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBox
|
||||
x:Name="txtEmpresaSearch"
|
||||
Margin="0,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="2"
|
||||
@ -54,7 +56,7 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Empresas:" Margin="10,0,10,0" FontWeight="Bold" Grid.Row="0"/>
|
||||
<ListView ItemsSource="{Binding Clientes}" Margin="10" SelectedItem="{Binding SelectedCliente, Mode=TwoWay}" Grid.Row="1">
|
||||
<ListView ItemsSource="{Binding Clientes}" Height="213" Margin="10" SelectedItem="{Binding SelectedCliente, Mode=TwoWay}" Grid.Row="1">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Header="Gestão" DisplayMemberBinding="{Binding Gestao}" Width="70" />
|
||||
|
||||
@ -24,6 +24,10 @@ namespace BD_empresa
|
||||
var accessService = new Data.AccessService($"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={accessDbPath};Jet OLEDB:Database Password=gds21");
|
||||
DataContext = new ViewModels.MainWindowViewModel(accessService);
|
||||
}
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txtEmpresaSearch.Focus();
|
||||
}
|
||||
|
||||
private void UnidadeListView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user