Search This Blog

Friday, February 26, 2016

StatusBarItem Example WPF

WPF > Controls  > ContentControl > StatusBarItem

StatusBarItem objects are used to define items in a StatusBar control.





<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <StatusBar Name="sbar"
           VerticalAlignment="Bottom" >
            <StatusBar.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0"/>
                    <GradientStop Color="#FFAE1B1B" Offset="1"/>
                </LinearGradientBrush>
            </StatusBar.Background>
            <StatusBarItem>
                <TextBlock Foreground="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}">Processsing</TextBlock>
            </StatusBarItem>
            <StatusBarItem>
                <ProgressBar Width="100" Height="20"
                 Name="progressBar1">
                    <ProgressBar.Triggers>
                        <EventTrigger RoutedEvent="ProgressBar.Loaded">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation
                Storyboard.TargetName="progressBar1"
                Storyboard.TargetProperty="Value"
                From="0" To="100" Duration="0:0:5"  />
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </ProgressBar.Triggers>
                </ProgressBar>
            </StatusBarItem>
            <Separator/>
            <StatusBarItem>
                <TextBlock Foreground="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}">Percent</TextBlock>
            </StatusBarItem>
        </StatusBar>
    </Grid>

</Window>