SlideShare una empresa de Scribd logo
1 de 35
Don Burnett
http://blog.donburnett.com
http://www.uxmagic.com
Microsoft Expression M.V.P. 2008-2009
   Panels
   Advanced Panels
   Transformations
   Layout Engine
   Panels In WPF
   Canvas
   StackPanel
   WrapPanel
   DockPanel
   Grid
   Columns and Rows
   Star Sizing
   Properties That Affect Layout
   Properties That Relate to Layout
   Demo: Panels
   Panels are responsible for layout
   Framework panels:
       Canvas
       StackPanel
       WrapPanel
       DockPanel
       Grid
Top, Left                               Top, Right




                   Y



               X


                        Absolute
                       Positioning




Bottom, Left                         Bottom, Right
   The Canvas panel enables absolute position, and
    it is the closest panel to the layout available in
    traditional Windows Forms applications. Objects
    placed within the Canvas are not
    clipped, therefore, if you arranged a Button on a
    Canvas with a Height and Width of zero, the
    Button will still be visible, relative to the top-left
    corner of the Canvas.

   Position by using attached properties:
     Canvas.Left
     Canvas.Top
     Canvas.Bottom
     Canvas.Right
   Stacks child elements together
   Orientation:
       Vertical
       Horizontal
   The StackPanel layout panel stacks child elements
    together. The Orientation property determines the
    direction in which elements are stacked. Setting
    Orientation property to Vertical, the default, stacks
    elements on top of one another; the width of the
    panel becomes infinite. Setting the Orientation
    property to Horizontal stacks elements next to one
    another; the height of the panel becomes infinite.
   Stacks child elements together
   When the bounds of the panel are exceeded child
    elements are wrapped
   Orientation:
     Horizontal
     Vertical
   The WrapPanel layout panel stacks child elements
    together, similar to the StackPanel, but once the
    bounds of the panel have been reached the child
    elements within the panel are wrapped.
   The Orientation property determines the direction
    in which elements are stacked. Setting the
    Orientation property to Horizontal, the
    default, stacks elements next to one another and
    the panel wraps under the existing elements.
    Setting the Orientation property to Vertical stacks
    elements on top of one another; the panel wraps
    child elements next to one another.
Top

Left          Right

       Bottom




 LastChildFill
   The DockPanel layout panel that stack (MP
    replace “that stack” with” stacks”) child
    elements either horizontally or
    vertically, relative to each other based on
    the Dock attached property, (MP replace
    “,” with “;”) possible values are Left (the
    default), Right, Top, and Bottom.
   The LastChildFill boolean property
    specifies if the (MP remove “if the”)
    whether the last child element within the
    panel stretches to fill the remaining
    available space.
Column = 0      Column = 1      Column = 2


Row = 0
                         Row = 0
                        Column = 0
Row = 1                RowSpan = 3
                                          Row = 0
                                         Column = 2

Row = 2


                                         Row = 3
Row = 3                                Column = 0
                                     ColumnSpan = 2
   Grid rows are defined by:
       RowDefinition objects
   Grid columns are defined by:
       ColumnDefinition objects
   Use GridLength values to represent:
       Height of a row
                                   <Grid>
       Width of a column            <Grid.RowDefinitions>
                                       <RowDefinition Height='100' />
                                       <RowDefinition Height=‘Auto'/>
                                     </Grid.RowDefinitions>
                                     <Grid.ColumnDefinitions>
                                       <ColumnDefinition Width='50' />
                                       <ColumnDefinition Width='100'/>
                                       <ColumnDefinition Width=‘*‘/>
                                     </Grid.ColumnDefinitions>
                                   </Grid>
   Star sizing is used to express proportional values
   Star values can be weighted, for example:
   Star sizing is used to express values as a weighted
    proportion of available space.

   The first example breaks the columns into the ratio of
    50 percent for the first column and 25 percent for the
    remaining columns. The second example uses a fixed
    size of 300 for the last column, the first column then
    has 25 percent of the remaining space, after the 300
    has been allocated to the last column; and then the
    middle column takes up the remaining space.

   Star sizing is very flexible and enables many different
    grid configurations.
   HorizontalAlignment- Specifies how an element should be aligned from side to side.
   VerticalAlignment- Specifies how an element should be aligned from top to bottom.
   Margin- Specifies distance between content of a control and it’s margins or border.
   Padding- Amount of space between the content of a Control and it’s margin or border.



                                                                   Margin between an
                                                                   element and any
                                                                   other child elements
                                        Text box



     Padding around
     element
   ClipToBounds. True for clipping its children.
   Clip. Geometry used to define the outline of the contents of an
    element.
   Visibility:
    Collapsed – layout will ignore
    Hidden – not visible but still affects layout

           Panel (Canvas) area

                          Text box           Canvas.ClipToBounds = False


                          Text          Canvas.ClipToBounds = True
   VirtualizingPanel
   Custom Panels
   A virtualized panel displays the UI elements that
    are visible.
   You often have more child elements than are
    actually visible. Virtualization optimizes UI creation
    by creating child elements when they are visible.
   Abstract class that enables UI virtualization
   Does not enable data virtualization
   VirtualizingStackPanel
       ListBox


