سلام خدمت کاربران وب سایت پروگرم 98 😉 در این پست کد ScaleTransform ScaleY و TransformGroup برای TextBlock با wpf و سی شارپ را آماده کردم. انشاالله که این آموزش برای شما مفید باشد.
کد ScaleTransform ScaleY و TransformGroup برای TextBlock با wpf و سی شارپ :
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib">
<Canvas.Resources>
<FontFamily x:Key="fntfam">Times New Roman</FontFamily>
<s:Double x:Key="fntsize">96</s:Double>
<TransformGroup x:Key="xform">
<ScaleTransform ScaleX="{Binding Source={StaticResource fntfam}, Path=Baseline}" />
<ScaleTransform ScaleX="{StaticResource fntsize}" />
</TransformGroup>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontFamily" Value="{StaticResource fntfam}" />
<Setter Property="FontSize" Value="{StaticResource fntsize}" />
<Setter Property="Text" Value="Reflect" />
<Setter Property="Canvas.Left" Value="400" />
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib">
<Canvas.Resources>
<FontFamily x:Key="fntfam">Times New Roman</FontFamily>
<s:Double x:Key="fntsize">96</s:Double>
<TransformGroup x:Key="xform">
<ScaleTransform ScaleX="{Binding Source={StaticResource fntfam}, Path=Baseline}" />
<ScaleTransform ScaleX="{StaticResource fntsize}" />
</TransformGroup>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontFamily" Value="{StaticResource fntfam}" />
<Setter Property="FontSize" Value="{StaticResource fntsize}" />
<Setter Property="Text" Value="Reflect" />
<Setter Property="Canvas.Left" Value="400" />