Skip to content

Instantly share code, notes, and snippets.

View ghost1372's full-sized avatar
Focusing

Mahdi Hosseini ghost1372

Focusing
View GitHub Profile
@ghost1372
ghost1372 / App.xaml
Created April 20, 2023 12:00
WinUIGallery-TitleBar
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent" />
</ResourceDictionary>
@ghost1372
ghost1372 / publish.yml
Last active May 4, 2024 20:12
I use this action to publish project, compress to Zip and upload to GitHub release
name: "Publish"
on:
push:
tags:
- "v*"
env:
PROJECT_PATH: WpfApp6/WpfApp6.csproj
ZIP_PATH: WpfApp6/bin/Release/net5.0-windows/win-x86/publish/WpfApp6-Portable.zip
@ghost1372
ghost1372 / AnalogClock.cs
Last active November 11, 2023 16:46
Create AnalogClock
// مرحله اول
public class AnalogClock : Control
{
}
// مرحله دوم
[TemplatePart(Name = PART_HOUR, Type = typeof(Line))]
[TemplatePart(Name = PART_MINUTE, Type = typeof(Line))]
[TemplatePart(Name = PART_SECOND, Type = typeof(Line))]
public class AnalogClock : Control
<Window.Resources>
<PathGeometry x:Key="Geometry1" Figures="M45,0 C45,-20.986821 34.926406,-38 22.499998,-38 C10.073593,-38 0,-20.986821 0,0"/>
<PathGeometry x:Key="Geometry2" Figures="M90,0 C90,-20.986821 79.926406,-38 67.499998,-38 C55.073593,-38 45,-20.986821 45,0"/>
<PathGeometry x:Key="Geometry3" Figures="M135,0 C135,-20.986821 124.92641,-38 112.5,-38 C100.07359,-38 90,-20.986821 90,0"/>
<PathGeometry x:Key="Geometry4" Figures="M180,0 C180,-20.986821 169.92641,-38 157.5,-38 C145.07359,-38 135,-20.986821 135,0"/>
<Storyboard x:Key="Storyboard1" AutoReverse="True" RepeatBehavior="Forever">
<!--0-->
<DoubleAnimation Duration="0:0:2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Border0" To="180"/>
<ColorAnimation Duration="0:0:2" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Border0" To="#24d3fb"/>
@ghost1372
ghost1372 / Geometry.xaml
Last active June 17, 2022 06:05
More than 3200 icons in Geometry Format based on FontAwesome, ModernUI, Icons8, MaterialLight
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Geometry x:Key="CalendarGeometry">M377.897477 116.291025l265.298718 0 0 47.459125-265.298718 0 0-47.459125ZM888.317416 116.291025 748.229288 116.291025l0 47.459125 123.54866 0c18.167626 0 32.894732 14.727106 32.894732 32.894732l0 92.92987L115.42936 289.574752l0-92.92987c0-18.167626 14.727106-32.894732 32.894732-32.894732l123.54866 0 0-47.459125L131.776437 116.291025c-35.244356 0-63.814389 28.571056-63.814389 63.815412l0.004093 713.966329c0 35.243333 28.571056 63.814389 63.814389 63.814389l756.540979 0c35.244356 0 63.814389-28.571056 63.814389-63.815412l-0.004093-713.966329C952.131805 144.861058 923.560749 116.291025 888.317416 116.291025zM904.67268 337.033877l0 540.498398c0 18.167626-14.727106 32.894732-32.894732 32.894732L148.324092 910.427007c-18.167626 0-32.894732-14.727106-32.894732-32.894732L115.42936 337.033877 904.67268 337.033877zM300.659736 64.801927l47.4
@ghost1372
ghost1372 / InteractionTriggers.xaml
Created September 21, 2018 08:03
Interaction.Triggers for change in controls when selected
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<ei:ChangePropertyAction PropertyName="Style" Value="{StaticResource ButtonDanger}" />
</i:EventTrigger>
</i:Interaction.Triggers>