VirtualizingPanel is an abstract class that provides the
   foundation for building panels that need to virtualize
   their child elements. The VirtualizingPanel enables UI
   virtualization, but not data virtualization. WPF provides
   one VirtualizingPanel implementation, the
   VirtualizingStackPanel. The VistualizingStackPanel is
   the default items host for the ListBox control.
   Transforms In WPF
   Render Transforms
   Layout Transforms
   Demo: Transforms
   Framework Transforms:
       ScaleTransform
       TranslateTransform
       SkewTransform
       RotateTransform
       TransformGroup                     Before Transform

                             Scale      Translate    Skew     Rotate




                             Scale
                                     Translate
                                           After Transform
   All UIElements have a RenderTransform property
   Transforms applied to RenderTransform do not
    affect layout


                            Before Transform

                  Button 1      Button 2      Button 3
                   Rotate       Rotate         Rotate




                            After Transform
   All FrameworkElements have a LayoutTransform
    property
   Transforms applied to the LayoutTransform
    property affect layout

                           Before Transform

                 Button 1     Button 2       Button 3
                  Rotate       Rotate         Rotate




                           After Transform
•   ScaleTransform
•   TranslateTransform
•   SkewTransform
•   RotateTransform
   “Layout” is the sizing and positioning of visual
    elements within a user interface
   Layout Elements (Panels):
       Maintains a collection of child elements
       Are responsible for sizing child elements
       Are responsible for positioning child elements
1.   Inherit from Panel (or anything else)
2.   Implement MeasureOverride
     •   Call Measure on each child
3.   Implement ArrangeOverride
     •   Call Arrange on each child
public class CustomPanel : Panel
{
    protected override Size MeasureOverride(Size availableSize)
    {
        foreach (UIElement child in InternalChildren)
        {
            child.Measure(availableSize);
            ...
        }

    }
    protected override Size ArrangeOverride(Size finalSize)
    {
        foreach (UIElement child in InternalChildren)
        {
           child.Arrange(...);
            ...
        }

    }
}
   There are usually two reasons to create a custom panel:
•    Performance
•    Algorithmic Layout

   Creating a new panel for performances reasons is a rare occurrence; but, for
    example the UniformGrid was created for performance reasons.
   Algorithmic layout means a layout that is based on a algorithm as opposed
    to positional layout; for example, child elements positioned along a circular
    path.

   To write a custom Panel inherit from Panel. WPF has a two phase model for
    layout, a measure and a arrange phase; the MeasureOverride and
    ArrangeOverride methods must be implemented. It is very important that in
    each phase you call the appropriate Measure and Arrange methods on each
    child; or it is very likely WPF will not render the child element.

   A great example of custom panels can be found in “Kevin’s Bag-o-Tricks” by
    Kevin Moore : http://j832.com/bagotricks/
Don Burnett
http://blog.donburnett.com
http://www.uxmagic.com
Microsoft Expression M.V.P. 2008-2009

Más contenido relacionado

Similar a WPF Line of Business Application XAML Layouts Presentation

Goodbye Nightmare : Tops and Tricks for creating Layouts
Goodbye Nightmare : Tops and Tricks for creating LayoutsGoodbye Nightmare : Tops and Tricks for creating Layouts
Goodbye Nightmare : Tops and Tricks for creating LayoutsLuc Bors
 
Programming Java GUI using SWING, Event Handling
Programming Java GUI using SWING, Event HandlingProgramming Java GUI using SWING, Event Handling
Programming Java GUI using SWING, Event HandlingJadavsejal
 
