티스토리 뷰

[wpf] 재생목록 만들기(추가, 삭제, 정렬) -1


동영상 플레이어의 재생목록을 만들어보아요~

재생목록을 윈도우 탐색기를 열어 목록을 추가하고 제거하고 정렬까지


우선 할일

xaml 먼저 꾸미기

칸 나누는 게 제일 중요하다.

틀을 딱 예쁘게 하고 리스트나 버튼을 집어넣는 게 편하다.

아무튼 일단 디자인은 크게 신경을 안 쓰고 막 할 것이다.

왜냐 귀찮다.

 

그래서 본론으로 간다. ㅋ;;;


요런 것처럼 그리드 나눠서 칸 만들고 하면 편하다 

근데 오늘은 재생목록에만 집중할 거다

 

1. listbox를 만든다

있어 보이고 싶어서 border로 테두리를 만들었다.

두개나 만들었다.

한 칸에는 label을 넣어 재생목록을 표시

밑에는 재생목록을 넣을 것이다.

좀 성의 없어 보이겠다...

마지막에 코드를 넣도록 하죠 ^^

많이 생겨버렸다

단지 listbox와 button 3개가 추가된 거뿐이다.

디자인은 여기서 끝나도 될 느낌이다.

추가하고 싶으면 추가하면 되니까 나중으로 미루겠다

<Window x:Class="playlist.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:playlist"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Border BorderThickness="1" BorderBrush="Black" HorizontalAlignment="Left" Height="31" Margin="76,34,0,0" VerticalAlignment="Top" Width="200">
            <Label Content="재생목록" HorizontalAlignment="Left" Height="31" VerticalAlignment="Top" Width="200"/>

        </Border>
        <Border BorderThickness="1" BorderBrush="Black" HorizontalAlignment="Left" Height="297" Margin="76,65,0,0" VerticalAlignment="Top" Width="200"/>
        <ListBox HorizontalAlignment="Left" Height="297" Margin="76,65,0,0" VerticalAlignment="Top" Width="200" />
        <Button Content="add" HorizontalAlignment="Left" Height="30" Margin="337,84,0,0" VerticalAlignment="Top" Width="94"/>
        <Button Content="del" HorizontalAlignment="Left" Height="30" Margin="337,136,0,0" VerticalAlignment="Top" Width="94"/>
        <Button Content="sort" HorizontalAlignment="Left" Height="30" Margin="337,186,0,0" VerticalAlignment="Top" Width="94"/>

    </Grid>
</Window>

xaml파일이다.

 

오늘 끝내고 싶었으나 귀찮아서 끝낸다.

 

<next level>

add버튼은 바로 파일 추가할 것이냐 폴더를 추가할 것이냐로 나뉜다. 해보자!

 

댓글