분류 전체보기
-
[WPF] Find ParentC#/WPF 2023. 5. 31. 16:56
private static T FindParent(DependencyObject child, string parentName) where T : DependencyObject { if (child == null) return null; T foundParent = null; var currentParent = VisualTreeHelper.GetParent(child); do { var frameworkElement = currentParent as FrameworkElement; if(frameworkElement.Name == parentName && frameworkElement is T) { foundParent = (T) currentParent; break; } currentParent = V..
-
[WPF] EventHandlerC#/WPF 2023. 5. 31. 16:31
https://yangbengdictionary.tistory.com/11 [C#] EventHandler - 이벤트에 특정값(Class)전달 EvenHandler 일반적인 EventHander는 이벤트 발생시 전달할 값이 없는 이벤트를 나타냅니다. public delegate void EventHandler(object? sender, EventArgs arg); 매개 변수 Sender => Object 이벤트 호출자, 이벤트 소스라 불 yangbengdictionary.tistory.com
-
[WPF] Access view control from viewmodelC#/WPF 2023. 5. 31. 16:19
https://dlsenfl.tistory.com/entry/WPF-control-in-viewModel [WPF] ***** control in viewModelx:Name 지정해주고Loaded 될 때 등등 이벤트에 바인딩해주고 구성요소를 x:Name을 주면 ViewModel 에서 contorl 가져다 쓸 수 있음. 코드 비하인드에서 요딴식으루 안써도 됨. DevExpress Service방식 EXdlsenfl.tistory.com public interface IView { void AddTextBoxToGrid();}2) Inherit code behind View from your IView and implement IView.AddTextboxToGrid() methodpubl..
-
[C#] 파일 경로, Path, SpecialFolderC#/기초 2023. 5. 31. 13:53
Path 객체의 메소드 Path 객체를 사용하기 위해서는 using System.IO 를 선언해야 합니다. - Path.ChangeExtension(string path) : 경로문자열에서 확장명 부분을 변경합니다. - Path.GetDirectoryName(string path) : 경로문자열에서 파일이름을 제외한 경로부분(디렉터리명)을 반환 합니다. - Path.GetExtension(string path) : 경로문자열에서 확장명 부분만 반환합니다. - Path.HasExtension(string path) : 경로문자열에서 확장명 부분이 있는지 확인하여 bool값으로 반환합니다. - Path.GetFileName(string path) : 경로문자열에서 파일이름부분을 반환합니다. - Path.Ge..
-
-
[WPF] ReadOnly PropertyC#/WPF 2023. 5. 24. 10:48
[ReadOnly(true)] public class AddDeviceProperty { // 속성창에 표시되는 항목들 [ReadOnly(true)] public string Image { get; set; } [ReadOnly(true)] public string Name { get; set; } [ReadOnly(true)] public string Base { get; set; } [ReadOnly(true)] public string Slot { get; set; } [ReadOnly(true)] public string Description { get; set; } [ReadOnly(true)] public string Notes { get; set; } }
-
[WPF] ObservableCollection FilterC#/WPF 2023. 5. 19. 17:31
var filterView = CollectionViewSource.GetDefaultView(AppManager.AppsListBoxData); if (filterView.CanFilter) filterView.Filter = TypeNameFilter; private bool TypeNameFilter(object obj) { var appItem = obj as AppsItem; if(TypeNameList.Count> 0) { return TypeNameList.Contains(appItem.ItemType); } return false; } https://zinzza.tistory.com/21 C#, WPF, MVVM 패턴에서 ObservableCollection Filtering 하는 방법. ..