更新
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Controls"
|
||||
xmlns:primitives="clr-namespace:WPFluent.Controls.Primitives"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<!-- Resources for PersonPicture -->
|
||||
<SolidColorBrush x:Key="PersonPictureEllipseBadgeForegroundThemeBrush" Color="{DynamicResource SystemBaseHighColor}" />
|
||||
<SolidColorBrush x:Key="PersonPictureEllipseBadgeFillThemeBrush" Color="{DynamicResource SystemChromeDisabledHighColor}" />
|
||||
<SolidColorBrush x:Key="PersonPictureEllipseBadgeStrokeThemeBrush" Color="{DynamicResource SystemListMediumColor}" />
|
||||
<SolidColorBrush Color="{DynamicResource SystemBaseHighColor}" x:Key="PersonPictureEllipseBadgeForegroundThemeBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource SystemChromeDisabledHighColor}" x:Key="PersonPictureEllipseBadgeFillThemeBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource SystemListMediumColor}" x:Key="PersonPictureEllipseBadgeStrokeThemeBrush" />
|
||||
<sys:Double x:Key="PersonPictureEllipseBadgeStrokeOpacity">0.8</sys:Double>
|
||||
<sys:Double x:Key="PersonPictureEllipseBadgeImageSourceStrokeOpacity">1.0</sys:Double>
|
||||
<sys:Double x:Key="PersonPictureEllipseStrokeThickness">1</sys:Double>
|
||||
@@ -34,69 +33,69 @@
|
||||
|
||||
<Grid x:Name="RootGrid">
|
||||
<Ellipse
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Fill="{DynamicResource ControlAltFillColorQuarternaryBrush}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Stroke="{DynamicResource CardStrokeColorDefaultBrush}"
|
||||
StrokeThickness="{DynamicResource PersonPictureEllipseStrokeThickness}" />
|
||||
StrokeThickness="{DynamicResource PersonPictureEllipseStrokeThickness}"
|
||||
Width="{TemplateBinding Width}" />
|
||||
|
||||
<TextBlock
|
||||
x:Name="InitialsTextBlock"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="40"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ActualInitials}">
|
||||
HorizontalAlignment="Center"
|
||||
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ActualInitials}"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="InitialsTextBlock">
|
||||
<TextBlock.RenderTransform>
|
||||
<TranslateTransform Y="-2" />
|
||||
</TextBlock.RenderTransform>
|
||||
</TextBlock>
|
||||
|
||||
<controls:FontIconFallback
|
||||
x:Name="PlaceholderIcon"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="{Binding FontSize, ElementName=InitialsTextBlock}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Visibility="Collapsed">
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="Collapsed"
|
||||
x:Name="PlaceholderIcon">
|
||||
<controls:FontIconFallback.RenderTransform>
|
||||
<TranslateTransform Y="-2" />
|
||||
</controls:FontIconFallback.RenderTransform>
|
||||
</controls:FontIconFallback>
|
||||
|
||||
<Ellipse
|
||||
x:Name="PersonPictureEllipse"
|
||||
Width="{TemplateBinding Width}"
|
||||
FlowDirection="LeftToRight"
|
||||
Height="{TemplateBinding Height}"
|
||||
FlowDirection="LeftToRight" />
|
||||
Width="{TemplateBinding Width}"
|
||||
x:Name="PersonPictureEllipse" />
|
||||
|
||||
<Grid
|
||||
x:Name="BadgeGrid"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Visibility="Collapsed">
|
||||
Visibility="Collapsed"
|
||||
x:Name="BadgeGrid">
|
||||
|
||||
<Ellipse
|
||||
x:Name="BadgingBackgroundEllipse"
|
||||
Fill="{DynamicResource PersonPictureEllipseBadgeFillThemeBrush}"
|
||||
Opacity="{DynamicResource PersonPictureEllipseBadgeStrokeOpacity}"
|
||||
Stroke="{DynamicResource PersonPictureEllipseBadgeStrokeThemeBrush}"
|
||||
StrokeThickness="{DynamicResource PersonPictureEllipseBadgeStrokeThickness}" />
|
||||
StrokeThickness="{DynamicResource PersonPictureEllipseBadgeStrokeThickness}"
|
||||
x:Name="BadgingBackgroundEllipse" />
|
||||
|
||||
<Ellipse
|
||||
x:Name="BadgingEllipse"
|
||||
FlowDirection="LeftToRight"
|
||||
Opacity="0" />
|
||||
Opacity="0"
|
||||
x:Name="BadgingEllipse" />
|
||||
|
||||
<TextBlock
|
||||
x:Name="BadgeNumberTextBlock"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Foreground="{DynamicResource PersonPictureEllipseBadgeForegroundThemeBrush}">
|
||||
Foreground="{DynamicResource PersonPictureEllipseBadgeForegroundThemeBrush}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="BadgeNumberTextBlock">
|
||||
<TextBlock.RenderTransform>
|
||||
<TranslateTransform Y="-1" />
|
||||
</TextBlock.RenderTransform>
|
||||
@@ -104,12 +103,12 @@
|
||||
|
||||
<!-- Default font family to "Segoe MDL2 Assets" -->
|
||||
<controls:FontIcon
|
||||
x:Name="BadgeGlyphIcon"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Foreground="{DynamicResource PersonPictureEllipseBadgeForegroundThemeBrush}" />
|
||||
Foreground="{DynamicResource PersonPictureEllipseBadgeForegroundThemeBrush}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="BadgeGlyphIcon" />
|
||||
</Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
@@ -133,7 +132,7 @@
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BadgingEllipse" Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<ImageBrush x:Name="BadgeImageBrush" Stretch="UniformToFill" />
|
||||
<ImageBrush Stretch="UniformToFill" x:Name="BadgeImageBrush" />
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
@@ -146,29 +145,29 @@
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<!-- Visual State when a Photo is available for display -->
|
||||
<Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="Photo">
|
||||
<Setter TargetName="PersonPictureEllipse" Property="Fill" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ActualImageBrush}" />
|
||||
<Trigger Property="CurrentStateName" SourceName="CommonStatesListener" Value="Photo">
|
||||
<Setter Property="Fill" TargetName="PersonPictureEllipse" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ActualImageBrush}" />
|
||||
</Trigger>
|
||||
<!-- Visual State when no Photo is available (but there are initials). -->
|
||||
<Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="NoPhotoOrInitials">
|
||||
<Setter TargetName="InitialsTextBlock" Property="Visibility" Value="Collapsed" />
|
||||
<Trigger Property="CurrentStateName" SourceName="CommonStatesListener" Value="NoPhotoOrInitials">
|
||||
<Setter Property="Visibility" TargetName="InitialsTextBlock" Value="Collapsed" />
|
||||
<!-- Placeholder symbol for 'Contact' (https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font) -->
|
||||
<Setter TargetName="PlaceholderIcon" Property="Data" Value="{StaticResource Contact}" />
|
||||
<Setter TargetName="PlaceholderIcon" Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Data" TargetName="PlaceholderIcon" Value="{StaticResource Contact}" />
|
||||
<Setter Property="Visibility" TargetName="PlaceholderIcon" Value="Visible" />
|
||||
</Trigger>
|
||||
<!-- Visual State when in Group mode -->
|
||||
<Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="Group">
|
||||
<Setter TargetName="InitialsTextBlock" Property="Visibility" Value="Collapsed" />
|
||||
<Trigger Property="CurrentStateName" SourceName="CommonStatesListener" Value="Group">
|
||||
<Setter Property="Visibility" TargetName="InitialsTextBlock" Value="Collapsed" />
|
||||
<!-- Placeholder symbol for 'People' (https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font) -->
|
||||
<Setter TargetName="PlaceholderIcon" Property="Data" Value="{StaticResource People}" />
|
||||
<Setter TargetName="PlaceholderIcon" Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Data" TargetName="PlaceholderIcon" Value="{StaticResource People}" />
|
||||
<Setter Property="Visibility" TargetName="PlaceholderIcon" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger SourceName="BadgeStatesListener" Property="CurrentStateName" Value="BadgeWithoutImageSource">
|
||||
<Setter TargetName="BadgeGrid" Property="Visibility" Value="Visible" />
|
||||
<Trigger Property="CurrentStateName" SourceName="BadgeStatesListener" Value="BadgeWithoutImageSource">
|
||||
<Setter Property="Visibility" TargetName="BadgeGrid" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger SourceName="BadgeStatesListener" Property="CurrentStateName" Value="BadgeWithImageSource">
|
||||
<Setter TargetName="BadgeGrid" Property="Visibility" Value="Visible" />
|
||||
<Setter TargetName="BadgingEllipse" Property="Opacity" Value="{DynamicResource PersonPictureEllipseBadgeImageSourceStrokeOpacity}" />
|
||||
<Trigger Property="CurrentStateName" SourceName="BadgeStatesListener" Value="BadgeWithImageSource">
|
||||
<Setter Property="Visibility" TargetName="BadgeGrid" Value="Visible" />
|
||||
<Setter Property="Opacity" TargetName="BadgingEllipse" Value="{DynamicResource PersonPictureEllipseBadgeImageSourceStrokeOpacity}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
Reference in New Issue
Block a user