Skip to content

Commit

Permalink
Style for Hidden Checkbox but visible Content
Browse files Browse the repository at this point in the history
  • Loading branch information
Marterich committed Oct 14, 2024
1 parent 8d34e2f commit ba968d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions functions/public/Invoke-WPFUIApps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ function Invoke-WPFUIApps {
$checkBox.HorizontalAlignment = "Left"
$checkBox.VerticalAlignment = "Center"
$checkBox.Margin = New-Object Windows.Thickness(5, 0, 10, 0)
$checkBox.SetResourceReference([Windows.Controls.Control]::StyleProperty, "CollapsedCheckBoxStyle")
$checkbox.Add_Checked({
Invoke-WPFSelectedLabelUpdate -type "Add" -checkbox $this
$borderElement = $this.Parent.Parent
Expand Down
14 changes: 13 additions & 1 deletion xaml/inputXML.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,19 @@
</Setter.Value>
</Setter>
</Style>
<!-- Collapsed Checkbox Style -->
<Style x:Key="CollapsedCheckBoxStyle" TargetType="CheckBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<ContentPresenter Content="{TemplateBinding Content}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="{TemplateBinding Padding}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="RadioButton">
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/>
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
Expand Down Expand Up @@ -864,7 +877,6 @@
</Border>
</Popup>


<Button Name="SettingsButton"
Style="{StaticResource HoverButtonStyle}"
Grid.Column="3" BorderBrush="Transparent"
Expand Down

0 comments on commit ba968d0

Please sign in to comment.