Skip to content

A simple ContentControl to display on a page where there is no information

c
public class Empty : ContentControl

Attributes

NameUse
DescriptionGet or set Description Text
LogoGet or set Logo
ShowEmptyShow or Hide Empty View

NOTE

These controls will display an empty view if you set hc:Empty.ShowEmpty="true"

  • ListBox
  • DataGrid
  • TreeView
  • ComboBox
  • CheckComboBox
  • ListView

Case

xml
<ListBox hc:Empty.ShowEmpty="true"/>

or

xml
<hc:ToggleBlock IsChecked="{Binding ElementName=lst, Path=HasItems, Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
    <hc:ToggleBlock.CheckedContent>
        <ListBox Name="lst"/>
    </hc:ToggleBlock.CheckedContent>
    <hc:ToggleBlock.UnCheckedContent>
        <hc:Empty hc:Empty.ShowEmpty="true"/>
        <!-- OR -->
        <!-- 
         <hc:Empty Description="No Data" hc:Empty.ShowEmpty="true">
            <hc:Empty.Logo>
                <Path Data="{DynamicResource EmptyGeometry}"/>
            </hc:Empty.Logo>
        </hc:Empty>
         -->
    </hc:ToggleBlock.UnCheckedContent>
</hc:ToggleBlock>

Empty

Released under the MIT License.