■ GalleryControl 엘리먼트를 사용하는 방법을 보여준다.
▶ 예제 코드 (XAML)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
<Window.Resources> <DataTemplate x:Key="ItemDescriptionDataTemplateKey"> <TextBlock Foreground="Gray" Text="{Binding}" /> </DataTemplate> </Window.Resources> <Grid> <dxb:GalleryControl> <dxb:GalleryControl.Gallery> <dxb:Gallery IsGroupCaptionVisible="True" FilterCaption="(click to filter groups)" ColCount="2" ItemCheckMode="None" ItemDescriptionTemplate="{StaticResource ResourceKey=ItemDescriptionDataTemplateKey}" IsItemCaptionVisible="True" IsItemDescriptionVisible="True" ItemContentHorizontalAlignment="Left" ItemClick="gallery_ItemClick"> <dxb:Gallery.Groups> <dxb:GalleryItemGroup x:Name="galleryItemGroup1" Caption="Misc Group"> <dxb:GalleryItemGroup.Items> <dxb:GalleryItem Caption="Schedule" Description="Show schedule" Glyph="pack://application:,,,/Image/address-16x16.png" /> <dxb:GalleryItem Caption="Roles" Description="Assign roles" Glyph="pack://application:,,,/Image/role-16x16.png" /> </dxb:GalleryItemGroup.Items> </dxb:GalleryItemGroup> <dxb:GalleryItemGroup x:Name="galleryItemGroup2" Caption="Persons"> <dxb:GalleryItemGroup.Items> <dxb:GalleryItem Caption="Employees" Glyph="pack://application:,,,/Image/employee-16x16.png" /> <dxb:GalleryItem Caption="Persons" Glyph="pack://application:,,,/Image/person-16x16.png" /> <dxb:GalleryItem Caption="Users" Glyph="pack://application:,,,/Image/user-16x16.png" /> </dxb:GalleryItemGroup.Items> </dxb:GalleryItemGroup> </dxb:Gallery.Groups> </dxb:Gallery> </dxb:GalleryControl.Gallery> </dxb:GalleryControl> </Grid> |
※ xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"