Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does design time and runtime size differ?
Message
De
28/10/2009 18:57:43
 
 
À
28/10/2009 04:31:08
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Divers
Thread ID:
01431413
Message ID:
01432135
Vues:
43
>
>Again - I suggest you try working using something other than a Grid as the top-level container.

How would I do that? I am using VS and this grid is what is created when I opt for a new WPF project.

> The XAML you are using is not something that would commonly be used - the Grid has no Rows or Columns defined and the positioning of each control in the entire form is solely governed by it's own Alignment and Margin settings

Common or not, this is what VS generates for me, not, as I have already explained many many times, my XAML. Are you saying that when I want to create a new WPF project in VS, it generates code that is NOT commonly used?

This is what I cannot understand.

I am not using the GRID as a preference but VS is creating the code for me
I am not generating this XAML that is not commonly used. VS is doing that for me when I add any object.
I am not explicitly setting the width/height of anything. VS is doing that for me.

All I am trying to do is design a simple form visually, and have it look the same at design and run time.


and, I agree, working out how the interaction between these two affects the final positioning and size of a UIElement is not the simplest part of XAML
>
>If you really want to exactly control the positioning and size of every object then use a Canvas instead of a Grid - but that would defeat the whole point of using the WPF UI.....

I will have to read up on Canvas.

Bernard
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform