HiveBrain v1.2.0
Get Started
← Back to all entries
patterncsharpMinor

Is this a good user control layout for WPF?

Submitted by: @import:stackexchange-codereview··
0
Viewed 0 times
thiscontroluserwpflayoutforgood

Problem

Below is a code snippet of how I have been laying out my WPF control XAML. I do it mainly because I get intellisense in the editor and I can change the implementation of the viewmodel and push the layout into a resource file.

However, I am not sure whether you gurus have a better insight into why I should not do this?

I'm just after a critique really.


    
        
    

    

        
            
                
                
                
                
            

            
                
                
            

            

            

            

            

            
                
                
            
        
    

Solution

There are 2 things that I could critisize on your code with the information you gave us:

  • Don't load style resources inside the usercontrol. Let the application hold control over how to style a usercontrol



  • Try not to use a grid in this context, because it prevents the control from adopting itself to new sizes of the window. StackPanels and Dockpanel are much better for this

Context

StackExchange Code Review Q#36691, answer score: 3

Revisions (0)

No revisions yet.