Add a ContentBadge control

This commit is contained in:
TheXamlGuy
2024-07-16 20:22:37 +01:00
parent b84e3abef6
commit 40b6e10e4c
4 changed files with 13 additions and 48 deletions
+2 -5
View File
@@ -34,28 +34,23 @@
<Setter Property="Background" Value="{DynamicResource TextControlButtonBackgroundPointerOver}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrushPointerOver}" />
</Style>
<Style Selector="^ /template/ SymbolIcon#Glyph">
<Setter Property="Foreground" Value="{DynamicResource TextControlButtonForegroundPointerOver}" />
</Style>
</Style>
<Style Selector="^:pressed">
<Style Selector="^ /template/ Border#ButtonLayoutGrid">
<Setter Property="Background" Value="{DynamicResource TextControlButtonBackgroundPressed}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrushPressed}" />
</Style>
<Style Selector="^ /template/ SymbolIcon#Glyph">
<Setter Property="Foreground" Value="{DynamicResource TextControlButtonForegroundPressed}" />
</Style>
</Style>
<Style Selector="^:disabled /template/ Border#ButtonLayoutGrid">
<Setter Property="Opacity" Value="0" />
</Style>
</ControlTheme>
</SettingsExpanderItem.Resources>
<TextBox
MaxHeight="216"
@@ -68,11 +63,13 @@
Width="30"
Padding="{StaticResource HelperButtonThemePadding}"
VerticalAlignment="Stretch"
Classes="clearButton"
Command="{Binding InvokeCommand}"
Content="Add"
CornerRadius="{DynamicResource ControlCornerRadius}"
Focusable="False"
IsTabStop="False"
IsVisible="{Binding Value, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Theme="{StaticResource TextBoxAddButtonStyle}" />
</TextBox.InnerRightContent>
</TextBox>
+1 -1
View File
@@ -29,7 +29,7 @@
</SettingsExpander.Action>
<SettingsExpander.Footer>
<Grid>
<TextBox Text="{Binding Value}">
<TextBox Classes="clearButton" Text="{Binding Value}">
<TextBox.Styles>
<Style Selector="TextBox.Write">
<Setter Property="MaxWidth" Value="{Binding Width}" />
+9 -41
View File
@@ -35,47 +35,15 @@
Background="Transparent"
ColumnDefinitions="40,*">
<Grid Grid.Column="0">
<PersonPicture
Height="40"
DisplayName="{Binding Name}"
ProfilePicture="{Binding ImageDescriptor.Image}">
<PersonPicture.Clip>
<CombinedGeometry GeometryCombineMode="Exclude">
<CombinedGeometry.Geometry1>
<RectangleGeometry Rect="0,0,40,40" />
</CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2>
<PathGeometry Figures="F1 M 4.21875 19.53125 C 4.049479 19.53125 3.902995 19.467773 3.779297 19.34082 C 3.655599 19.213867 3.59375 19.065756 3.59375 18.896484 C 3.59375 18.850912 3.597005 18.815104 3.603516 18.789062 L 4.648438 12.675781 L 0.205078 8.349609 C 0.08138 8.225912 0.019531 8.079428 0.019531 7.910156 C 0.019531 7.760417 0.071615 7.623698 0.175781 7.5 C 0.279948 7.376303 0.406901 7.301434 0.556641 7.275391 L 6.689453 6.386719 L 9.443359 0.820312 C 9.495442 0.716146 9.571939 0.633139 9.672852 0.571289 C 9.773763 0.509441 9.879557 0.478516 9.990234 0.478516 C 10.107422 0.478516 10.218099 0.507812 10.322266 0.566406 C 10.426432 0.625 10.504557 0.709637 10.556641 0.820312 L 13.310547 6.386719 L 19.443359 7.275391 C 19.599609 7.301434 19.728189 7.373048 19.829102 7.490234 C 19.930012 7.607423 19.980469 7.744142 19.980469 7.900391 C 19.980469 8.082683 19.918619 8.232422 19.794922 8.349609 L 15.351562 12.675781 L 16.396484 18.789062 C 16.402994 18.815104 16.40625 18.850912 16.40625 18.896484 C 16.40625 19.065756 16.3444 19.21224 16.220703 19.335938 C 16.097004 19.459635 15.950521 19.521484 15.78125 19.521484 C 15.670572 19.521484 15.572916 19.498697 15.488281 19.453125 L 10 16.5625 L 4.511719 19.453125 C 4.420573 19.505209 4.322917 19.53125 4.21875 19.53125 Z ">
<PathGeometry.Transform>
<TransformGroup>
<TranslateTransform X="25" Y="25" />
<ScaleTransform ScaleX="0.900" ScaleY="0.900" />
</TransformGroup>
</PathGeometry.Transform>
</PathGeometry>
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</PersonPicture.Clip>
</PersonPicture>
<Rectangle ClipToBounds="False" Fill="{DynamicResource StarredIconForegroundBrush}">
<Rectangle.Clip>
<CombinedGeometry GeometryCombineMode="Intersect">
<CombinedGeometry.Geometry1>
<RectangleGeometry Rect="0,0,50,50" />
</CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2>
<PathGeometry Figures="F1 M 4.21875 19.53125 C 4.049479 19.53125 3.902995 19.467773 3.779297 19.34082 C 3.655599 19.213867 3.59375 19.065756 3.59375 18.896484 C 3.59375 18.850912 3.597005 18.815104 3.603516 18.789062 L 4.648438 12.675781 L 0.205078 8.349609 C 0.08138 8.225912 0.019531 8.079428 0.019531 7.910156 C 0.019531 7.760417 0.071615 7.623698 0.175781 7.5 C 0.279948 7.376303 0.406901 7.301434 0.556641 7.275391 L 6.689453 6.386719 L 9.443359 0.820312 C 9.495442 0.716146 9.571939 0.633139 9.672852 0.571289 C 9.773763 0.509441 9.879557 0.478516 9.990234 0.478516 C 10.107422 0.478516 10.218099 0.507812 10.322266 0.566406 C 10.426432 0.625 10.504557 0.709637 10.556641 0.820312 L 13.310547 6.386719 L 19.443359 7.275391 C 19.599609 7.301434 19.728189 7.373048 19.829102 7.490234 C 19.930012 7.607423 19.980469 7.744142 19.980469 7.900391 C 19.980469 8.082683 19.918619 8.232422 19.794922 8.349609 L 15.351562 12.675781 L 16.396484 18.789062 C 16.402994 18.815104 16.40625 18.850912 16.40625 18.896484 C 16.40625 19.065756 16.3444 19.21224 16.220703 19.335938 C 16.097004 19.459635 15.950521 19.521484 15.78125 19.521484 C 15.670572 19.521484 15.572916 19.498697 15.488281 19.453125 L 10 16.5625 L 4.511719 19.453125 C 4.420573 19.505209 4.322917 19.53125 4.21875 19.53125 Z ">
<PathGeometry.Transform>
<TransformGroup>
<TranslateTransform X="43" Y="43" />
<ScaleTransform ScaleX="0.600" ScaleY="0.600" />
</TransformGroup>
</PathGeometry.Transform>
</PathGeometry>
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</Rectangle.Clip>
</Rectangle>
<ContentBadge
BadgePath="F1 M 4.21875 19.53125 C 4.049479 19.53125 3.902995 19.467773 3.779297 19.34082 C 3.655599 19.213867 3.59375 19.065756 3.59375 18.896484 C 3.59375 18.850912 3.597005 18.815104 3.603516 18.789062 L 4.648438 12.675781 L 0.205078 8.349609 C 0.08138 8.225912 0.019531 8.079428 0.019531 7.910156 C 0.019531 7.760417 0.071615 7.623698 0.175781 7.5 C 0.279948 7.376303 0.406901 7.301434 0.556641 7.275391 L 6.689453 6.386719 L 9.443359 0.820312 C 9.495442 0.716146 9.571939 0.633139 9.672852 0.571289 C 9.773763 0.509441 9.879557 0.478516 9.990234 0.478516 C 10.107422 0.478516 10.218099 0.507812 10.322266 0.566406 C 10.426432 0.625 10.504557 0.709637 10.556641 0.820312 L 13.310547 6.386719 L 19.443359 7.275391 C 19.599609 7.301434 19.728189 7.373048 19.829102 7.490234 C 19.930012 7.607423 19.980469 7.744142 19.980469 7.900391 C 19.980469 8.082683 19.918619 8.232422 19.794922 8.349609 L 15.351562 12.675781 L 16.396484 18.789062 C 16.402994 18.815104 16.40625 18.850912 16.40625 18.896484 C 16.40625 19.065756 16.3444 19.21224 16.220703 19.335938 C 16.097004 19.459635 15.950521 19.521484 15.78125 19.521484 C 15.670572 19.521484 15.572916 19.498697 15.488281 19.453125 L 10 16.5625 L 4.511719 19.453125 C 4.420573 19.505209 4.322917 19.53125 4.21875 19.53125 Z "
BadgeSize="12"
Foreground="{DynamicResource StarredIconForegroundBrush}">
<PersonPicture
Height="40"
DisplayName="{Binding Name}"
ProfilePicture="{Binding ImageDescriptor.Image}" />
</ContentBadge>
</Grid>
<StackPanel Grid.Column="1" Margin="12,0,0,0">
<TextBlock FontWeight="SemiBold" Text="{Binding Name}" />
+1 -1
View File
@@ -28,7 +28,7 @@
<ItemEntryActionView />
</SettingsExpander.Action>
<SettingsExpander.Footer>
<TextBox Text="{Binding Value}">
<TextBox Classes="clearButton" Text="{Binding Value}">
<TextBox.Styles>
<Style Selector="TextBox.Write">
<Setter Property="MaxWidth" Value="{Binding Width}" />