سلام خدمت کاربران وب سایت پروگرم 98 😉 در این مطلب کد انیمیشن تغییر رنگ با استفاده از SolidColorBrush با wpf و c#.net را آماده کردم. انشاالله که این آموزش برای شما مفید باشد.
تصویر خروجی این کد:
کد انیمیشن تغییر رنگ با استفاده از SolidColorBrush با wpf و c#.net :
<Window x:Class="Workspace.DockExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Workspace" Width="640" Height="480">
<StackPanel>
<Rectangle Width="100" Height="50" Stroke="Black" StrokeThickness="1"
Grid.Column="4" Grid.Row="1"
HorizontalAlignment="Center" Margin="10">
<Rectangle.Fill>
<SolidColorBrush x:Name="solidColorBrush3" Color="Blue" />
</Rectangle.Fill>
</Rectangle>
<Button Grid.Column="4" Grid.Row="2"
HorizontalAlignment="Center">
Start Animation
<Button.Triggers>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Workspace" Width="640" Height="480">
<StackPanel>
<Rectangle Width="100" Height="50" Stroke="Black" StrokeThickness="1"
Grid.Column="4" Grid.Row="1"
HorizontalAlignment="Center" Margin="10">
<Rectangle.Fill>
<SolidColorBrush x:Name="solidColorBrush3" Color="Blue" />
</Rectangle.Fill>
</Rectangle>
<Button Grid.Column="4" Grid.Row="2"
HorizontalAlignment="Center">
Start Animation
<Button.Triggers>