본문 바로가기

WPF6

07. WPF DataGrid Click 위치로 정보 가져오기 using System.Windows; public T GetParentOfType(DependencyObject element) where T : DependencyObject { Type type = typeof(T); if (element == null) return null; DependencyObject parent = VisualTreeHelper.GetParent(element); if (parent == null && ((FrameworkElement)element).Parent is DependencyObject) parent = ((FrameworkElement)element).Parent; if (parent == null) return null; else if (parent.GetT.. 2020. 8. 21.
06. WPF DataGridViewHelper 데이터그리드 정보 가져오는 헬퍼 public static class DataGridViewHelper { public static DataGridCell GetCell(DataGrid dg, int row, int column) { DataGridRow rowContainer = GetRow(dg, row); if (rowContainer != null) { DataGridCellsPresenter presenter = GetVisualChild(rowContainer); DataGridCell cell = (DataGridCell)presenter.ItemContainerGenerator.ContainerFromIndex(column); // 2020. 8. 21.
05. WPF MVVM(4) ContextMenuMap 동적할당 2020/08/21 - [WPF] - 02. WPF MVVM(1) View-ViewModel 연결 2020/08/21 - [WPF] - 03. WPF MVVM(2) INotifyPropertyChanged 2020/08/21 - [WPF] - 04. WPF MVVM(3) RelayCommand public AllotmentView ViewWindow { get; set; } public DataTable Grade1Grid { get { return grade1Grid; } set { grade1Grid = value; OnPropertyChanged(); } } public DataRowView GradeRowView { set { GradeGrideClick(value); OnPropertyChang.. 2020. 8. 21.
03. WPF MVVM(2) INotifyPropertyChanged 2020/08/21 - [WPF] - 02. WPF MVVM(1) View-ViewModel 연결 public class AllotmentViewModel : PropertyChangedBase { public AllotmentView ViewWindow { get; set; } public DataTable Grade1Grid { get { return grade1Grid; } set { grade1Grid = value; OnPropertyChanged(); } } public DataRowView GradeRowView { set { GradeGrideClick(value); OnPropertyChanged(); } } } public class PropertyChangedBase : INotify.. 2020. 8. 21.