Files
HandyControl/Net35/HandyControlDemo_Net35/UserControl/Basic/Avatar.xaml.cs
T
2019-01-21 00:43:10 +08:00

44 lines
1.4 KiB
C#

using System.Diagnostics;
using System.Windows;
using System.Windows.Media.Imaging;
namespace HandyControlDemo.UserControl
{
public partial class Avatar
{
public Avatar()
{
InitializeComponent();
}
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source", typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame)));
public BitmapFrame Source
{
get => (BitmapFrame) GetValue(SourceProperty);
set => SetValue(SourceProperty, value);
}
public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
"UserName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string UserName
{
get => (string) GetValue(UserNameProperty);
set => SetValue(UserNameProperty, value);
}
public static readonly DependencyProperty LinkProperty = DependencyProperty.Register(
"Link", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string Link
{
get => (string) GetValue(LinkProperty);
set => SetValue(LinkProperty, value);
}
private void ButtonAvatar_OnClick(object sender, RoutedEventArgs e) => Process.Start(Link);
}
}