Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

What would be the best way to do the following in XAML?

 

<StackPanel

Grid.Row=IIF(Orientation="Portrait","2","1")

Grid.Column=IIF(Orientation="Portrait","0","2")

>

 

------------------------------------------------------------------------

 

At first I was thinking of using a ValueConverter but they do not seem to support multiple parameters. I guess passing both of the parameters in a single string such as "2|1" (which I would them split in my ValueConverter) would be bad practice, I was wondering could it be possible to do something like the following?

 

<StackPanel

Grid.Row="{Binding Orientation, ConverterParameter=[[new CustomClass(2,0)]], Converter={StaticResource OrientationToIntegerConverter}, ElementName=phoneApplicationPage}"

 

Grid.Column="{Binding Orientation, ConverterParameter=[[new CustomClass(1,2)]], Converter={StaticResource OrientationToIntegerConverter}, ElementName=phoneApplicationPage}"

>

Edited by JumpyNET

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...