Star logo nova code cookbook
Star logo nova  code cookbookStar logo nova  code cookbook
Star logo nova code cookbookBarbara M. King
 
Star logo nova code cookbook(1)
Star logo nova  code cookbook(1)Star logo nova  code cookbook(1)
Star logo nova code cookbook(1)Barbara M. King
 
Fabric.js @ Falsy Values
Fabric.js @ Falsy ValuesFabric.js @ Falsy Values
Fabric.js @ Falsy ValuesJuriy Zaytsev
 
Webcast 09/2008 - Silverlight 2 Beta 2
Webcast 09/2008 - Silverlight 2 Beta 2Webcast 09/2008 - Silverlight 2 Beta 2
Webcast 09/2008 - Silverlight 2 Beta 2sleguiza
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window ToolkitRutvaThakkar1
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsNaman Dwivedi
 
Angular.js Directives for Interactive Web Applications
Angular.js Directives for Interactive Web ApplicationsAngular.js Directives for Interactive Web Applications
Angular.js Directives for Interactive Web ApplicationsBrent Goldstein
 
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz
 
Taming the browser with the YUI Dom Component
Taming the browser with the YUI Dom ComponentTaming the browser with the YUI Dom Component
Taming the browser with the YUI Dom ComponentChristian Heilmann
 
Manual Layout Revisited
Manual Layout RevisitedManual Layout Revisited
Manual Layout Revisitedgillygize
 

Similar a WPF Line of Business Application XAML Layouts Presentation (20)

Goodbye Nightmare : Tops and Tricks for creating Layouts
Goodbye Nightmare : Tops and Tricks for creating LayoutsGoodbye Nightmare : Tops and Tricks for creating Layouts
Goodbye Nightmare : Tops and Tricks for creating Layouts
 
Goodbye Nightmare: Tips and Tricks for Creating Complex Layouts with Oracle A...
Goodbye Nightmare: Tips and Tricks for Creating Complex Layouts with Oracle A...Goodbye Nightmare: Tips and Tricks for Creating Complex Layouts with Oracle A...
Goodbye Nightmare: Tips and Tricks for Creating Complex Layouts with Oracle A...
 
Programming Java GUI using SWING, Event Handling
Programming Java GUI using SWING, Event HandlingProgramming Java GUI using SWING, Event Handling
Programming Java GUI using SWING, Event Handling
 
Visual State Manager
Visual State ManagerVisual State Manager
Visual State Manager
 
Star logo nova code cookbook
Star logo nova  code cookbookStar logo nova  code cookbook
Star logo nova code cookbook
 
Star logo nova code cookbook(1)
Star logo nova  code cookbook(1)Star logo nova  code cookbook(1)
Star logo nova code cookbook(1)
 
03 unity 3_d_part_2
03 unity 3_d_part_203 unity 3_d_part_2
03 unity 3_d_part_2
 
Fabric.js @ Falsy Values
Fabric.js @ Falsy ValuesFabric.js @ Falsy Values
Fabric.js @ Falsy Values
 
Bootstrap 4 ppt
Bootstrap 4 pptBootstrap 4 ppt
Bootstrap 4 ppt
 
Webcast 09/2008 - Silverlight 2 Beta 2
Webcast 09/2008 - Silverlight 2 Beta 2Webcast 09/2008 - Silverlight 2 Beta 2
Webcast 09/2008 - Silverlight 2 Beta 2
 
Web Layout
Web LayoutWeb Layout
Web Layout
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window Toolkit
 
2. react - native: basic
2. react - native: basic2. react - native: basic
2. react - native: basic
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animations
 
Angular.js Directives for Interactive Web Applications
Angular.js Directives for Interactive Web ApplicationsAngular.js Directives for Interactive Web Applications
Angular.js Directives for Interactive Web Applications
 
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016
 
Layout manager
Layout managerLayout manager
Layout manager
 
Ruby Classes
Ruby ClassesRuby Classes
Ruby Classes
 
Taming the browser with the YUI Dom Component
Taming the browser with the YUI Dom ComponentTaming the browser with the YUI Dom Component
Taming the browser with the YUI Dom Component
 
Manual Layout Revisited
Manual Layout RevisitedManual Layout Revisited
Manual Layout Revisited
 

Más de Our Community Exchange LLC

