I Have 2 button , Start And capture. I want disable capture button on form load and enable start. and on after click on start disable start button and enable capture. Please help me. Thanks in advance
Edit
<Grid>
<Button Content="Button" Height="77" HorizontalAlignment="Left" Margin="92,151,0,0" Name="button1" VerticalAlignment="Top" Width="109">
<Button.Background>
<ImageBrush ImageSource="/WpfApplication1;component/Images/images.jpg" />
</Button.Background>
</Button>
<Button Content="Button" Height="77" HorizontalAlignment="Left" Margin="229,151,0,0" Name="button2" VerticalAlignment="Top" Width="112" IsEnabled="False" >
<Button.Background>
<ImageBrush ImageSource="/WpfApplication1;component/Images/images.jpg" />
</Button.Background>
</Button>
</Grid>
you can disable Capture by xaml and then enable it by writing code in c#.
for enable and disable use IsEnabled Property. and for clicking on the button use Click event.
Set IsEnabled="False" to disable the button
Set IsEnabled="True" to enable the button
Hope this helps
Yes I got my answer. Just make simeple solution
You should store current state in some variable (e.g.
_capturing
). When variable changing, you refreshIsEnabled
property.Xaml code:
C# code:
UPDATE
You should add click handler and your xaml code will work: