K
K
kulaeff2014-05-11 21:33:17
Windows
kulaeff, 2014-05-11 21:33:17

How to do multibinding in a Windows Phone 8.1 (WinRT) app

There is a code:

<ContentDialog
    x:Class="Balance.ContentDialogNewAccount"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Balance"
    DataContext="{Binding MainViewModel, Source={StaticResource Locator}}"    
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Title="NEW ACCOUNT"
    x:Uid="ContentDialogNewAccount"
    PrimaryButtonText="add"
    SecondaryButtonText="cancel"
    PrimaryButtonCommand="{Binding AddAcountCommand}">
    <ContentDialog.PrimaryButtonCommandParameter>
        <Binding ElementName="name" Path="Text" />
    </ContentDialog.PrimaryButtonCommandParameter>

    <StackPanel>
        <TextBox Name="name" Header="Name"/>
        <TextBox Name="balance" Header="Balance"/>

        <!-- Content body -->
        <TextBlock Style="{StaticResource MessageDialogContentStyle}" TextWrapping="Wrap" Text="Descrption of the page" Margin="0,20,0,0">
        </TextBlock>
    </StackPanel>
</ContentDialog>

I need to pass the values ​​of two textboxes to the PrimaryButtonCommandParameter, but there is no Multibinding in Windows Phone 8.1 (Runtime, not Silverlight). How can I do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Verbon, 2016-01-20
@Verbon

There is no built-in support for multibinding in Windows Phone 8.1, but you can use the NuGet package that provides most of the core WPF multibinding capabilities. Documentation can be found here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question