Skip to content

Commit

Permalink
refactor: StyleXaml
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Oct 23, 2024
1 parent e0f90aa commit 27b1fbc
Show file tree
Hide file tree
Showing 75 changed files with 1,086 additions and 1,306 deletions.
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void ExecuteProcess(FilePath fileName, ProcessArgumentBuilder arguments, string
Task("Default")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
// .IsDependentOn("StyleXaml")
.IsDependentOn("StyleXaml")
.IsDependentOn("Build")
;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iconPacks="using:MahApps.Metro.IconPacks"
xmlns:converter="using:MahApps.Metro.IconPacks.Converter">
xmlns:converter="using:MahApps.Metro.IconPacks.Converter"
xmlns:iconPacks="using:MahApps.Metro.IconPacks">

<ControlTemplate x:Key="MahApps.Templates.PackIconBootstrapIcons" TargetType="iconPacks:PackIconBootstrapIcons">
<Grid>
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" />
<Grid x:Name="PART_InnerGrid"
Margin="{TemplateBinding BorderThickness}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RenderTransformOrigin="0.5 0.5"
Margin="{TemplateBinding BorderThickness}">
RenderTransformOrigin="0.5 0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="FlipTransform"
ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleXValueConverter}}"
ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleYValueConverter}}" />
<RotateTransform x:Name="RotationTransform"
Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle, Mode=OneWay}" />
<ScaleTransform x:Name="FlipTransform" ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleXValueConverter}}" ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleYValueConverter}}" />
<RotateTransform x:Name="RotationTransform" Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle, Mode=OneWay}" />
<RotateTransform x:Name="SpinTransform" />
</TransformGroup>
</Grid.RenderTransform>
<Viewbox Margin="{TemplateBinding Padding}">
<Path Fill="{TemplateBinding Foreground}"
Stretch="Uniform"
Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
<Path Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
Fill="{TemplateBinding Foreground}"
RenderTransformOrigin="0.5 0.5"
Stretch="Uniform"
UseLayoutRounding="False">
<Path.RenderTransform>
<ScaleTransform ScaleY="-1" />
Expand All @@ -39,17 +36,17 @@
</ControlTemplate>

<Style x:Key="MahApps.Styles.PackIconBootstrapIcons" TargetType="iconPacks:PackIconBootstrapIcons">
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
<Setter Property="Padding" Value="0" />
<Setter Property="FlowDirection" Value="LeftToRight" />
<Setter Property="Height" Value="16" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="Padding" Value="0" />
<Setter Property="Template" Value="{StaticResource MahApps.Templates.PackIconBootstrapIcons}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Width" Value="16" />
</Style>

</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iconPacks="clr-namespace:MahApps.Metro.IconPacks"
xmlns:converter="clr-namespace:MahApps.Metro.IconPacks.Converter;assembly=MahApps.Metro.IconPacks.Core">
xmlns:converter="clr-namespace:MahApps.Metro.IconPacks.Converter;assembly=MahApps.Metro.IconPacks.Core"
xmlns:iconPacks="clr-namespace:MahApps.Metro.IconPacks">

<ControlTemplate x:Key="MahApps.Templates.PackIconBootstrapIcons" TargetType="{x:Type iconPacks:PackIconBootstrapIcons}">
<Grid>
Expand All @@ -10,25 +10,22 @@
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Grid x:Name="PART_InnerGrid"
Margin="{TemplateBinding BorderThickness}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RenderTransformOrigin="0.5 0.5"
Margin="{TemplateBinding BorderThickness}">
RenderTransformOrigin="0.5 0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="FlipTransform"
ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleXValueConverter}}"
ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleYValueConverter}}" />
<RotateTransform x:Name="RotationTransform"
Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle, Mode=OneWay}" />
<ScaleTransform x:Name="FlipTransform" ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleXValueConverter}}" ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleYValueConverter}}" />
<RotateTransform x:Name="RotationTransform" Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle, Mode=OneWay}" />
<RotateTransform x:Name="SpinTransform" />
</TransformGroup>
</Grid.RenderTransform>
<Viewbox Margin="{TemplateBinding Padding}">
<Path Fill="{TemplateBinding Foreground}"
Stretch="Uniform"
Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
<Path Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
Fill="{TemplateBinding Foreground}"
SnapsToDevicePixels="False"
Stretch="Uniform"
UseLayoutRounding="False">
<Path.LayoutTransform>
<ScaleTransform ScaleY="-1" />
Expand All @@ -40,18 +37,18 @@
</ControlTemplate>

<Style x:Key="MahApps.Styles.PackIconBootstrapIcons" TargetType="{x:Type iconPacks:PackIconBootstrapIcons}">
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
<Setter Property="Padding" Value="0" />
<Setter Property="FlowDirection" Value="LeftToRight" />
<Setter Property="Height" Value="16" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Padding" Value="0" />
<Setter Property="SnapsToDevicePixels" Value="False" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="Template" Value="{StaticResource MahApps.Templates.PackIconBootstrapIcons}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Width" Value="16" />
</Style>

