WPF - Controls. Prashanth Vijayaraghavan. Introduction. Top parts of UI are built out of smaller components , Controls. The two core concepts for the entire control model. - Content model. - Templates. Control principles. Element composition. Rich content.
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Introduction • Top parts of UI are built out of smaller components , Controls. • The two core concepts for the entire control model. - Content model. - Templates.
Control principles • Element composition. • Rich content. • Simple programming model.
Content Model(Cont..) • Uses CLR type system. • Button chrome element displays background. • Text block used to display text content. • Content presenter is the workhorse if the content model.
Control Library • Building Blocks • ToolTip • Thumb • Border • Popup • Scroll Viewer • Viewbox • Buttons • Lists • Menus and toolbars • Containers • Ranges • Editors • Document Viewers • Frame
Buttons • IsChecked and IsThreeState for CheckBox and RadioButton. • If IsThreeState is true, the user can toggle from checked to unchecked to Indeterminate
List • Four standard list controls- ListBox, ComboBox, ListView, TreeView. • List controls can be filled from one of the two sources. 1. Items Property 2. ItemsSource Property.
ListBox and ComboBox • We can change the look of the control using templates. • Combo Box is list box with dropdown. The two basic list types: ListBox and ComboBox
ListBox - ItemsPanel • ItemsPanel property can be used to change the layout of list Box. • Example is default view if control panel in windows XP. • Templates can also be used to change the layout without using the ItemsPanel property.
List box with a grid item layout <ListBox ...> <ListBox.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Columns='2'/> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox>
List View • List view derives from listBox • It has ability to separate view properties from control properties. • View property must be changed to grid view ad set properties on that object.
Menus and Toolbars • Its logically similar to TreeView. Both derive from base type: HeaderedItemsControl. • All features of content model apply to menus and toolbars. • Toolbars consume lots of space and occupies more space, but allow easy user access.
Ranges Types of range control • Slider. • Scroll Bar. • Progress Bar • Minimum and maximum values are specified using Maximum and Minimum property. - We specify or determine the current value using Value property
TextBox • Streaming model and collection model. • Block elements occupy rectangular space. Eg. Paragraph. • Inline Elements can span lines. Eg: Span, Run and Bold. • Text pointer and Text Range objects are used in the case of streaming model.
Rich TextBox(Cont..) TextOffset example, showing how the start and end tokens of an element occupy space in the text object model Simplified markup for text, with the corresponding offsets of each item