searchbook.xaml

<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      SizeToContent="WidthAndHeight"
      Name="Window"
      WindowStartupLocation = "Manual"
      ResizeMode="NoResize"
      Top="0">
    <Window.Resources>
    <!-- Button style reference -->
    <Style x:Key="ShadowStyle">
       <Setter Property="Control.Foreground" Value="OrangeRed" />
    </Style>
    <!-- content panel style -->
    <LinearGradientBrush x:Key="contentPanelFillBrush" StartPoint="0.5,0" EndPoint="0.5,1">
       <GradientStop Color="DodgerBlue" Offset="0" />
       <GradientStop Color="LightSkyBlue" Offset="1" />
    </LinearGradientBrush>
    <!-- header panel styles -->
    <LinearGradientBrush x:Key="headerPanelFillBrush" StartPoint="0.5,0" EndPoint="0.5,1">
       <GradientStop Color="Navy" Offset="0" />
       <GradientStop Color="MidnightBlue" Offset="1" />
    </LinearGradientBrush>
       <SolidColorBrush x:Key="tooltipHeaderBackgroundColor" Color="Blue" />
       <SolidColorBrush x:Key="tooltipHeaderTextColor" Color="White" />
       <SolidColorBrush x:Key="tooltipTextBackgroundColor" Color="#FFFAEBD7" />
       <SolidColorBrush x:Key="tooltipTextColor" Color="Black" />
    <!-- style for tooltips -->
    <Style x:Key="tooltipHeaderStyle" TargetType="{x:Type TextBlock}">
      <Setter Property="Background" Value="{StaticResource tooltipHeaderBackgroundColor}" />
      <Setter Property="Foreground" Value="{StaticResource tooltipHeaderTextColor}" />
      <Setter Property="Width" Value="150" />
      <Setter Property="FontSize" Value="12px" />
      <Setter Property="FontWeight" Value="Bold" />
      <Setter Property="TextAlignment" Value="Center" />
    </Style>
    <Style x:Key="tooltipTextStyle" TargetType="{x:Type TextBlock}">
      <Setter Property="Background" Value="{StaticResource tooltipTextBackgroundColor}" />
      <Setter Property="Foreground" Value="{StaticResource tooltipTextColor}" />
      <Setter Property="Width" Value="150" />
      <Setter Property="TextWrapping" Value="Wrap" />
      <Setter Property="TextAlignment" Value="Justify" />
      <Setter Property="FontSize" Value="12px" />
      <Setter Property="LineHeight" Value="1.0" />
    </Style>
    <!-- Button template and styles -->
    <Style x:Key="MyFocusVisual">
      <Setter Property="Control.Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Control}">
             <Grid Margin="3 2">
               <Rectangle Name="r1" StrokeThickness="1" Stroke="Black" StrokeDashArray="2 2" RadiusX="3" RadiusY="3"/>
               <Border Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}" CornerRadius="2" BorderThickness="1"/>
             </Grid>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="InformButton" TargetType="Button">
       <Setter Property="OverridesDefaultStyle" Value="True"/>
       <Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisual}" />
       <Setter Property="FontFamily" Value="Verdana"/>
       <Setter Property="FontSize" Value="11px"/>
       <Setter Property="Margin" Value="3,0,3,0"/>
       <Setter Property="Width" Value="104"/>
       <Setter Property="Height" Value="28"/>
       <Setter Property="Background" >
      <Setter.Value>
          <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
              <GradientStop Color="#FFFFD190" Offset="0.2"/>
              <GradientStop Color="Orange" Offset="0.85"/>
              <GradientStop Color="#FFFFD190" Offset="1"/>
          </LinearGradientBrush>
      </Setter.Value>
       </Setter>
       <Setter Property="Template">
       <Setter.Value>
           <ControlTemplate TargetType="Button">
            <Border Name="border"
              BorderThickness="1.5"
              Padding="4,2"
              BorderBrush="DarkGray"
              CornerRadius="3"
              Background="{TemplateBinding Background}">
              <Grid >
              <ContentPresenter HorizontalAlignment="Center"
                         VerticalAlignment="Center" Name="contentShadow"
                         Style="{StaticResource ShadowStyle}">
                     <ContentPresenter.RenderTransform>
                        <TranslateTransform X="2.0" Y="2.0" />
                     </ContentPresenter.RenderTransform>
              </ContentPresenter>
                  <ContentPresenter HorizontalAlignment="Center"
                          RecognizesAccessKey="True"
                          VerticalAlignment="Center" Name="content"/>
              </Grid>
           </Border>
           <ControlTemplate.Triggers>
              <Trigger Property="IsMouseOver" Value="True">
              <Setter TargetName="border" Property="BorderBrush" Value="#FF4788c8" />
              <Setter Property="Foreground" Value="#FF4788c8" />
              </Trigger>
              <Trigger Property="IsPressed" Value="True">
              <Setter Property="Background" >
              <Setter.Value>
                  <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                  <GradientStop Color="#FFFFD190" Offset="0.35"/>
                  <GradientStop Color="Orange" Offset="0.95"/>
                  <GradientStop Color="#FFFFD190" Offset="1"/>
                  </LinearGradientBrush>
              </Setter.Value>
              </Setter>
              <Setter TargetName="content" Property="RenderTransform" >
              <Setter.Value>
                  <TranslateTransform Y="1.0" />
              </Setter.Value>
              </Setter>
              </Trigger>
              <Trigger Property="IsDefaulted" Value="True">
              <Setter TargetName="border" Property="BorderBrush" Value="#FF2F4F4F" />
              </Trigger>
              <Trigger Property="IsFocused" Value="True">
                  <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
              </Trigger>
              <Trigger Property="IsEnabled" Value="False">
              <Setter TargetName="border" Property="Opacity" Value="0.7" />
                  <Setter Property="Foreground" Value="Gray" />
              </Trigger>
          </ControlTemplate.Triggers>
         </ControlTemplate>
          </Setter.Value>
       </Setter>
    </Style>
    </Window.Resources>
    <DockPanel Background="{StaticResource contentPanelFillBrush}">
    <!-- Top Panel (icon, description, etc.) -->
    <StackPanel Orientation="Horizontal" Width="440" DockPanel.Dock="Top" Background="{StaticResource headerPanelFillBrush}" Margin="0,3,0,0">
      <Border BorderThickness="1" BorderBrush="White" Margin="2,2,2,4" CornerRadius="3" Width="62" Height="62" Background="Orange">
         <Image Name="Oranges" Height="62" Width="62" Stretch="Uniform"/>
      </Border>
      <TextBlock Width="440" VerticalAlignment="Stretch" Padding="7,4,4,0" Foreground="{StaticResource tooltipHeaderTextColor}">
        <TextBlock FontSize="14px" FontWeight="Bold" Padding="7,0,0,0">
          PowerShell Search-Book (v3.0.5.2)
        </TextBlock>
        <LineBreak />
        <TextBlock FontSize="11px" LineHeight="2px" FontFamily="Verdana" Padding="7,0,5,0" Margin="0,0,64,0" TextWrapping="Wrap" TextAlignment="Justify">
          Use Search-Book to find a matching word string in any file name. The directory
          containing each file will be shown in the second column. Use <Italic>Get-Help</Italic> for detailed <Italic>Help</Italic> information.
        </TextBlock>
      </TextBlock>
    </StackPanel>
    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Width="425" DockPanel.Dock="Top" Margin="10,17,10,12">
       <Label Width="100" Name="Label" ToolTipService.InitialShowDelay="1000" ToolTipService.BetweenShowDelay="1000"
               ToolTipService.ShowDuration="15000">Search Folder
            <Label.ToolTip>
                <StackPanel Orientation="Vertical">
                   <TextBlock Style="{StaticResource tooltipHeaderStyle}">Search Folder</TextBlock>
                   <TextBlock Style="{StaticResource tooltipTextStyle}">
                       If the desired filter is not in the dropdown list click the <Bold>Folders</Bold> button.
                       NOTE: selecting just the 'C:\' drive <Italic>is not recommended</Italic> as this will search
                       every sub-folder, taking a considerable time.
                   </TextBlock>
                </StackPanel>
           </Label.ToolTip>
       </Label>
       <ComboBox Name="Path" Width="324" Height="23" IsEditable="True" Focusable="True" IsEnabled="True">
         <ComboBoxItem ></ComboBoxItem>
       </ComboBox>
    </StackPanel>
    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Width="425" DockPanel.Dock="Top" Margin="10,0,10,0">
       <Label Width="90" ToolTipService.InitialShowDelay="1000" ToolTipService.BetweenShowDelay="1000"
               ToolTipService.ShowDuration="10000">File Type Filter
            <Label.ToolTip>
                <StackPanel Orientation="Vertical">
                   <TextBlock Style="{StaticResource tooltipHeaderStyle}">File Types</TextBlock>
                   <TextBlock Style="{StaticResource tooltipTextStyle}">
                       Click the <Bold>*.all</Bold> dropdown to search for all book types in a single operation.
                   </TextBlock>
                </StackPanel>
           </Label.ToolTip>
       </Label>
       <ComboBox Margin="10,0,0,0" Name="FileFilter" Width="60" Height="23" IsReadOnly="True" IsEditable="True" Focusable="True" IsEnabled="True">
         <ComboBoxItem >*.epub</ComboBoxItem>
         <ComboBoxItem >*.mobi</ComboBoxItem>
         <ComboBoxItem >*.azw3</ComboBoxItem>
         <ComboBoxItem >*.azw</ComboBoxItem>
         <ComboBoxItem >*.apnx</ComboBoxItem>
         <ComboBoxItem >*.prc</ComboBoxItem>
         <ComboBoxItem >*.mp3</ComboBoxItem>
         <ComboBoxItem >*.txt</ComboBoxItem>
         <ComboBoxItem >*.pdf</ComboBoxItem>
       </ComboBox>
       <Label Width="50" Margin="13,0,0,0" ToolTipService.InitialShowDelay="1000" ToolTipService.BetweenShowDelay="1000"
               ToolTipService.ShowDuration="15000">Author
           <Label.ToolTip>
                <StackPanel Orientation="Vertical">
                   <TextBlock Style="{StaticResource tooltipHeaderStyle}">Search</TextBlock>
                   <TextBlock Style="{StaticResource tooltipTextStyle}">
                       This can be any word string that appears in the book title,
                       usually the Author; however, to see all books of type <Bold>apnx</Bold>,
                       for example, select this filter and then simply enter apnx here.
                       NOTE: <Italic>this may generate a large amount of output.</Italic>
                   </TextBlock>
                </StackPanel>
           </Label.ToolTip>
       </Label>
       <TextBox Name="TextPattern" Width="200" Height="23">
       </TextBox>
    </StackPanel>
    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Width="425" DockPanel.Dock="Top" Margin="10,0,10,0">
       <Label Width="400" Height="26" Name="Message">
       </Label>
    </StackPanel>
    <StackPanel HorizontalAlignment="Center" Orientation="Horizontal"
        DockPanel.Dock="Top" Margin="0,7,0,2">
          <Rectangle Width="429" Height="1" Fill="Gray" Stroke="Gray" StrokeThickness="1">
          </Rectangle>
    </StackPanel>
    <StackPanel HorizontalAlignment="Center" Orientation="Horizontal"
        DockPanel.Dock="Bottom" Margin="0,10,0,15">
        <!-- The 'IsCancel' below allows the Escape key to close the window -->
        <Button Style="{StaticResource InformButton}" Name="Run" Content="Run"></Button>
        <Button Style="{StaticResource InformButton}" Name="Browse" Content="Folders"></Button>
        <Button Style="{StaticResource InformButton}" Name="Cancel" IsCancel="True" Content="Exit"></Button>
    </StackPanel>
  </DockPanel>
</Window>