remove useless xaml changes (#4632)

This commit is contained in:
Gabi
2026-07-01 21:59:43 -05:00
committed by GitHub
parent 2cb20893fc
commit 916dc761ba
2 changed files with 32 additions and 35 deletions
-2
View File
@@ -121,8 +121,6 @@ if ($Config) {
return return
} }
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^<Win.*', '<Window'
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework') [void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework')
[xml]$XAML = $inputXML [xml]$XAML = $inputXML
+32 -33
View File
@@ -1,10 +1,9 @@
<Window x:Class="WinUtility.MainWindow" <Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WinUtility" xmlns:local="clr-namespace:WinUtility"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
UseLayoutRounding="True" UseLayoutRounding="True"
WindowStyle="None" WindowStyle="None"
@@ -56,9 +55,9 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}"> <ControlTemplate TargetType="{x:Type Thumb}">
<Grid x:Name="Grid"> <Grid Name="Grid">
<Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="Transparent" /> <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="Transparent" />
<Border x:Name="Rectangle1" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Background="{TemplateBinding Background}" /> <Border Name="Rectangle1" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Background="{TemplateBinding Background}" />
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="Tag" Value="Horizontal"> <Trigger Property="Tag" Value="Horizontal">
@@ -103,14 +102,14 @@
<ControlTemplate TargetType="CheckBox"> <ControlTemplate TargetType="CheckBox">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Grid Width="16" Height="16" Margin="0,0,8,0"> <Grid Width="16" Height="16" Margin="0,0,8,0">
<Border x:Name="CheckBoxBorder" <Border Name="CheckBoxBorder"
BorderBrush="{DynamicResource MainForegroundColor}" BorderBrush="{DynamicResource MainForegroundColor}"
Background="{DynamicResource ButtonBackgroundColor}" Background="{DynamicResource ButtonBackgroundColor}"
BorderThickness="1" BorderThickness="1"
Width="12" Width="12"
Height="12" Height="12"
CornerRadius="2"/> CornerRadius="2"/>
<Path x:Name="CheckMark" <Path Name="CheckMark"
Stroke="{DynamicResource ToggleButtonOnColor}" Stroke="{DynamicResource ToggleButtonOnColor}"
StrokeThickness="2" StrokeThickness="2"
Data="M 2 8 L 6 12 L 14 4" Data="M 2 8 L 6 12 L 14 4"
@@ -159,7 +158,7 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
<Grid> <Grid>
<Border x:Name="BackgroundBorder" <Border Name="BackgroundBorder"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{DynamicResource ButtonBorderThickness}" BorderThickness="{DynamicResource ButtonBorderThickness}"
@@ -219,20 +218,20 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}"> <ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid x:Name="GridRoot" Width="7" Background="{TemplateBinding Background}" > <Grid Name="GridRoot" Width="7" Background="{TemplateBinding Background}" >
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="0.00001*" /> <RowDefinition Height="0.00001*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Track x:Name="PART_Track" Grid.Row="0" IsDirectionReversed="true" Focusable="false"> <Track Name="PART_Track" Grid.Row="0" IsDirectionReversed="true" Focusable="false">
<Track.Thumb> <Track.Thumb>
<Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}" Style="{DynamicResource ScrollThumbs}" /> <Thumb Name="Thumb" Background="{TemplateBinding Foreground}" Style="{DynamicResource ScrollThumbs}" />
</Track.Thumb> </Track.Thumb>
<Track.IncreaseRepeatButton> <Track.IncreaseRepeatButton>
<RepeatButton x:Name="PageUp" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="false" /> <RepeatButton Name="PageUp" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="false" />
</Track.IncreaseRepeatButton> </Track.IncreaseRepeatButton>
<Track.DecreaseRepeatButton> <Track.DecreaseRepeatButton>
<RepeatButton x:Name="PageDown" Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="false" /> <RepeatButton Name="PageDown" Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="false" />
</Track.DecreaseRepeatButton> </Track.DecreaseRepeatButton>
</Track> </Track>
</Grid> </Grid>
@@ -278,12 +277,12 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ComboBox"> <ControlTemplate TargetType="ComboBox">
<Grid> <Grid>
<Border x:Name="OuterBorder" <Border Name="OuterBorder"
BorderBrush="{DynamicResource BorderColor}" BorderBrush="{DynamicResource BorderColor}"
BorderThickness="1" BorderThickness="1"
CornerRadius="{DynamicResource ButtonCornerRadius}" CornerRadius="{DynamicResource ButtonCornerRadius}"
Background="{TemplateBinding Background}"> Background="{TemplateBinding Background}">
<ToggleButton x:Name="ToggleButton" <ToggleButton Name="ToggleButton"
Background="Transparent" Background="Transparent"
BorderThickness="0" BorderThickness="0"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
@@ -310,13 +309,13 @@
</Grid> </Grid>
</ToggleButton> </ToggleButton>
</Border> </Border>
<Popup x:Name="Popup" <Popup Name="Popup"
IsOpen="{TemplateBinding IsDropDownOpen}" IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom" Placement="Bottom"
Focusable="False" Focusable="False"
AllowsTransparency="True" AllowsTransparency="True"
PopupAnimation="Slide"> PopupAnimation="Slide">
<Border x:Name="DropDownBorder" <Border Name="DropDownBorder"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource BorderColor}" BorderBrush="{DynamicResource BorderColor}"
BorderThickness="1" BorderThickness="1"
@@ -352,13 +351,13 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ToggleButton"> <ControlTemplate TargetType="ToggleButton">
<Grid> <Grid>
<Border x:Name="ButtonGlow" <Border Name="ButtonGlow"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource ButtonForegroundColor}" BorderBrush="{DynamicResource ButtonForegroundColor}"
BorderThickness="{DynamicResource ButtonBorderThickness}" BorderThickness="{DynamicResource ButtonBorderThickness}"
CornerRadius="{DynamicResource ButtonCornerRadius}"> CornerRadius="{DynamicResource ButtonCornerRadius}">
<Grid> <Grid>
<Border x:Name="BackgroundBorder" <Border Name="BackgroundBorder"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource ButtonBackgroundColor}" BorderBrush="{DynamicResource ButtonBackgroundColor}"
BorderThickness="{DynamicResource ButtonBorderThickness}" BorderThickness="{DynamicResource ButtonBorderThickness}"
@@ -413,7 +412,7 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
<Grid> <Grid>
<Border x:Name="BackgroundBorder" <Border Name="BackgroundBorder"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{DynamicResource ButtonBorderThickness}" BorderThickness="{DynamicResource ButtonBorderThickness}"
@@ -450,7 +449,7 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ToggleButton"> <ControlTemplate TargetType="ToggleButton">
<Grid> <Grid>
<Border x:Name="BackgroundBorder" <Border Name="BackgroundBorder"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{DynamicResource ButtonBorderThickness}" BorderThickness="{DynamicResource ButtonBorderThickness}"
@@ -464,7 +463,7 @@
Margin="0,3,5,0" /> Margin="0,3,5,0" />
<!-- Toggle Dot with hover grow effect --> <!-- Toggle Dot with hover grow effect -->
<Ellipse x:Name="ToggleDot" <Ellipse Name="ToggleDot"
Width="8" Height="8" Width="8" Height="8"
Fill="{DynamicResource ButtonForegroundColor}" Fill="{DynamicResource ButtonForegroundColor}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
@@ -568,7 +567,7 @@
<BulletDecorator Background="Transparent"> <BulletDecorator Background="Transparent">
<BulletDecorator.Bullet> <BulletDecorator.Bullet>
<Grid Width="{DynamicResource CheckBoxBulletDecoratorSize}" Height="{DynamicResource CheckBoxBulletDecoratorSize}"> <Grid Width="{DynamicResource CheckBoxBulletDecoratorSize}" Height="{DynamicResource CheckBoxBulletDecoratorSize}">
<Border x:Name="Border" <Border Name="Border"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
Background="{DynamicResource ButtonBackgroundColor}" Background="{DynamicResource ButtonBackgroundColor}"
BorderThickness="1" BorderThickness="1"
@@ -576,13 +575,13 @@
Height="{DynamicResource CheckBoxBulletDecoratorSize *0.85}" Height="{DynamicResource CheckBoxBulletDecoratorSize *0.85}"
Margin="1" Margin="1"
SnapsToDevicePixels="True"/> SnapsToDevicePixels="True"/>
<Viewbox x:Name="CheckMarkContainer" <Viewbox Name="CheckMarkContainer"
Width="{DynamicResource CheckBoxBulletDecoratorSize}" Width="{DynamicResource CheckBoxBulletDecoratorSize}"
Height="{DynamicResource CheckBoxBulletDecoratorSize}" Height="{DynamicResource CheckBoxBulletDecoratorSize}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Visibility="Collapsed"> Visibility="Collapsed">
<Path x:Name="CheckMark" <Path Name="CheckMark"
Stroke="{DynamicResource ToggleButtonOnColor}" Stroke="{DynamicResource ToggleButtonOnColor}"
StrokeThickness="1.5" StrokeThickness="1.5"
Data="M 0 5 L 5 10 L 12 0" Data="M 0 5 L 5 10 L 12 0"
@@ -620,14 +619,14 @@
<StackPanel Orientation="Horizontal" Margin="{DynamicResource CheckBoxMargin}"> <StackPanel Orientation="Horizontal" Margin="{DynamicResource CheckBoxMargin}">
<Viewbox Width="{DynamicResource CheckBoxBulletDecoratorSize}" Height="{DynamicResource CheckBoxBulletDecoratorSize}"> <Viewbox Width="{DynamicResource CheckBoxBulletDecoratorSize}" Height="{DynamicResource CheckBoxBulletDecoratorSize}">
<Grid Width="14" Height="14"> <Grid Width="14" Height="14">
<Ellipse x:Name="OuterCircle" <Ellipse Name="OuterCircle"
Stroke="{DynamicResource ToggleButtonOffColor}" Stroke="{DynamicResource ToggleButtonOffColor}"
Fill="{DynamicResource ButtonBackgroundColor}" Fill="{DynamicResource ButtonBackgroundColor}"
StrokeThickness="1" StrokeThickness="1"
Width="14" Width="14"
Height="14" Height="14"
SnapsToDevicePixels="True"/> SnapsToDevicePixels="True"/>
<Ellipse x:Name="InnerCircle" <Ellipse Name="InnerCircle"
Fill="{DynamicResource ToggleButtonOnColor}" Fill="{DynamicResource ToggleButtonOnColor}"
Width="8" Width="8"
Height="8" Height="8"
@@ -682,7 +681,7 @@
<Trigger Property="IsChecked" Value="false"> <Trigger Property="IsChecked" Value="false">
<Trigger.ExitActions> <Trigger.ExitActions>
<RemoveStoryboard BeginStoryboardName="WPFToggleSwitchLeft" /> <RemoveStoryboard BeginStoryboardName="WPFToggleSwitchLeft" />
<BeginStoryboard x:Name="WPFToggleSwitchRight"> <BeginStoryboard Name="WPFToggleSwitchRight">
<Storyboard> <Storyboard>
<ThicknessAnimation Storyboard.TargetProperty="Margin" <ThicknessAnimation Storyboard.TargetProperty="Margin"
Storyboard.TargetName="WPFToggleSwitchButton" Storyboard.TargetName="WPFToggleSwitchButton"
@@ -701,7 +700,7 @@
<Trigger Property="IsChecked" Value="true"> <Trigger Property="IsChecked" Value="true">
<Trigger.ExitActions> <Trigger.ExitActions>
<RemoveStoryboard BeginStoryboardName="WPFToggleSwitchRight" /> <RemoveStoryboard BeginStoryboardName="WPFToggleSwitchRight" />
<BeginStoryboard x:Name="WPFToggleSwitchLeft"> <BeginStoryboard Name="WPFToggleSwitchLeft">
<Storyboard> <Storyboard>
<ThicknessAnimation Storyboard.TargetProperty="Margin" <ThicknessAnimation Storyboard.TargetProperty="Margin"
Storyboard.TargetName="WPFToggleSwitchButton" Storyboard.TargetName="WPFToggleSwitchButton"
@@ -727,17 +726,17 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}"> <ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid x:Name="toggleSwitch"> <Grid Name="toggleSwitch">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border Grid.Column="1" x:Name="Border" CornerRadius="8" <Border Grid.Column="1" Name="Border" CornerRadius="8"
BorderThickness="1" BorderThickness="1"
Width="34" Height="17"> Width="34" Height="17">
<Ellipse x:Name="Ellipse" Fill="{DynamicResource MainForegroundColor}" Stretch="Uniform" <Ellipse Name="Ellipse" Fill="{DynamicResource MainForegroundColor}" Stretch="Uniform"
Margin="2,2,2,1" Margin="2,2,2,1"
HorizontalAlignment="Left" Width="10.8" HorizontalAlignment="Left" Width="10.8"
RenderTransformOrigin="0.5, 0.5"> RenderTransformOrigin="0.5, 0.5">
@@ -884,7 +883,7 @@
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5"> CornerRadius="5">
<Grid> <Grid>
<ScrollViewer x:Name="PART_ContentHost" /> <ScrollViewer Name="PART_ContentHost" />
</Grid> </Grid>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
@@ -916,7 +915,7 @@
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5"> CornerRadius="5">
<Grid> <Grid>
<ScrollViewer x:Name="PART_ContentHost" /> <ScrollViewer Name="PART_ContentHost" />
</Grid> </Grid>
</Border> </Border>
</ControlTemplate> </ControlTemplate>