Más de Our Community Exchange LLC (10)

Real Time Connected Vehicle Networking with HDInsight and Apache Storm
Real Time Connected Vehicle Networking with HDInsight and Apache StormReal Time Connected Vehicle Networking with HDInsight and Apache Storm
Real Time Connected Vehicle Networking with HDInsight and Apache Storm
 
2012 Updated Portfolio
2012 Updated Portfolio2012 Updated Portfolio
2012 Updated Portfolio
 
Roi and user experience
Roi and user experienceRoi and user experience
Roi and user experience
 
I phone versus windows phone 7 coding
I phone versus windows phone 7 codingI phone versus windows phone 7 coding
I phone versus windows phone 7 coding
 
U Xmagic Agile Presentation
U Xmagic Agile PresentationU Xmagic Agile Presentation
U Xmagic Agile Presentation
 
Porting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidancePorting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application Guidance
 
WPF Line of Business Control Templates Styles
WPF Line of Business Control Templates StylesWPF Line of Business Control Templates Styles
WPF Line of Business Control Templates Styles
 
WPF Fundamentals
WPF FundamentalsWPF Fundamentals
WPF Fundamentals
 
Wpf Tech Overview2009
Wpf Tech Overview2009Wpf Tech Overview2009
Wpf Tech Overview2009
 
New Introductionfor Flash Designers
New Introductionfor Flash DesignersNew Introductionfor Flash Designers
New Introductionfor Flash Designers
 

Último

Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...Nitya salvi
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...nirzagarg
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...nirzagarg
 
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedWhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedNitya salvi
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...amitlee9823
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...Delhi Call girls
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )gajnagarg
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...SUHANI PANDEY
 
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men 🔝Kolkata🔝 Escorts...
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men  🔝Kolkata🔝   Escorts...➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men  🔝Kolkata🔝   Escorts...
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men 🔝Kolkata🔝 Escorts...amitlee9823
 
Lecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptxLecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptxShoaibRajper1
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024Ilham Brata
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...Delhi Call girls
 
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service AvailableCall Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service AvailableNitya salvi
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecturesaipriyacoool
 
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...amitlee9823
 

Último (20)

Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
 
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedWhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
 
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men 🔝Kolkata🔝 Escorts...
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men  🔝Kolkata🔝   Escorts...➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men  🔝Kolkata🔝   Escorts...
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men 🔝Kolkata🔝 Escorts...
 
Lecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptxLecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptx
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
 
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service AvailableCall Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
 
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
 
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
 

