Click here to Skip to main content
15,908,775 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
this is my View
<Image Height="275" HorizontalAlignment="Left" Margin="26,12,0,0"
Name="image1" Stretch="Fill" VerticalAlignment="Top" Source="{Binding LatestImage,Mode=TwoWay,NotifyOnTargetUpdated=True}" Width="454" />
<Button Content="Button" Height="40" HorizontalAlignment="Left"
Margin="66,312,0,0" Name="button1" VerticalAlignment="Top" Width="182" Command="{Binding StartCameraCommand}" />

ViewModel:

private RelayCommand startCameraCommand;

public MainWindowViewModel()
{
StartCamera();
}
public ICommand StartCameraCommand
{
get
{
return startCameraCommand ?? (startCameraCommand = new RelayCommand(param => StartCamera()));
}
}

private ImageSource latestImage;
public ImageSource LatestImage
{
get
{
return latestImage;
}
set
{
latestImage = value;
NotifyPropertyChanged("LatestImage");
}
}

I am assigning value to latestimage but it is not updating to the view.I can't able to see the image on the view.

Please suggest me some sample regarding this problem as it is very urgent i dont know wat went wrong.
But when I am assigning value in constructor it is working fine,but after clicking the button it is updating the UI
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900