Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Custom CommandParameter
Message
De
22/01/2010 21:35:09
 
 
À
22/01/2010 13:15:46
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01445153
Message ID:
01445595
Vues:
21
>>What class are TextBoxes bound to? Couldn't you just pass that class to the converter?
>
>With the MultiBinding approach they didn't need to be bound to anything - they were just supplying parameters for creating an object (i.e. no existing source). The converter was just throwing out a simple class to hold the parameters:
public class NewPaperParameters
>    {
>        public double Width { get; set; }
>        public double Height { get; set; }
>        public string Name { get; set; }
>    }
>I guess it would be possible to hold an instance of this as a StaticResource and bind the TextBoxes to it and then bind this instance to the Button.CommandParameter. But that would require just as much nous on the part of the designers (and I'm not sure it's doable anyway). I think I'm going to stick with modifying the VM but I'm not happy....

See my other reply. That's basically what I did. If the designer can't hack that I think you'll have to do the binding work for them. I'm not sure I see how modifying the VM would be simpler.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform