Skip to content

Commit

Permalink
change: PersonPicture default size
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed Aug 23, 2024
1 parent dc067e7 commit c7366de
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 31 deletions.
36 changes: 9 additions & 27 deletions src/Wpf.Ui.Test/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -534,37 +534,19 @@
Text="PersonPicture" />
<StackPanel Margin="0,8,0,0" Orientation="Horizontal">
<TextBlock
MinWidth="80"
VerticalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
Text="Normal" />
<Border Width="45" Height="45">
<vio:PersonPicture
Width="45"
Height="45"
HorizontalAlignment="Left"
VerticalAlignment="Top"
BadgeGlyph="\uE765"
BadgeNumber="1"
DisplayName="James Bond"
Initials="JB" />
</Border>
<Border MaxWidth="45" MaxHeight="45">
<vio:PersonPicture
Width="45"
Height="45"
HorizontalAlignment="Left"
VerticalAlignment="Top"
ProfilePicture="pack://application:,,,/Wpf.Ui.Test;component/Resources/Images/ProfilePicture.ico" />
</Border>
<Border MaxWidth="45" MaxHeight="45">
<vio:PersonPicture
Width="45"
Height="45"
HorizontalAlignment="Left"
VerticalAlignment="Top"
ProfilePicture="https://docs.microsoft.com/windows/uwp/contacts-and-calendar/images/shoulder-tap-static-payload.png" />
</Border>
<vio:PersonPicture
Margin="16,0,0,0"
BadgeGlyph="\uE765"
BadgeNumber="1"
DisplayName="James Bond"
Initials="JB" />
<vio:PersonPicture Margin="16,0,0,0" ProfilePicture="pack://application:,,,/Wpf.Ui.Test;component/Resources/Images/ProfilePicture.ico" />
<vio:PersonPicture Margin="16,0,0,0" ProfilePicture="https://docs.microsoft.com/zh-cn/windows/uwp/contacts-and-calendar/images/shoulder-tap-static-payload.png" />
</StackPanel>
</StackPanel>
</StackPanel>
Expand Down
4 changes: 2 additions & 2 deletions src/Wpf.Ui.Violeta/Controls/PersonPicture/PersonPicture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void UpdateIfReady()
}
else
{
templateSettings.ActualImageBrush = null;
templateSettings.ActualImageBrush = null!;
}

// If the control is converted to 'Group-mode', we'll clear individual-specific information.
Expand Down Expand Up @@ -233,7 +233,7 @@ void UpdateBadgeImageSource()
{
if (m_badgeImageBrush == null)
{
m_badgeImageBrush = GetTemplateChild("BadgeImageBrush") as ImageBrush;
m_badgeImageBrush = (ImageBrush)GetTemplateChild("BadgeImageBrush");
}

if (m_badgingEllipse == null || m_badgeImageBrush == null)
Expand Down
4 changes: 2 additions & 2 deletions src/Wpf.Ui.Violeta/Controls/PersonPicture/PersonPicture.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<Style TargetType="local:PersonPicture">
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="Width" Value="96" />
<Setter Property="Height" Value="96" />
<Setter Property="Width" Value="60" />
<Setter Property="Height" Value="NaN" />
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="IsTabStop" Value="False" />
Expand Down

0 comments on commit c7366de

Please sign in to comment.