SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Ähnlich wie WPF Line of Business Application XAML Layouts Presentation

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
 
03 layouts & ui design - Android
03   layouts & ui design - Android03   layouts & ui design - Android
03 layouts & ui design - AndroidWingston
 

Ähnlich wie WPF Line of Business Application XAML Layouts Presentation (20)

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
 
03 layouts & ui design - Android
03   layouts & ui design - Android03   layouts & ui design - Android
03 layouts & ui design - Android
 

Mehr von Our Community Exchange LLC

Mehr von 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
 

Kürzlich hochgeladen

Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdftbatkhuu1
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxjeswinjees
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfParomita Roy
 
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130Suhani Kapoor
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentationamedia6
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Delhi Call girls
 
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...Call Girls in Nagpur High Profile
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...Call Girls in Nagpur High Profile
 
Tapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the FunnelTapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the Funneljen_giacalone
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵anilsa9823
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...kumaririma588
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceanilsa9823
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfAmirYakdi
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girlsmodelanjalisharma4
 
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
 

Kürzlich hochgeladen (20)

Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptx
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
 
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentation
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
 
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
 
Tapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the FunnelTapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the Funnel
 
꧁❤ Hauz Khas Call Girls Service Hauz Khas Delhi ❤꧂ 9999965857 ☎️ Hard And Sex...
꧁❤ Hauz Khas Call Girls Service Hauz Khas Delhi ❤꧂ 9999965857 ☎️ Hard And Sex...꧁❤ Hauz Khas Call Girls Service Hauz Khas Delhi ❤꧂ 9999965857 ☎️ Hard And Sex...
꧁❤ Hauz Khas Call Girls Service Hauz Khas Delhi ❤꧂ 9999965857 ☎️ Hard And Sex...
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
 
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 ...
 

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/

Hinweis der Redaktion

  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/