Powershell GUI fronted (WPF) to run categorized console scripts

⌈⌋ ⎇ branch:  ClickyColoury


Artifact [705fd689fd]

Artifact 705fd689fd12e8090ebdf3471b82155b9e9c45bf:

  • File modules/theme.beta.xaml — part of check-in [16ea606fae] at 2018-05-18 17:58:54 on branch trunk — Attempt at making TreeViewItems more solid (metro/burger style menu) (user: mario size: 10451)

<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="RibbonGradient" TargetType="DockPanel">
      <Setter Property="Background"><Setter.Value>
      <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFdd5555" Offset="0.00" />
        <GradientStop Color="#ffdd4444" Offset="0.30" />
        <GradientStop Color="#ffcc3333" Offset="0.70" />
        <GradientStop Color="#ffbb2222" Offset="1.00" />
      </LinearGradientBrush>
      </Setter.Value></Setter>
    </Style>

    <Style x:Key="RibbonBorder" TargetType="Border">
      <Setter Property="BorderBrush" Value="#FF996655" />
      <Setter Property="BorderThickness" Value="1" />
      <Setter Property="Margin" Value="4,0,4,4" />
      <Setter Property="Padding" Value="4,8,4,0" />
      <Setter Property="Background"><Setter.Value>
      <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#00ee6666" Offset="0.00" />
        <GradientStop Color="#ffee7777" Offset="0.20" />
        <GradientStop Color="#ffdd6666" Offset="0.50" />
        <GradientStop Color="#ffcc5555" Offset="0.51" />
        <GradientStop Color="#ffcc5555" Offset="0.70" />
        <GradientStop Color="#ff994444" Offset="0.71" />
        <GradientStop Color="#ffaa1111" Offset="1.00" />
      </LinearGradientBrush>
      </Setter.Value></Setter>
    </Style>

    <Style x:Key="RibbonBorderGreen" TargetType="Border" BasedOn="{StaticResource RibbonBorder}">
      <Setter Property="Background"><Setter.Value>
      <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#00aaaaff" Offset="0.00" />
        <GradientStop Color="#ff9999ee" Offset="0.20" />
        <GradientStop Color="#ff8888ee" Offset="0.70" />
        <GradientStop Color="#776666cc" Offset="0.71" />
        <GradientStop Color="#33111199" Offset="1.00" />
      </LinearGradientBrush>
      </Setter.Value></Setter>
    </Style>

    <Style x:Key="ActionLabel" TargetType="Label">
      <Setter Property="Foreground" Value="#FFCDCDCD" />
    </Style>

    <Style x:Key="ActionButton" TargetType="Button">
      <Setter Property="TabIndex" Value="0" />
      <Setter Property="FontSize" Value="18" />
      <Setter Property="Foreground" Value="#ff333366" />
      <Setter Property="Template">
       <Setter.Value>
        <ControlTemplate TargetType="Button">
         <Border>
          <Border.Style>
           <Style TargetType="{x:Type Border}">
            <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Background" Value="#ffeeddaa"/>
              <Setter Property="Opacity" Value="1.0"/>
            </Trigger>
            <!--Trigger Property="IsPressed" Value="True">
              <Setter Property="Background" Value="#ffffcc99"/>
              <Setter Property="Opacity" Value="0.6"/></Trigger-->
            </Style.Triggers>
           </Style>
          </Border.Style>
          <Border Opacity="0.9"> <ContentPresenter/> </Border>
         </Border>
        </ControlTemplate>
       </Setter.Value>
      </Setter>
    </Style>

    <Style x:Key="MenuButton" TargetType="Button">
      <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
      <Setter Property="BorderThickness" Value="1" />
      <Setter Property="BorderBrush" Value="Transparent" />
      <Setter Property="Padding" Value="2,1" />
      <Setter Property="Margin" Value="0,2,0,2" />
      <Setter Property="FontSize" Value="14" />
      <Setter Property="FontWeight" Value="Normal" />
      <Setter Property="Button.Effect">
        <Setter.Value>
            <DropShadowEffect Color="Black" Direction="320" ShadowDepth="3" BlurRadius="5" Opacity="0.5" />
        </Setter.Value>
      </Setter>
      <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
          <Setter Property="Background" Value="White" />
  
        </Trigger>
        <Trigger Property="IsPressed" Value="True">
          <Setter Property="Background" Value="Yellow" />
          <Setter Property="Padding" Value="3,2,1,0" />
        </Trigger>
      </Style.Triggers>
    </Style>


<!--=================================================================
TreeViewItem - https://msdn.microsoft.com/en-us/library/ms788727(v=vs.90).aspx
==================================================================-->
<SolidColorBrush x:Key="GlyphBrush" Color="#444" />
<Style x:Key="ExpandCollapseToggleStyle" TargetType="ToggleButton">
  <Setter Property="Focusable" Value="False"/>
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="ToggleButton">
        <Grid
          Width="15"
          Height="13"
          Background="#ff222266">
          <Path x:Name="ExpandPath"
            HorizontalAlignment="Left" 
            VerticalAlignment="Center" 
            Margin="1,1,1,1"
            Fill="{StaticResource GlyphBrush}"
            Data="M 4 0 L 8 4 L 4 8 Z"/>
        </Grid>
        <ControlTemplate.Triggers>
          <Trigger Property="IsChecked"
               Value="True">
            <Setter Property="Data"
                TargetName="ExpandPath"
                Value="M 0 4 L 8 4 L 4 8 Z"/>
          </Trigger>
        </ControlTemplate.Triggers>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
<Style x:Key="TreeViewItemFocusVisual">
  <Setter Property="Control.Template">
    <Setter.Value>
      <ControlTemplate>
        <Border>
          <Rectangle Margin="0,0,0,0"
                 StrokeThickness="5"
                 Stroke="Black"
                 StrokeDashArray="1 2"
                 Opacity="0"/>
        </Border>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
<Style x:Key="{x:Type TreeViewItem}"
     TargetType="{x:Type TreeViewItem}">
  <Setter Property="Background" Value="#ee222266"/>
  <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  <Setter Property="Padding" Value="1,0,0,0"/>
  <Setter Property="Foreground" Value="White"/>
  <Setter Property="FocusVisualStyle" Value="{StaticResource TreeViewItemFocusVisual}"/>
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type TreeViewItem}">
        <Grid Name="Grid">
          <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="19" Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
          </Grid.RowDefinitions>
          <ToggleButton x:Name="Expander"
                  Style="{StaticResource ExpandCollapseToggleStyle}"
                  IsChecked="{Binding Path=IsExpanded,
                              RelativeSource={RelativeSource TemplatedParent}}"
                  ClickMode="Press"/>
          <Border Name="Bd"
              Grid.Column="1"
              Background="#ff222277"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}"
              Padding="{TemplateBinding Padding}">
<DockPanel>
<!--Image x:Name="Image" Source="e:/img/icon.powershell.png"/-->
<Image x:Name="Image" Source="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ToolTip}"/>

            <ContentPresenter x:Name="PART_Header"
                      ContentSource="Header"
                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</DockPanel>

          </Border>
          <ItemsPresenter x:Name="ItemsHost" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"/>
        </Grid>
        <ControlTemplate.Triggers>
          <Trigger Property="IsExpanded" Value="false">
            <Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed"/>
          </Trigger>
          <Trigger Property="HasItems" Value="false">
            <Setter TargetName="Expander" Property="Visibility" Value="Hidden"/>
          </Trigger>
          <Trigger Property="IsMouseOver" Value="true">
            <Setter TargetName="Grid" Property="Background" Value="Blue"/>
            <Setter TargetName="Bd" Property="Background" Value="Blue"/>
          </Trigger>
          <MultiTrigger>
            <MultiTrigger.Conditions>
              <Condition Property="HasHeader" Value="false"/>
              <Condition Property="Width" Value="Auto"/>
            </MultiTrigger.Conditions>
            <Setter TargetName="PART_Header" Property="MinWidth" Value="75"/>
          </MultiTrigger>
          <MultiTrigger>
            <MultiTrigger.Conditions>
              <Condition Property="HasHeader" Value="false"/>
              <Condition Property="Height" Value="Auto"/>
            </MultiTrigger.Conditions>
            <Setter TargetName="PART_Header" Property="MinHeight" Value="19"/>
          </MultiTrigger>
          <Trigger Property="IsSelected" Value="true"> 
           <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
            <Setter Property="Foreground" Value="Yellow"/>
          </Trigger>
          <MultiTrigger>
            <MultiTrigger.Conditions>
              <Condition Property="IsSelected" Value="true"/>
              <Condition Property="IsSelectionActive" Value="false"/>
            </MultiTrigger.Conditions>
            <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
            <Setter Property="Foreground" Value="Red"/>
          </MultiTrigger>
          <Trigger Property="IsEnabled" Value="false">
            <Setter Property="Foreground" Value="White"/>
          </Trigger>
        </ControlTemplate.Triggers>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

</ResourceDictionary>