Table of Contents
- Getting Started
- EO.Pdf
- EO.Web
- EO.WebBrowser
- EO.Wpf
- Overview
- Installation & Deployement
- Skin & Theme
- Common Taskes and Services
- EO.Wpf Buttons
- EO.Wpf Calendar & DatePicker
- EO.Wpf ComboBox
- EO.Wpf DockView
- EO.Wpf Gauge
- EO.Wpf ListBox
- EO.Wpf Menu
- EO.Wpf MaskedEdit
- EO.Wpf ProgressBar
- EO.Wpf Slider
- EO.Wpf SpinEdit
- EO.Wpf SplitView
- EO.Wpf TabControl
- EO.Wpf TreeView
- EO.Wpf Utility Controls
- EO.Wpf WindowChrome
- Sample Data Objects
- Common Topics
- Reference
BitmapButton |
EO.Wpf BitmapButton is a simple button control consists of a Border and a Bitmap. It is especially suitable for simple image based "hover button".
The following sample demonstrates how to use BitmapButton to create a "hover button" that changes both image and border when user moves mouse over the button:
XAML
<eo:BitmapButton Width="20" Height="20"> <eo:BitmapButton.Style> <Style TargetType="{x:Type eo:BitmapButton}"> <Setter Property="Source" Value="button.png"></Setter> <Setter Property="BorderStyle"> <Setter.Value> <Style TargetType="Border"> <Setter Property="BorderBrush" Value="#adadaf" /> <Setter Property="BorderThickness" Value="1"></Setter> </Style> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Source" Value="button_hover.png"></Setter> <Setter Property="BorderStyle"> <Setter.Value> <Style TargetType="Border"> <Setter Property="BorderBrush" Value="#3ab38a" /> <Setter Property="BorderThickness" Value="1"></Setter> </Style> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> </eo:BitmapButton.Style> </eo:BitmapButton>
The above XAML switches both the button's image and border color when user moves the mouse over the button. When using the above code with these two images:
File | Image |
---|---|
button.png | |
button_hover.png |
It produces the following result:
State | Result |
---|---|
Normal | |
Hover |