How do I include the second binding? Where do the brackets and commas go?
There are five thousand examples that show how to do it in xml but nothing about how this should appear inline.
NOT THIS
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0:F1}{1:F1}">
<Binding Path="A" />
<Binding Path="B" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
THIS
<StackPanel Grid.Column="0"
Orientation="Vertical"
HorizontalAlignment="Left"
Visibility="{MultiBinding Converter={StaticResource multi_bool_vis_conv},
Bindings={Binding LabelFormat.HasLotMaskShiftCode}}">
I need to pass a second binding LabelFormat.HasSomeOtherCode. How do I include that second binding?
Assuming multi_bool_vis_conv
implements the interface IMultiValueConverter
and you handle the different parameters by indexing off of the value array, the binding should look like this:
<MultiBinding Converter="{StaticResource YourConverter}">
<Binding Path="YourProperty1"/>
<Binding Path="YourProperty2"/>
</MultiBinding>
I assume you want this on one line ("in-line") because you want to set the binding on the StackPanel's Visiblity property and your not sure how to do that in a multi-line way...
You can break it out like this:
<StackPanel>
<StackPanel.Visibility>
<MultiBinding Converter="{StaticResource YourConverter}">
<Binding Path="YourProperty1" />
<Binding Path="YourProperty2" />
</MultiBinding>
</StackPanel.Visibility>
</StackPanel>
The only other way I can see to do what you want is to roll your own StackPanel and include dependency properties for each of the bindings you want. You can then bind each of those on their own line and forgo a binding on the Visibility property all-together, instead opting to control the visibility in the code-behind of your custom control.