Skip to content

Instantly share code, notes, and snippets.

View christian289's full-sized avatar
๐Ÿ˜€
ํ–‰๋ณตํ•˜๊ฒŒ ์ผํ•˜๊ณ  ์žˆ์–ด์š”! ํŒ€์ด ์žฌ๋ฏธ์žˆ์–ด์š”!

Vincent christian289

๐Ÿ˜€
ํ–‰๋ณตํ•˜๊ฒŒ ์ผํ•˜๊ณ  ์žˆ์–ด์š”! ํŒ€์ด ์žฌ๋ฏธ์žˆ์–ด์š”!
View GitHub Profile
@christian289
christian289 / 00_SingleQueryExecuter.csproj
Last active July 1, 2025 09:22
๋‹จ์ผ ์ปค๋ฉ˜๋“œ ConsoleAppFramework ์‚ฌ์šฉ๋ฐฉ๋ฒ•
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
</PropertyGroup>
@christian289
christian289 / long-xaml.xaml
Last active May 26, 2025 03:22
WPF XAML ์‚ฌ์šฉ ์‹œ ๊ฐ€๋กœ๋กœ ๊ธธ์–ด์ง€๋Š” Binding ์ฝ”๋“œ Binding XAML ํ™•์žฅ ๋ฌธ๋ฒ•. XAML ์ฝ”๋“œ ์ž์ฒด๋Š” ๊ธธ์–ด์งˆ ์ˆ˜ ์žˆ์œผ๋‚˜, ๊ตฌ์กฐ์ ์œผ๋กœ ์ƒ์„ฑํ•˜์—ฌ ๋ช…์‹œ์ ์œผ๋กœ ๋ณผ ์ˆ˜ ์žˆ์Œ.
<DataGridTemplateColumn.Header>
<unit:GdtCheckBox IsThreeState="False"
IsChecked="{Binding Path=DataContext.IsAllChecked, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType=DataGrid, Mode=FindAncestor}}"/>
</DataGridTemplateColumn.Header>
@christian289
christian289 / MouseUpBehavior.cs
Created November 9, 2023 07:18
WPF์˜ FrameworkElement์—์„œ ๋งˆ์šฐ์Šค ๋ฒ„ํŠผ์„ ํด๋ฆญํ–ˆ์„ ๋•Œ ๋ฐœ์ƒํ•˜๋Š” Behavior๋กœ Click ํ–ˆ์„ ๋•Œ ๋ฐ”์ธ๋”ฉ ๋œ ViewModel์˜ Command๋ฅผ ํŠธ๋ฆฌ๊ฑฐ ํ•  ์ˆ˜ ์žˆ๋‹ค.
public sealed class MouseUpBehavior : Behavior<FrameworkElement>
{
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
"Command",
typeof(ICommand),
typeof(MouseUpBehavior),
new PropertyMetadata(null));
public ICommand Command
{
@christian289
christian289 / MouseMoveBehavior.cs
Created November 9, 2023 06:07
WPF์—์„œ FrameworkElement ๋‚ด๋ถ€์—์„œ์˜ Mouse ์ขŒํ‘œ๋ฅผ ๋ฐ›์•„์˜ค๊ธฐ ์œ„ํ•œ Behavior. FrameworkElement ๋‚ด๋ถ€์—์„œ OneWayToSource ๋ชจ๋“œ๋กœ ๋ฐ”์ธ๋”ฉํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.
public sealed class MouseMoveBehavior : Behavior<FrameworkElement>
{
public static readonly DependencyProperty MouseYProperty = DependencyProperty.Register(
"MouseY",
typeof(double),
typeof(MouseMoveBehavior),
new PropertyMetadata(default(double)));
public static readonly DependencyProperty MouseXProperty = DependencyProperty.Register(
"MouseX",
@christian289
christian289 / CanvasSizeChangedInnerImagePositionBehavior.cs
Created November 9, 2023 06:04
WPF์˜ Canvas ๋‚ด๋ถ€์—์„œ Image ์‚ฌ์ด์ฆˆ๊ฐ€ Ratio์— ๋งž๊ฒŒ ์กฐ์ •๋  ๊ฒฝ์šฐ Canvas์™€ Image ์‚ฌ์ด์˜ Left, Top Offset์„ ์™ธ๋ถ€๋กœ ์ถœ๋ ฅํ•  ์ˆ˜ ์žˆ๋Š” Behavior. Image ์ปจํŠธ๋กค ๋‚ด๋ถ€์—์„œ OneWayToSource ๋ชจ๋“œ๋กœ ๋ฐ”์ธ๋”ฉ ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.
public sealed class CanvasSizeChangedInnerImagePositionBehavior : Behavior<Image>
{
public static readonly DependencyProperty LeftProperty = DependencyProperty.Register(
"Left", typeof(double), typeof(CanvasSizeChangedInnerImagePositionBehavior), new PropertyMetadata(0.0));
public double Left
{
get { return (double)GetValue(LeftProperty); }
set { SetValue(LeftProperty, value); }
}
@christian289
christian289 / ConverterMarkupExtension.cs
Last active October 31, 2023 02:55
WPF Converter Markup Extension์œผ๋กœ Converter๋ฅผ Resource ์„ ์–ธ์„ Skip (.NET 7 ์ด์ƒ ์ „์šฉ, .NET Framework ์—์„œ๋Š” ๋ฌธ๋ฒ• ๋ฐ”๊ฟ€ ๊ฒƒ.), ์•„๋ž˜ ํŒŒ์ผ์€ ์˜ˆ์‹œ
public abstract class ConverterMarkupExtension<T> : MarkupExtension, IValueConverter
where T : class, new()
{
private static Lazy<T> _converter = new Lazy<T>(() => new T());
public override object ProvideValue(IServiceProvider serviceProvider)
{
return _converter.Value;
}
@christian289
christian289 / MainWindow.xaml
Created September 14, 2023 09:00
WPF Popup ์ปจํŠธ๋กค์ด StaysOpen=True ์ƒํƒœ๋กœ ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค์˜ Window์— ํฌ์ปค์Šค๋ฅผ ์ฃผ๋ฉด Popup ์ปจํŠธ๋กค ์•ˆ์— ์žˆ๋Š” TextBox์— Cursor๊ฐ€ ์˜ฎ๊ฒจ์ง€์ง€ ์•Š๋Š”๋‹ค. Popup์„ ๋‹ซ๊ณ  ๋‹ค์‹œ ์—ด๋ฉด Cursor๊ฐ€ ์ƒ๊ธด๋‹ค.
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfApp1"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
Width="800"
Height="450"
mc:Ignorable="d">