Skip to content

NOTE

Inherited from TitleElement

Attributes

NameUse
PlaceholderPlaceholder (input prompt)
NecessaryRequired?
SymbolTag Information
ContentHeightContent Height
MinContentHeightMinimum Content Height
MaxContentHeightMaximum Content Height
RegexPatternRegex Pattern
ShowClearButton

Use Cases

Placeholder

xml
<StackPanel Width="200" VerticalAlignment="Center">
    <hc:SearchBar/>
    <hc:SearchBar hc:InfoElement.Placeholder="请输入查询条件" Style="{StaticResource SearchBarExtend}" Margin="0,16,0,0"/>
</StackPanel>

InfoElement.Placeholder

Necessary

xml
     <hc:SearchBar hc:InfoElement.Placeholder="Please enter the query criteria"
                   Hc:InfoElement.Title="Query Condition"
                   Margin="10,10" hc:InfoElement.Necessary="True"
                   Style="{StaticResource SearchBarExtend}"/>

Where hc:InfoElement.Title="query condition" inherited from parent class

effect:

InfoElement.Necssary

Symbol

xml
     <hc:SearchBar hc:InfoElement.Placeholder="Please enter the content"
               Hc:InfoElement.Title="This item is required" Style="{StaticResource SearchBarExtend}"
               Margin="10,10" hc:InfoElement.Necessary="True"
               Hc:InfoElement.Symbol="x"/>

InfoElement.Symbol

ContentHeight

xml
     <hc:SearchBar hc:InfoElement.Placeholder="Please enter the query criteria"
                   Hc:InfoElement.ContentHeight="50"
                   Hc:InfoElement.Title="Query Condition"
                   Margin="10,10" hc:InfoElement.Necessary="True"
                   Style="{StaticResource SearchBarExtend}"/>

InfoElement.ContentHeight

RegexPattern

By setting this attribute, you can customize the verification logic inside the information element to realize error prompts for content outside the specified format.

Released under the MIT License.