1
你好,我需要刷新Image
上View
這是我的ViewPage:INotifyPropertyChanged的不工作(UWP
<Image Grid.Row="1"
Grid.Column="1"
x:Name="OriginalImg"
Source="{Binding Orig}"
DataContext="{StaticResource MainViewModel}"/>
進出口使用MVVMLibs包,這是我的ViewModel:
public class MainViewModel: ViewModelBase
{
private WriteableBitmap original = new WriteableBitmap(1280,720);
private WriteableBitmap temp = new WriteableBitmap(1280,720);
public WriteableBitmap Orig
{
get { return original; }
set
{
this.original = value;
base.RaisePropertyChanged("Orig");
}
}
public async Task<bool> ApplyEffectAsync(StorageFile file)
{
fileStream = await file.OpenAsync(FileAccessMode.Read);
temp.SetSource(fileStream);
Orig = temp;
}
}
上
但Image
我頁面不顯示。什麼是我的問題?
「ApplyEffectAsync」在哪裏調用? – niksofteng
它在另一個類中用'ICommand'調用,並且此方法正常工作。然後下一個VS去我的二傳手,並調用'RaisePropertyChanged',但沒有任何顯示在我看到 – SmiLe
張貼它。我使用'Source =「{Binding Orig}」' – SmiLe