WPF Line of Business Application XAML Layouts Presentation

  • 2.
  • 3. Panels  Advanced Panels  Transformations  Layout Engine
  • 4.
  • 5. Panels In WPF  Canvas  StackPanel  WrapPanel  DockPanel  Grid  Columns and Rows  Star Sizing  Properties That Affect Layout  Properties That Relate to Layout  Demo: Panels
  • 6. Panels are responsible for layout  Framework panels:  Canvas  StackPanel  WrapPanel  DockPanel  Grid
  • 7. Top, Left Top, Right Y X Absolute Positioning Bottom, Left Bottom, Right
  • 8. The Canvas panel enables absolute position, and it is the closest panel to the layout available in traditional Windows Forms applications. Objects placed within the Canvas are not clipped, therefore, if you arranged a Button on a Canvas with a Height and Width of zero, the Button will still be visible, relative to the top-left corner of the Canvas.  Position by using attached properties:  Canvas.Left  Canvas.Top  Canvas.Bottom  Canvas.Right
  • 9. Stacks child elements together  Orientation:  Vertical  Horizontal
  • 10. The StackPanel layout panel stacks child elements together. The Orientation property determines the direction in which elements are stacked. Setting Orientation property to Vertical, the default, stacks elements on top of one another; the width of the panel becomes infinite. Setting the Orientation property to Horizontal stacks elements next to one another; the height of the panel becomes infinite.
  • 11. Stacks child elements together  When the bounds of the panel are exceeded child elements are wrapped  Orientation:  Horizontal  Vertical
  • 12. The WrapPanel layout panel stacks child elements together, similar to the StackPanel, but once the bounds of the panel have been reached the child elements within the panel are wrapped.  The Orientation property determines the direction in which elements are stacked. Setting the Orientation property to Horizontal, the default, stacks elements next to one another and the panel wraps under the existing elements.  Setting the Orientation property to Vertical stacks elements on top of one another; the panel wraps child elements next to one another.
  • 13. Top Left Right Bottom LastChildFill
  • 14. The DockPanel layout panel that stack (MP replace “that stack” with” stacks”) child elements either horizontally or vertically, relative to each other based on the Dock attached property, (MP replace “,” with “;”) possible values are Left (the default), Right, Top, and Bottom.  The LastChildFill boolean property specifies if the (MP remove “if the”) whether the last child element within the panel stretches to fill the remaining available space.
  • 15. Column = 0 Column = 1 Column = 2 Row = 0 Row = 0 Column = 0 Row = 1 RowSpan = 3 Row = 0 Column = 2 Row = 2 Row = 3 Row = 3 Column = 0 ColumnSpan = 2
  • 16. Grid rows are defined by:  RowDefinition objects  Grid columns are defined by:  ColumnDefinition objects  Use GridLength values to represent:  Height of a row <Grid>  Width of a column <Grid.RowDefinitions> <RowDefinition Height='100' /> <RowDefinition Height=‘Auto'/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width='50' /> <ColumnDefinition Width='100'/> <ColumnDefinition Width=‘*‘/> </Grid.ColumnDefinitions> </Grid>
  • 17. Star sizing is used to express proportional values  Star values can be weighted, for example:
  • 18. Star sizing is used to express values as a weighted proportion of available space.  The first example breaks the columns into the ratio of 50 percent for the first column and 25 percent for the remaining columns. The second example uses a fixed size of 300 for the last column, the first column then has 25 percent of the remaining space, after the 300 has been allocated to the last column; and then the middle column takes up the remaining space.  Star sizing is very flexible and enables many different grid configurations.
  • 19. HorizontalAlignment- Specifies how an element should be aligned from side to side.  VerticalAlignment- Specifies how an element should be aligned from top to bottom.  Margin- Specifies distance between content of a control and it’s margins or border.  Padding- Amount of space between the content of a Control and it’s margin or border. Margin between an element and any other child elements Text box Padding around element
  • 20. ClipToBounds. True for clipping its children.  Clip. Geometry used to define the outline of the contents of an element.  Visibility: Collapsed – layout will ignore Hidden – not visible but still affects layout Panel (Canvas) area Text box Canvas.ClipToBounds = False Text Canvas.ClipToBounds = True
  • 21.
  • 22. VirtualizingPanel  Custom Panels
  • 23. A virtualized panel displays the UI elements that are visible.  You often have more child elements than are actually visible. Virtualization optimizes UI creation by creating child elements when they are visible.
  • 24. Abstract class that enables UI virtualization  Does not enable data virtualization  VirtualizingStackPanel  ListBox VirtualizingPanel is an abstract class that provides the foundation for building panels that need to virtualize their child elements. The VirtualizingPanel enables UI virtualization, but not data virtualization. WPF provides one VirtualizingPanel implementation, the VirtualizingStackPanel. The VistualizingStackPanel is the default items host for the ListBox control.
  • 25.
  • 26. Transforms In WPF  Render Transforms  Layout Transforms  Demo: Transforms
  • 27. Framework Transforms:  ScaleTransform  TranslateTransform  SkewTransform  RotateTransform  TransformGroup Before Transform Scale Translate Skew Rotate Scale Translate After Transform
  • 28. All UIElements have a RenderTransform property  Transforms applied to RenderTransform do not affect layout Before Transform Button 1 Button 2 Button 3 Rotate Rotate Rotate After Transform
  • 29. All FrameworkElements have a LayoutTransform property  Transforms applied to the LayoutTransform property affect layout Before Transform Button 1 Button 2 Button 3 Rotate Rotate Rotate After Transform
  • 30. ScaleTransform • TranslateTransform • SkewTransform • RotateTransform
  • 31. “Layout” is the sizing and positioning of visual elements within a user interface  Layout Elements (Panels):  Maintains a collection of child elements  Are responsible for sizing child elements  Are responsible for positioning child elements
  • 32. 1. Inherit from Panel (or anything else) 2. Implement MeasureOverride • Call Measure on each child 3. Implement ArrangeOverride • Call Arrange on each child
  • 33. public class CustomPanel : Panel { protected override Size MeasureOverride(Size availableSize) { foreach (UIElement child in InternalChildren) { child.Measure(availableSize); ... } } protected override Size ArrangeOverride(Size finalSize) { foreach (UIElement child in InternalChildren) { child.Arrange(...); ... } } }
  • 34. There are usually two reasons to create a custom panel: • Performance • Algorithmic Layout  Creating a new panel for performances reasons is a rare occurrence; but, for example the UniformGrid was created for performance reasons.  Algorithmic layout means a layout that is based on a algorithm as opposed to positional layout; for example, child elements positioned along a circular path.  To write a custom Panel inherit from Panel. WPF has a two phase model for layout, a measure and a arrange phase; the MeasureOverride and ArrangeOverride methods must be implemented. It is very important that in each phase you call the appropriate Measure and Arrange methods on each child; or it is very likely WPF will not render the child element.  A great example of custom panels can be found in “Kevin’s Bag-o-Tricks” by Kevin Moore : http://j832.com/bagotricks/

