Table of Contents
Empty Prompt

EO.Wpf ComboBox can display an "empty prompt" when the ComboBox is empty. To set the empty prompt, simply set the ComboBox's EmptyPrompt property. For example, the following code set the ComboBox's empty prompt to "--Please select an item--":

XAML
<Window x:Class="Test.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:eo="http://schemas.essentialobjects.com/wpf/"
        Title="MainWindow" Height="250" Width="350">
    <StackPanel Margin="10">
        <eo:ComboBox Width="200" HorizontalAlignment="Left" EmptyPrompt="--Please select an item--">
            <eo:ComboBoxItem>Item 1</eo:ComboBoxItem>
            <eo:ComboBoxItem>Item 2</eo:ComboBoxItem>
            <eo:ComboBoxItem>Item 3</eo:ComboBoxItem>
            <eo:ComboBoxItem>Item 4</eo:ComboBoxItem>
            <eo:ComboBoxItem>Item 5</eo:ComboBoxItem>
        </eo:ComboBox>
    </StackPanel>
</Window>

The above code produces the following result:

Property EmptyPrompt can be any object, not just a string. The following XAML uses a TextBlock object and set the FontStyle and Foreground property on the TextBlock object:

XAML
<Window x:Class="Test.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:eo="http://schemas.essentialobjects.com/wpf/"
        Title="MainWindow" Height="250" Width="350">
    <StackPanel>
        <eo:ComboBox Width="200" HorizontalAlignment="Left">
            <eo:ComboBox.EmptyPrompt>
                <TextBlock FontStyle="Italic" Foreground="Gray">--Please select an item--</TextBlock>
            </eo:ComboBox.EmptyPrompt>
            <eo:ComboBoxItem>Item 1</eo:ComboBoxItem>
            <eo:ComboBoxItem>Item 2</eo:ComboBoxItem>
            <eo:ComboBoxItem>Item 3</eo:ComboBoxItem>
            <eo:ComboBoxItem>Item 4</eo:ComboBoxItem>
            <eo:ComboBoxItem>Item 5</eo:ComboBoxItem>
        </eo:ComboBox>
    </StackPanel>
</Window>

The above code produces the following result: