視圖有一個按鈕和圖像控件。我已經將按鈕命令綁定到ViewModel上的一個delegateCommand,它打開一個文件對話框供用戶選擇一個Image.The上下文「object」 for View包含一個屬性「Icon」,其類型爲byte []。我已經將圖標綁定到Image控件。問題是如何在圖像控件上顯示選定的圖像文件?如何更新按鈕上的圖像點擊命令
的XAML:
<Button x:Name="dlgIconbtn" Command="{Binding OpenFileCommand}" Content="Choose Icon" MaxWidth="120" Grid.Row="3" Grid.Column="1" Margin="5"/>
<Image Grid.Row="3" Margin="5" Grid.Column="3" Source="{Binding AppItem.Icon,Converter={StaticResource imgConverter}}"
Width="25" Height="25"/>
標籤不會爲您的標題添加任何內容。 – Will 2011-12-16 17:27:54