</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iconPacks="using:MahApps.Metro.IconPacks"
xmlns:converter="using:MahApps.Metro.IconPacks.Converter">
xmlns:converter="using:MahApps.Metro.IconPacks.Converter"
xmlns:iconPacks="using:MahApps.Metro.IconPacks">

<ControlTemplate x:Key="MahApps.Templates.PackIconBoxIcons" TargetType="iconPacks:PackIconBoxIcons">
<Grid>
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" />
<Grid x:Name="PART_InnerGrid"
Margin="{TemplateBinding BorderThickness}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RenderTransformOrigin="0.5 0.5"
Margin="{TemplateBinding BorderThickness}">
RenderTransformOrigin="0.5 0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="FlipTransform"
ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleXValueConverter}}"
ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleYValueConverter}}" />
<RotateTransform x:Name="RotationTransform"
Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle, Mode=OneWay}" />
<ScaleTransform x:Name="FlipTransform" ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleXValueConverter}}" ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleYValueConverter}}" />
<RotateTransform x:Name="RotationTransform" Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle, Mode=OneWay}" />
<RotateTransform x:Name="SpinTransform" />
</TransformGroup>
</Grid.RenderTransform>
<Viewbox Margin="{TemplateBinding Padding}">
<Path Fill="{TemplateBinding Foreground}"
Stretch="Uniform"
Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
<Path Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
Fill="{TemplateBinding Foreground}"
RenderTransformOrigin="0.5 0.5"
Stretch="Uniform"
UseLayoutRounding="False">
<Path.RenderTransform>
<ScaleTransform ScaleY="-1" />
Expand All @@ -39,17 +36,17 @@
</ControlTemplate>

<Style x:Key="MahApps.Styles.PackIconBoxIcons" TargetType="iconPacks:PackIconBoxIcons">
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
<Setter Property="Padding" Value="0" />
<Setter Property="FlowDirection" Value="LeftToRight" />
<Setter Property="Height" Value="16" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="Padding" Value="0" />
<Setter Property="Template" Value="{StaticResource MahApps.Templates.PackIconBoxIcons}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Width" Value="16" />
</Style>

</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iconPacks="clr-namespace:MahApps.Metro.IconPacks"
xmlns:converter="clr-namespace:MahApps.Metro.IconPacks.Converter;assembly=MahApps.Metro.IconPacks.Core">
xmlns:converter="clr-namespace:MahApps.Metro.IconPacks.Converter;assembly=MahApps.Metro.IconPacks.Core"
xmlns:iconPacks="clr-namespace:MahApps.Metro.IconPacks">

<ControlTemplate x:Key="MahApps.Templates.PackIconBoxIcons" TargetType="{x:Type iconPacks:PackIconBoxIcons}">
<Grid>
Expand All @@ -10,25 +10,22 @@
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Grid x:Name="PART_InnerGrid"
Margin="{TemplateBinding BorderThickness}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RenderTransformOrigin="0.5 0.5"
Margin="{TemplateBinding BorderThickness}">
RenderTransformOrigin="0.5 0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="FlipTransform"
ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleXValueConverter}}"
ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleYValueConverter}}" />
<RotateTransform x:Name="RotationTransform"
Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle, Mode=OneWay}" />
<ScaleTransform x:Name="FlipTransform" ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleXValueConverter}}" ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleYValueConverter}}" />
<RotateTransform x:Name="RotationTransform" Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle, Mode=OneWay}" />
<RotateTransform x:Name="SpinTransform" />
</TransformGroup>
</Grid.RenderTransform>
<Viewbox Margin="{TemplateBinding Padding}">
<Path Fill="{TemplateBinding Foreground}"
Stretch="Uniform"
Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
<Path Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
Fill="{TemplateBinding Foreground}"
SnapsToDevicePixels="False"
Stretch="Uniform"
UseLayoutRounding="False">
<Path.LayoutTransform>
<ScaleTransform ScaleY="-1" />
Expand All @@ -40,18 +37,18 @@
</ControlTemplate>

<Style x:Key="MahApps.Styles.PackIconBoxIcons" TargetType="{x:Type iconPacks:PackIconBoxIcons}">
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
<Setter Property="Padding" Value="0" />
<Setter Property="FlowDirection" Value="LeftToRight" />
<Setter Property="Height" Value="16" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Padding" Value="0" />
<Setter Property="SnapsToDevicePixels" Value="False" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="Template" Value="{StaticResource MahApps.Templates.PackIconBoxIcons}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Width" Value="16" />
</Style>

</ResourceDictionary>
Loading

0 comments on commit 27b1fbc

Please sign in to comment.