Dock StatusBar


   
    
<Window x:Class="SimpleStyles.TestWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Test Window" Height="300" Width="300"
    Style="{StaticResource {x:Type Window}}"
    ResizeMode="CanResizeWithGrip">
  <DockPanel LastChildFill="False">
    <StatusBar DockPanel.Dock="Bottom">
      <StatusBarItem>
        Ready
      </StatusBarItem>
    </StatusBar>

  </DockPanel>
</Window>

   
    
    
    
     


Proportional StatusBar


   
    
<Window x:Class="MenusAndToolbars.ProportionalStatusBar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ProportionalStatusBar" Height="300" Width="300">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition></RowDefinition>
        <RowDefinition Height="Auto"></RowDefinition>
      </Grid.RowDefinitions>

      <StatusBar Grid.Row="1">
        <StatusBar.ItemsPanel>
          <ItemsPanelTemplate>
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
              </Grid.ColumnDefinitions>              
            </Grid>
          </ItemsPanelTemplate>
        </StatusBar.ItemsPanel>
        <TextBlock>Left Side</TextBlock>
        <StatusBarItem Grid.Column="1">
          <TextBlock>Right Side</TextBlock>
        </StatusBarItem>
      </StatusBar>
    </Grid>
  </Window>

   
    
    
    
     


Display a Status Bar


   
    
<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WPF" Height="150" Width="300">
    <DockPanel LastChildFill="True">
        <StatusBar DockPanel.Dock="Bottom">
            <TextBlock  Text="Font size: " />
                <ComboBox Name="cbxFontSize" >
                    <ComboBoxItem Content="12" IsSelected="True" Margin="2" />
                    <ComboBoxItem Content="14" Margin="2" />
                    <ComboBoxItem Content="16" Margin="2" />
                </ComboBox>
                <Separator Margin="5"/>
                <RadioButton Command="EditingCommands.AlignLeft" 
                             CommandTarget="{Binding ElementName=rtbTextBox}"
                             Content="Left" IsChecked="True"/>
                <RadioButton Command="EditingCommands.AlignCenter" 
                             CommandTarget="{Binding ElementName=rtbTextBox}"                             
                             Content="Center" />
                <RadioButton Command="EditingCommands.AlignRight" 
                             CommandTarget="{Binding ElementName=rtbTextBox}"                             
                             Content="Right" />
        </StatusBar>
        <RichTextBox Name="rtbTextBox">
            <FlowDocument>
                <Paragraph FontSize="{Binding ElementName=cbxFontSize, 
                    Path=SelectedItem.Content}">
                    this is a test
                </Paragraph>
            </FlowDocument>
        </RichTextBox>
    </DockPanel>
</Window>

   
    
    
    
     


Items that can be placed in a StatusBar


   
  

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="StatusBarSimple.Window1"
    Title ="StatusBar">
  <Window.Resources>
    <Style x:Key="StatusBarSeparatorStyle" TargetType="Separator">
      <Setter Property="Background" Value="LightBlue" />
      <Setter Property="Control.Width" Value="1"/>
      <Setter Property="Control.Height" Value="20"/>
    </Style>    
  </Window.Resources>
        <StatusBar Name="sbar" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" 
                   VerticalAlignment="Bottom" Background="Beige" > 
             <StatusBarItem>
                <Button Content="click" Click="MakeProgressBar"/>
             </StatusBarItem>
             <StatusBarItem>
               <Separator Style="{StaticResource StatusBarSeparatorStyle}"/>
             </StatusBarItem>
        </StatusBar>
</Window>
//File:Window.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace StatusBarSimple
{
    public partial class Window1 : Window
    {
        private void MakeProgressBar(object sender, RoutedEventArgs e)
        {
            sbar.Items.Clear();
            TextBlock txtb = new TextBlock();
            txtb.Text = "Progress of download.";
            sbar.Items.Add(txtb);
            ProgressBar progressbar = new ProgressBar();
            progressbar.Width = 100;
            progressbar.Height = 20;
            Duration duration = new Duration(TimeSpan.FromSeconds(5));
            DoubleAnimation doubleanimation = new DoubleAnimation(100.0, duration);
            progressbar.BeginAnimation(ProgressBar.ValueProperty,doubleanimation);
            ToolTip ttprogbar = new ToolTip();
            ttprogbar.Content = "Shows the progress of a download.";
            progressbar.ToolTip = (ttprogbar);
            sbar.Items.Add(progressbar);
        }
    }
}

   
    
     


Add TextBlock to Statusbar


   
  