Notas del editor

  1. Panels are responsible for the layout of a collection of UIElement-derived children. When the Measure method is called on a panel, it must measure all its children. When the Arrange method is called on a panel, it then must arrange its children.
  2. The Grid layout panel positions child elements within rows and columns. By default there is only a single row and column in to which all elements are placed.Each child element is positioned within the grid by using attached properties:Grid.RowGrid.ColumnGrid.RowSpanGrid.ColumnSpan
  3. The Grid layout panel has two collections for managing rows and columns: RowDefinitions and ColumnsDefinitions respectively. The RowDefinitions collection is populated by using RowDefinition objects and theColumnsDefinitions collection is populated by using ColumnDefinition objects.The RowDefinition class defines a Height property of type GridLength and ColumnDefinition defines a Width property also of type GridLength. Combining these property values creates the layout for the grid. The GridLength class enable values beyond simple numbers to be assigned to the height and widths of rows and columns, values such as “Auto” and “*” can also be applied.Auto. The size is determined by the content.*. Uses all the available space to the panel, and is also used with “Star Sizing”, covered in the next topic.
  4. Transforms can be used throughout WPF to effect the size, shape and position of elements. A transform defines how to map points from one position to another position by using a transformation matrix. Applying the transformation matrix to certain values, depending on the transformation required, on a target object delivers the rotation, skew, scale, and move transformation effects. All transforms in WPF are affine transforms. An affine transform is a mathematical transformation that preserves parallel lines. All 2D transforms derive from System.Windows.Media.Transform class.ScaleTransform. Scales an object in the 2-D x-y coordinate system.TranslateTransform. Translates (moves) an object in the 2-D x-y coordinate system.SkewTransform. Skews an object in 2-D space.RotateTransform. Rotates an object clockwise about a specified point in a 2-D x-y coordinate system.TransformGroup. Transforms can be combined using a TransformGroup object.
  5. Any RenderTransform is applied immediately before rendering, therefore only having an impact on the rendering, as opposed to have an impact on layout.
  6. Any LayoutTransform is applied before layout, therefore affecting the layout of the FrameworkElement. Translate transforms are ignored in LayoutTransform.
  7. You can use the sample XAML file <install path>\\Module 03\\Demos\\Transforms\\TransformTypesExample.xaml to help with the demonstration.Show the impact of applying the transforms to the following properties:RenderTransformLayoutTransformYou can use the sample XAML file <install path>\\Module 03\\Demos\\Transforms\\TransformsExample.xaml to help with the demonstration.
  8. WPF contains several layout elements: Canvas, StackPanel, DockPanel, Grid, etc.
  9. There are usually two reasons to create a custom panel: Performance Algorithmic LayoutCreating a new panel for performances reasons is a rare occurrence; but, for example the UniformGrid was created for performance reasons.Algorithmic layout means a layout that is based on a algorithm as opposed to positional layout; for example, child elements positioned along a circular path.To write a custom Panel inherit from Panel. WPF has a two phase model for layout, a measure and a arrange phase; the MeasureOverride and ArrangeOverride methods must be implemented. It is very important that in each phase you call the appropriate Measure and Arrange methods on each child; or it is very likely WPF will not render the child element.A great example of custom panels can be found in “Kevin’s Bag-o-Tricks”, a whole host of WPF custom feature implementations, including panels, a great tool for learning how WPF works and how to extend it: http://j832.com/bagotricks/