Как биндит Image? Поля типа string и bool отображаются, а Image не отображается. C#,WPF
<av:Window x:Class="MessengerVK.MessageManager"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModel="clr-namespace:MessengerVK.ViewModel"
Title="MessageManager"
Width="640"
Height="480"
mc:Ignorable="d">
<Window.DataContext>
<viewModel:MessageManagerViewModel/>
</Window.DataContext>
<av:Grid ShowGridLines="True">
<av:Grid.ColumnDefinitions>
<av:ColumnDefinition Width="2*" />
<av:ColumnDefinition Width="4*" />
<av:ColumnDefinition Width="1*" />
</av:Grid.ColumnDefinitions>
<av:Grid.RowDefinitions>
<av:RowDefinition Height="1*" />
<av:RowDefinition Height="2*" />
<av:RowDefinition Height="6*" />
<av:RowDefinition Height="2*" />
</av:Grid.RowDefinitions>
<ListView Grid.Column="0" Grid.Row="2" Grid.RowSpan="2">
<ListViewItem>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Width="70" Text="{Binding Path=Template.Name}"/>
<TextBlock Grid.Column="1" Width="50" Text="{Binding Path=Template.Online}"/>
<Image Grid.Column="2" Width="70" Height="70" Source="{Binding Path=Template.Avatar}"/>
</Grid>
</ListViewItem>
</ListView>
</Grid>
</av:Grid>
public class Friend
{
public string Name { get; set; }
public bool Online { get; set; }
public Image Avatar { get; set; }
}
public class MessageManagerViewModel:ViewModelBase,INotifyPropertyChanged
{
private Friend template;
public Friend Template
{
get
{
return template;
}
set
{
template = value;
}
}
public MessageManagerViewModel()
{
Template.Name = "Azizxon";
Template= Image.FromFile(@"C:\Users\Lenovo\Desktop\a.png");
}
}
av
?