분류 전체보기
-
[WPF]MVVMC#/WPF 2022. 7. 11. 11:52
https://blog.arong.info/wpf/2022/01/21/WPF-WPF-MVVM-%ED%8C%A8%ED%84%B4%EC%97%90-%EB%8C%80%ED%95%B4.html (WPF) WPF MVVM 패턴에 대해 - Arooong Blog 복잡한 프로그램일 수록 기본적인 설계단계에 있어 항상 다음과 같은 사항을 고려하지 않을 수 없습니다. 공통적 부분의 재사용성, 의존성 등 그리고 이런 고민은 어떻게 하면 효율적으로 사용 blog.arong.info DataContext // 코드상에서 new FirstViewModel과 비슷 //뷰 DataContext 뷰모델 연결 위 코드 DataContext Code IntelliSense 가능하게 함. ( xaml상에서 FirstViewModel의 프..
-
[WPF]MVVM SampleC#/WPF_예제소스 2022. 7. 11. 11:30
ViewModelBase public class ViewModelBase : INotifyPropertyChanged { public event PropertyChangedEventHandler? PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } CommandBase public abstract class CommandBase : ICommand { public event EventHandler? CanExecuteChang..
-
[WPF] Data BindingC#/WPF 2022. 7. 6. 11:43
UI와 Data를 동기화시켜주는 기술 앱이 UI를 표현하고 Data와 상호작용하는 것을 단순화 컨트롤(Control)의 Property와 내가 지정한 객체의 Property를 연결 (Target ↔ Source) Bingding을 위해 BindingContext 속성이 반드시 소스객체를 참조 XAML에서 Binding 마크업을 사용해 설정 Binding 마크업은 Path, Mode 속성이 있음 Path : 바인딩하고자 하는 원본객체의 속성명 Mode : 속성 값의 변화가 영향을 줄 방향 OneWay 소스에서 타깃으로만 변경사항이 반영 (Default) TwoWay 양방향으로 적용. 소스와 타깃객체가 항상 동기화 OnwWayToSource 타깃에서 소스로만 변경사항이 반영. 주로, 읽기전용의 바인딩 속성에..
-
[WPF] OnPropertyChangedC#/WPF_예제소스 2022. 7. 1. 10:50
UpdateSourceTrigger를 활용한 바인딩 업데이트 타이밍 결정 방법Permalink UpdateSourceTriggerPermalink Binding 클래스의 UpdateSourceTrigger 속성은 바인딩 소스 업데이트 타이밍을 결정하는 값을 가져오거나 설정할때 사용되는 속성입니다. 이것을 xaml에서 사용 하려면 다음과 같이 사용합니다. Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}" https://hwanine.github.io/c%23/WPF-PropertyChanged/ C# - TextBox 바인딩을 했는데 값이 바로 안바뀐다구요? TextBox 바인딩을 하고 UpdateSourceTrigger를 활용하여 업데이트 타이밍을 ..
-
[WPF]모눈종이 그리기C#/WPF_예제소스 2022. 6. 29. 13:51
==== 방법 2-2: WinForm을 이용하여 순수 Bitmap 그래픽으로 렌더링 ==== [DllImport("gdi32.dll")] private static extern bool DeleteObject(IntPtr hObject); private void DrawBitmap() { int size = 10; DateTime dt1 = DateTime.Now; System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(size * 250, size * 200); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap); int x1 = 0; int y1 = 0; System.Drawing...
-
-
[C#] 문법C#/기초 2022. 6. 29. 10:33
IEnumerable AND => 람다식 IEnumerable Names; name name name . . . name name들의 나열 public string Username => _reservation.Username; member => expression; 여기서 expression은 유효한 식 A => B A를 호출하면 B를 실행. Username을 호출하면 _reservation.Username을 불러옴 public IEnumerable Reservations => _reservations; ReservationViewModel클래스의 나열인 Reservations을 호출하면 _reservations를 불러옴. nameof nameof 식은 변수, 형식 또는 멤버의 이름을 문자열 상수로 가져..