add Recommendation
This commit is contained in:
1 parent
ee4125e2bf
commit
cf5f84869d
33 files changed
+320
-141
No files matched your search
@@ -2,12 +2,13 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
Margin="16"
|
||||
Effect="{StaticResource EffectShadow5}"
|
||||
Cursor="Hand"
|
||||
mc:Ignorable="d">
|
||||
<Button Style="{StaticResource ButtonCustom}" Click="ButtonAvatar_OnClick">
|
||||
<Button Style="{StaticResource ButtonCustom}" Command="hc:ControlCommands.OpenLink" CommandParameter="{Binding Link,RelativeSource={RelativeSource AncestorType=UserControl}}" >
|
||||
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="10">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -15,7 +16,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="{Binding Source,RelativeSource={RelativeSource AncestorType=UserControl}}" Height="120" Width="120" Stretch="Uniform" Margin="10"/>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="0,0,0,10" Grid.Row="1" Style="{StaticResource TextBlockDefault}" Text="{Binding UserName,RelativeSource={RelativeSource AncestorType=UserControl}}"></TextBlock>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="0,0,0,10" Grid.Row="1" Style="{StaticResource TextBlockDefault}" Text="{Binding DisplayName,RelativeSource={RelativeSource AncestorType=UserControl}}"></TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Button>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class Avatar
|
||||
@@ -22,9 +20,9 @@ namespace HandyControlDemo.UserControl
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
|
||||
"UserName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
|
||||
"DisplayName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
|
||||
|
||||
public string UserName
|
||||
public string DisplayName
|
||||
{
|
||||
get => (string) GetValue(UserNameProperty);
|
||||
set => SetValue(UserNameProperty, value);
|
||||
@@ -38,7 +36,5 @@ namespace HandyControlDemo.UserControl
|
||||
get => (string) GetValue(LinkProperty);
|
||||
set => SetValue(LinkProperty, value);
|
||||
}
|
||||
|
||||
private void ButtonAvatar_OnClick(object sender, RoutedEventArgs e) => Process.Start(Link);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user