<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="StatusBarSimple.Window1"
    Title ="StatusBar">
  <Window.Resources>
    <Style x:Key="StatusBarSeparatorStyle" TargetType="Separator">
      <Setter Property="Background" Value="LightBlue" />
      <Setter Property="Control.Width" Value="1"/>
      <Setter Property="Control.Height" Value="20"/>
    </Style>    
  </Window.Resources>
        <StatusBar Name="sbar" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" 
                   VerticalAlignment="Bottom" Background="Beige" > 
             <StatusBarItem>
               <TextBlock>Ready</TextBlock>
             </StatusBarItem>
             <StatusBarItem>
               <Separator Style="{StaticResource StatusBarSeparatorStyle}"/>
             </StatusBarItem>
        </StatusBar>
</Window>
//File:Window.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace StatusBarSimple
{
    public partial class Window1 : Window
    {
        private void MakeProgressBar(object sender, RoutedEventArgs e)
        {
            sbar.Items.Clear();
            TextBlock txtb = new TextBlock();
            txtb.Text = "Code compiled successfully.";
            sbar.Items.Add(txtb);
            Rectangle rect = new Rectangle();
            rect.Height = 20;
            rect.Width = 1;
            rect.Fill = Brushes.LightGray;
            sbar.Items.Add(rect);
        }
    }
}

   
    
     


Put Image with tooltip onto statusbar


   
  

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="StatusBarSimple.Window1"
    Title ="StatusBar">
  <Window.Resources>
    <Style x:Key="StatusBarSeparatorStyle" TargetType="Separator">
      <Setter Property="Background" Value="LightBlue" />
      <Setter Property="Control.Width" Value="1"/>
      <Setter Property="Control.Height" Value="20"/>
    </Style>    
  </Window.Resources>
        <StatusBar Name="sbar" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" 
                   VerticalAlignment="Bottom" Background="Beige" > 
             <StatusBarItem>
               <TextBlock>Ready</TextBlock>
             </StatusBarItem>
             <StatusBarItem>
               <Separator Style="{StaticResource StatusBarSeparatorStyle}"/>
             </StatusBarItem>
        </StatusBar>
</Window>
//File:Window.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace StatusBarSimple
{
    public partial class Window1 : Window
    {
        private void MakeProgressBar(object sender, RoutedEventArgs e)
        {
            sbar.Items.Clear();
            Image helpImage = new Image();
            helpImage.Width = 16;
            helpImage.Height = 16;
            BitmapImage bi = new BitmapImage();
            bi.BeginInit();
            bi.UriSource = new Uri(@"pack://application:,,,/help.bmp");
            bi.EndInit();
            helpImage.Source = bi;
            ToolTip ttp = new ToolTip();
            ttp.Content = "HELP";
            helpImage.ToolTip = (ttp);
            sbar.Items.Add(helpImage);
        }
    }
}

   
    
     


Make Group onto Statusbar


   
  
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="StatusBarSimple.Window1"
    Title ="StatusBar">
  <Window.Resources>
    <Style x:Key="StatusBarSeparatorStyle" TargetType="Separator">
      <Setter Property="Background" Value="LightBlue" />
      <Setter Property="Control.Width" Value="1"/>
      <Setter Property="Control.Height" Value="20"/>
    </Style>    
  </Window.Resources>
        <StatusBar Name="sbar" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" 
                   VerticalAlignment="Bottom" Background="Beige" > 
             <StatusBarItem>
                <Button Content="click" Click="MakeProgressBar"/>
             </StatusBarItem>
             <StatusBarItem>
               <Separator Style="{StaticResource StatusBarSeparatorStyle}"/>
             </StatusBarItem>
        </StatusBar>
</Window>
//File:Window.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace StatusBarSimple
{
    public partial class Window1 : Window
    {
        private void MakeProgressBar(object sender, RoutedEventArgs e)
        {
            sbar.Items.Clear();
            Image helpImage = new Image();
            helpImage.Width = 16;
            helpImage.Height = 16;
            BitmapImage bi = new BitmapImage();
            bi.BeginInit();
            bi.UriSource = new Uri(@"pack://application:,,,/images/help.bmp");
            bi.EndInit();
            helpImage.Source = bi;
            ToolTip ttp = new ToolTip();
            ttp.Content = "HELP";
            helpImage.ToolTip = (ttp);
            sbar.Items.Add(helpImage);

            Separator sp = new Separator();
            sp.Style = (Style)FindResource("StatusBarSeparatorStyle");
            sbar.Items.Add(sp);

            Image printImage = new Image();
            printImage.Width = 16;
            printImage.Height = 16;
            BitmapImage bi_print = new BitmapImage();
            bi_print.BeginInit();
            bi_print.UriSource = new Uri(@"pack://application:,,,/images/print.bmp");
            bi_print.EndInit();
            printImage.Source = bi_print;
            ToolTip ttp_print = new ToolTip();
            ttp.Content = "Sent to printer.";
            printImage.ToolTip = (ttp_print);
            sbar.Items.Add(printImage);
        }
    }
}