WPF DialogHost

WPF DialogHost

 

Works with DialogHost calls such as: DialogHost.Show(new CurrencyView() { DataContext = _sessionVm }, "RootDialog");

These Accept and Close:

<Button Style="{StaticResource AcceptButtonStyle}" Margin="4" HorizontalAlignment="Left" Width="100">
    <Button.Command>
        <utilities:CompositeCommand>
            <utilities:CommandBindingPassThru CommandIdentifier="closeDialog"
                                              IsAlwaysEnabled="True"
                                              Command="{x:Static md:DialogHost.CloseDialogCommand}" />
            <utilities:CommandBindingPassThru CommandIdentifier="commitChanges"
                                              Command="{Binding Source={StaticResource Locator}, Path=SessionVM.AcceptCurrencyCommand}" />
        </utilities:CompositeCommand>
    </Button.Command>
</Button>
<Button Style="{StaticResource CancelButtonStyle}" Margin="4" HorizontalAlignment="Left" Width="100">
    <Button.Command>
        <utilities:CompositeCommand>
            <utilities:CommandBindingPassThru CommandIdentifier="closeDialog"
                                          IsAlwaysEnabled="True"
                                          Command="{x:Static md:DialogHost.CloseDialogCommand}" />
            <utilities:CommandBindingPassThru CommandIdentifier="revertChanges"
                                          Command="{Binding Source={StaticResource Locator}, Path=SessionVM.CancelCurrencyCommand}" />
        </utilities:CompositeCommand>
    </Button.Command>
</Button>

Comments

Popular posts from this blog

Upgrading to .NET8 from desktop versions 4.8.X

GHL Chat Bots for Webpage

GHL > Set website so shorter URL address