첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
다운로드

▶ MainWindow.xaml

<Window x:Class="TestProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:TestProject"
    Title="커스텀 컨트롤 만들기"
    Width="800"
    Height="600">
    <TabControl Margin="10">
        <TabItem Header="SingleListBox">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <local:SingleListBox x:Name="singleListBox" Grid.Column="0" />
                <StackPanel Grid.Column="2">
                    <StackPanel HorizontalAlignment="Left">
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Data"
                            Click="singleListBoxDataButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Value"
                            Click="singleListBoxValueButton_Click" />
                    </StackPanel>
                    <TextBlock Name="singleListBoxTextBlock" Margin="10"/>
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="SingleComboBox">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <local:SingleComboBox x:Name="singleComboBox" Grid.Column="0"
                    VerticalAlignment="Top"
                    Margin="0 50 0 0"
                    Width="200"
                    Height="30"
                    PopupWidth="250" />
                <StackPanel Grid.Column="2">
                    <StackPanel HorizontalAlignment="Left">
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Data"
                            Click="singleComboBoxDataButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Value"
                            Click="singleComboBoxValueButton_Click" />
                    </StackPanel>
                    <TextBlock Name="singleComboBoxTextBlock" Margin="10"/>
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="MultiListBox">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <local:MultiListBox x:Name="multiListBox" Grid.Column="0" />
                <StackPanel Grid.Column="2">
                    <StackPanel HorizontalAlignment="Left">
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Data"
                            Click="multiListBoxDataButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Value"
                            Click="multiListBoxValueButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Check All"
                            Click="multiListBoxCheckAllButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Uncheck All"
                            Click="multiListBoxUncheckAllButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move TopMost"
                            Click="multiListBoxMoveTopMostButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move Top"
                            Click="multiListBoxMoveTopButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move Bottom"
                            Click="multiListBoxMoveBottomButton_Click" />
                    </StackPanel>
                    <TextBlock Name="multiListBoxTextBlock" Margin="10" />
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="MultiComboBox">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <local:MultiComboBox x:Name="multiComboBox" Grid.Column="0"
                    VerticalAlignment="Top"
                    Margin="0 50 0 0"
                    Width="200"
                    Height="30"
                    PopupWidth="250" />
                <StackPanel Grid.Column="2">
                    <StackPanel HorizontalAlignment="Left">
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Data"
                            Click="multiComboBoxDataButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Value"
                            Click="multiComboBoxValueButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Check All"
                            Click="multiComboBoxCheckAllButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Uncheck All"
                            Click="multiComboBoxUncheckAllButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move TopMost"
                            Click="multiComboBoxMoveTopMostButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move Top"
                            Click="multiComboBoxMoveTopButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move Bottom"
                            Click="multiComboBoxMoveBottomButton_Click" />
                    </StackPanel>
                    <TextBlock Name="multiComboBoxTextBlock" Margin="10" />
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="PriorityListBox">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <local:PriorityListBox x:Name="priorityListBox" Grid.Column="0" />
                <StackPanel Grid.Column="2">
                    <StackPanel HorizontalAlignment="Left">
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Data"
                            Click="priorityListBoxDataButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Value"
                            Click="priorityListBoxValueButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Check All"
                            Click="priorityListBoxCheckAllButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Uncheck All"
                            Click="priorityListBoxUncheckAllButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move TopMost"
                            Click="priorityListBoxMoveTopMostButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move Top"
                            Click="priorityListBoxMoveTopButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move Bottom"
                            Click="priorityListBoxMoveBottomButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Show Priority"
                            Click="priorityListBoxShowPriorityButton_Click" />
                    </StackPanel>
                    <TextBlock Name="priorityListBoxTextBlock" Margin="10" />
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="PriorityComboBox">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <local:PriorityComboBox x:Name="priorityComboBox" Grid.Column="0"
                    VerticalAlignment="Top"
                    Margin="0 50 0 0"
                    Width="200"
                    Height="30"
                    PopupWidth="250" />
                <StackPanel Grid.Column="2">
                    <StackPanel HorizontalAlignment="Left">
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Data"
                            Click="priorityComboBoxDataButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Value"
                            Click="priorityComboBoxValueButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Check All"
                            Click="priorityComboBoxCheckAllButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Uncheck All"
                            Click="priorityComboBoxUncheckAllButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move TopMost"
                            Click="priorityComboBoxMoveTopMostButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move Top"
                            Click="priorityComboBoxMoveTopButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Move Bottom"
                            Click="priorityComboBoxMoveBottomButton_Click" />
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Show Priority"
                            Click="priorityComboBoxShowPriorityButton_Click" />
                    </StackPanel>
                    <TextBlock Name="priorityComboBoxTextBlock" Margin="10" />
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="Folder">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <local:Folder x:Name="folder" Grid.Column="0"
                    Margin="2"
                    AutoHeight="True"
                    PanelBorder="RoyalBlue"
                    HeaderHeight="26"
                    HeaderBackground="RoyalBlue"
                    HeaderForeground="White"
                    HeaderButtonRegular="White"
                    HeaderButtonHover="Yellow"
                    HeaderButtonPress="Gold"
                    HeaderText="Sample Panel">
                    <Ellipse Fill="Orange" Width="200" Height="200" />
                </local:Folder>
                <StackPanel Grid.Column="2">
                    <TextBlock Name="folderTextBlock" Margin="10" />
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="IconPopupButton">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <local:IconPopupButton x:Name="iconPopupButton" Grid.Column="0"
                    Width="30"
                    Height="25"
                    Value="보고서"
                    Icon="Image/보고서.png">
                    <local:IconPopupButton.ItemsPanel>
                        <ItemsPanelTemplate>
                            <UniformGrid Columns="3" />
                        </ItemsPanelTemplate>
                    </local:IconPopupButton.ItemsPanel>
                    <local:IconPopupButton.ItemsSource>
                        <x:Array Type="{x:Type local:IconButton}">
                            <local:IconButton
                                Icon="Image/보고서.png"
                                ArrowVisibility="Collapsed"
                                Value="보고서" />
                            <local:IconButton
                                Icon="Image/순번.png"
                                ArrowVisibility="Collapsed"
                                Value="순번" />
                            <local:IconButton
                                Icon="Image/얼굴.png"
                                ArrowVisibility="Collapsed"
                                Value="얼굴" />
                            <local:IconButton
                                Icon="Image/저장소.png"
                                ArrowVisibility="Collapsed"
                                Value="저장소" />
                            <local:IconButton
                                Icon="Image/찾기.png"
                                ArrowVisibility="Collapsed"
                                Value="찾기" />
                            <local:IconButton
                                Icon="Image/처리완료.png"
                                ArrowVisibility="Collapsed"
                                Value="처리완료" />
                            <local:IconButton
                                Icon="Image/파일.png"
                                ArrowVisibility="Collapsed"
                                Value="파일" />
                            <local:IconButton
                                Icon="Image/파일보기.png"
                                ArrowVisibility="Collapsed"
                                Value="파일보기" />
                        </x:Array>
                    </local:IconPopupButton.ItemsSource>
                </local:IconPopupButton>
                <StackPanel Grid.Column="2">
                    <TextBlock Name="iconPopupButtonTextBlock" Margin="10" />
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="IconSelectorButton">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <StackPanel Name="stackPanel" Orientation="Vertical" Grid.Column="0">
                    <local:IconSelectorButton x:Name="iconSelectorButton1"
                        Margin="10 50 10 0"
                        Width="32"
                        Height="25"
                        IsTabStop="False"
                        GroupName="A"
                        Value="보고서"
                        Icon="Image/보고서.png">
                        <local:IconSelectorButton.ItemsPanel>
                            <ItemsPanelTemplate>
                                <UniformGrid Columns="3" />
                            </ItemsPanelTemplate>
                        </local:IconSelectorButton.ItemsPanel>
                        <local:IconSelectorButton.ItemsSource>
                            <x:Array Type="{x:Type local:IconButton}">
                                <local:IconButton
                                    Icon="Image/보고서.png"
                                    ArrowVisibility="Collapsed"
                                    Value="보고서" />
                                <local:IconButton
                                    Icon="Image/순번.png"
                                    ArrowVisibility="Collapsed"
                                    Value="순번" />
                                <local:IconButton
                                    Icon="Image/얼굴.png"
                                    ArrowVisibility="Collapsed"
                                    Value="얼굴" />
                                <local:IconButton
                                    Icon="Image/저장소.png"
                                    ArrowVisibility="Collapsed"
                                    Value="저장소" />
                            </x:Array>
                        </local:IconSelectorButton.ItemsSource>
                    </local:IconSelectorButton>
                    <local:IconSelectorButton x:Name="iconSelectorButton2"
                        Width="32"
                        Height="25"
                        IsTabStop="False"
                        GroupName="A"
                        ArrowVisibility="Hidden"
                        Value="사이트보기"
                        Icon="Image/사이트보기.png">
                    </local:IconSelectorButton>
                    <local:IconSelectorButton x:Name="iconSelectorButton3"
                        Width="32"
                        Height="25"
                        IsTabStop="False"
                        GroupName="B"
                        Value="찾기"
                        Icon="Image/찾기.png">
                        <local:IconSelectorButton.ItemsPanel>
                            <ItemsPanelTemplate>
                                <UniformGrid Columns="3" />
                            </ItemsPanelTemplate>
                        </local:IconSelectorButton.ItemsPanel>
                        <local:IconSelectorButton.ItemsSource>
                            <x:Array Type="{x:Type local:IconButton}">
                                <local:IconButton
                                    Icon="Image/찾기.png"
                                    ArrowVisibility="Collapsed"
                                    Value="찾기" />
                                <local:IconButton
                                    Icon="Image/처리완료.png"
                                    ArrowVisibility="Collapsed"
                                    Value="처리완료" />
                                <local:IconButton
                                    Icon="Image/파일.png"
                                    ArrowVisibility="Collapsed"
                                    Value="파일" />
                                <local:IconButton
                                    Icon="Image/파일보기.png"
                                    ArrowVisibility="Collapsed"
                                    Value="파일보기" />
                            </x:Array>
                        </local:IconSelectorButton.ItemsSource>
                    </local:IconSelectorButton>
                    <local:IconSelectorButton x:Name="iconSelectorButton4"
                        Width="32"
                        Height="25"
                        GroupName="B"
                        IsTabStop="False"
                        ArrowVisibility="Hidden"
                        Value="일괄수정"
                        Icon="Image/일괄수정.png">
                    </local:IconSelectorButton>
                </StackPanel>
                <StackPanel Grid.Column="2">
                    <StackPanel HorizontalAlignment="Left">
                        <Button
                            Margin="10"
                            Width="150"
                            Height="30"
                            Content="Value" />
                    </StackPanel>
                    <TextBlock Name="iconSelectorButtonTextBlock" Margin="10" />
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="FontDialog">
            <Grid Background="#ffe5e5e5">
                <Button Name="fontDialogButton"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    MinWidth="100"
                    Padding="10"
                    Content="Font Dialog" />
            </Grid>
        </TabItem>
        <TabItem Header="LayoutButton">
            <Grid Background="#ffe5e5e5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="5"   />
                    <ColumnDefinition Width="*"   />
                </Grid.ColumnDefinitions>
                <local:LayoutButton x:Name="layoutButton" Grid.Column="0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Width="20"
                    Height="25" />
                <StackPanel Grid.Column="2">
                    <TextBlock Name="layoutButtonTextBlock" Margin="10" />
                </StackPanel>
            </Grid>
        </TabItem>
    </TabControl>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요