WPF로 Windows 파일탐색기 만들기 #2 (초기 Layout)

2023. 4. 20. 13:57· 프로젝트/WPF 파일탐색기
목차
  1. ✅ Windows 파일탐색기 만들기 #2 (초기 Layout)
  2. View: Grid
  3. View: TreeView, DataGrid
  4. ✅ Windows 파일탐색기 만들기 #2 (초기 Layout) - 끝

Windows 탐색기 만들기 두 번째입니다. Explorer (UserContol)의 View에 Grid를 사용해 적당히 Layout을 잡습니다. 어차피 Style 적용하면서 수정하게 될 테니 Control을 배치할 영역만 만들어주겠습니다. 그리고 폴더를 탐색할 TreeView와 폴더 내부의 Item을 보여주는 DataGrid를 배치합니다.

 

 


 

✅ Windows 파일탐색기 만들기 #2 (초기 Layout)

 

View: Grid

 

Design

Grid : Row, Column 정의 - xaml 디자인
Grid : Row, Column 정의

 

위와 같이 적당히 Grid 정의를 합니다.

코드는 아래와 같습니다.

 

xaml

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="300"/>
        <ColumnDefinition Width="3"/>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>

    <Grid.RowDefinitions>
        <RowDefinition Height="42" />        
        <RowDefinition Height="*" />
        <RowDefinition Height="10" />
    </Grid.RowDefinitions>
</Grid>

 


 

 

View: TreeView, DataGrid

TreeView는 좌측, DataGrid는 우측에 배치합니다.

TreeView와 DataGrid 사이에는 GridSplitter가 들어갈 예정입니다.

 

Design

TreeView&#44; DataGrid 배치한 xaml 디자인
TreeView, DataGrid 배치

 

xaml

<TreeView
        Grid.Row="1" Grid.RowSpan="1" Grid.Column="0" Grid.ColumnSpan="1">            
</TreeView>

<DataGrid
          Grid.Row="1" Grid.Column="2" Grid.RowSpan="1" 
          ColumnWidth="*" VerticalAlignment="Stretch" 
          AutoGenerateColumns="False"
          HorizontalContentAlignment="Stretch"    
          VerticalContentAlignment="Center"                  
          GridLinesVisibility="None"                   
          SelectionMode="Extended" 
          SelectionUnit="FullRow">            
</DataGrid>

 


 

 

 

다음 포스팅에는 DataGrid에 파일정보를 표시할 수 있도록 ViewModel을 만들겠습니다.

 

 

 

 

 

 

 

✅ Windows 파일탐색기 만들기 #2 (초기 Layout) - 끝

  1. ✅ Windows 파일탐색기 만들기 #2 (초기 Layout)
  2. View: Grid
  3. View: TreeView, DataGrid
  4. ✅ Windows 파일탐색기 만들기 #2 (초기 Layout) - 끝
'프로젝트/WPF 파일탐색기' 카테고리의 다른 글
  • WPF로 Windows 파일탐색기 만들기 #5 (TreeViewItem Expanding)
  • WPF로 Windows 파일탐색기 만들기 #4 (Directory)
  • WPF로 Windows 파일탐색기 만들기 #3 (TreeView)
  • WPF로 Windows 파일탐색기 만들기 #1
YUNYUN3915
YUNYUN3915

공지사항

  • 블로그 이전 취소

인기 글

태그

  • DataGrid
  • Expanding Event
  • command
  • WindowsFormsHostingWpfControl
  • CS8602
  • RelayCommand
  • IDialogService
  • ElementHost
  • IValueConverter
  • 윈도우탐색기
  • wpf 전역 스타일
  • wpf
  • wpf 폰트
  • Git취소
  • itemssource
  • PasswordBox MVVM
  • ItemsControl
  • 문자열 관리
  • PasswordBox DataBinding
  • WPF style
  • TreeViewItem
  • 메세지팝업
  • ICloneable
  • OnPropertyChanged
  • DialogService
  • TreeView
  • 어트리뷰트
  • GIT
  • C#
  • WPF 흰색바
hELLO · Designed By 정상우.v4.2.0
YUNYUN3915
WPF로 Windows 파일탐색기 만들기 #2 (초기 Layout)
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.