Skip to content

This control encapsulates a complete set of logic for image selection, display, and deletion.

cs
public class ImageSelector : Control

Attributes

PropertyDescriptionDefault ValueRemarks
StretchPicture stretch modeStretch.None
UriPicture Resources
PreviewBrushPreview drawing brush
StrokeThicknessBorder thickness
StrokeDashArrayBorder dashed array
DefaultExtDefault picture suffix name.jpg
FilterPicture filter string(.jpg)|.jpg|(.png)|.png
HasValueIs there a valuefalse

Style

StyleDescription
ImageSelectorBaseStyleDefault Style

Event

name
ImageSelected
ImageUnSelected

Case

xml
<UniformGrid Columns="3" Margin="16">
    <hc:ImageSelector Width="100" Height="100" Margin="16"/>
    <hc:ImageSelector Width="100" Height="100" Margin="16" hc:BorderElement.CornerRadius="50"/>
    <hc:ImageSelector Width="100" Height="100" Margin="16" hc:BorderElement.CornerRadius="50" StrokeDashArray="10,5"/>
    <hc:ImageSelector Width="100" Height="100" Margin="16" hc:BorderElement.CornerRadius="50" BorderBrush="{DynamicResource SuccessBrush}"/>
    <hc:ImageSelector Width="100" Height="100" Margin="16" hc:BorderElement.CornerRadius="50" StrokeDashArray="10,5,10" BorderBrush="{DynamicResource DangerBrush}"/>
    <hc:ImageSelector Width="100" Height="100" Margin="16" hc:BorderElement.CornerRadius="10" StrokeThickness="2" BorderThickness="2" BorderBrush="{DynamicResource PrimaryBrush}"/>
</UniformGrid>

ImageSelector

Released under the MIT License.