Hello,
I wrote an app has 1 datepicker, 2 textblocks, 2 textboxes, and 2 buttons.
My problem is one of the buttons remains unabled like below.
xaml code for this view is:
<Window x:Class="WpfApp3.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"
xmlns:local="clr-namespace:WpfApp3"
xmlns:model ="clr-namespace:WpfApp3.Model"
xmlns:viewModel ="clr-namespace:WpfApp3.ViewModel"
mc:Ignorable="d"
Background="AliceBlue"
ResizeMode="NoResize"
Title="MainWindow" Height="400" Width="350">
<Window.DataContext>
<viewModel:MainViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="1.8*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" x:Name="Date" Text="Date:" FontSize="20" FontWeight="Bold" Margin="10,10,10,10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<DatePicker x:Name="getdate" SelectedDate="{Binding SelectedDate}" Grid.Column="1" Width="200" Height="20" Margin="10,10,10,10" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="1.8*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" x:Name="Item" Text="Item:" FontSize="20" FontWeight="Bold" Margin="10,40,10,40" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Grid.Column="1" FontSize="14" Text="{Binding Item}" Margin="10,40,10,40"/>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="1.8*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" x:Name="Amount" Text="Amount:" FontSize="20" FontWeight="Bold" Margin="10,40,10,40" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Grid.Column="1" FontSize="14" Text="{Binding Amount}" Margin="10,40,10,40"/>
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="ShowInput" Command="{Binding getInputCommand}" FontSize="14" FontWeight="Bold" Margin="20,10,20,10"/>
<Button Grid.Column="1" Content="Clear" FontSize="14" Command="{Binding ClearCommand}" FontWeight="Bold" Margin="20,10,20,10"/>
</Grid>
</Grid>
</Window>
I changed "isEnabled" property for the button several times and saved it but these trials didn't work.
I didn't experience case like this before, so I don't know how can i fix it.
if anyone give me an advice for this, I'd be very appreciated.
thanks for your help in advance.
c00012