Click here to Skip to main content
13,666,809 members

Silverlight / WPF

 
AnswerRe: Databind to a ListView or TreeView with an Observable Collection with several array properties Pin
Gerry Schmitz7-Oct-17 7:13
memberGerry Schmitz7-Oct-17 7:13 
AnswerRe: Databind to a ListView or TreeView with an Observable Collection with several array properties Pin
Mycroft Holmes7-Oct-17 15:07
professionalMycroft Holmes7-Oct-17 15:07 
QuestionGroup Box Visibility Pin
Mycroft Holmes3-Oct-17 21:50
professionalMycroft Holmes3-Oct-17 21:50 
AnswerRe: Group Box Visibility Pin
Gerry Schmitz4-Oct-17 6:29
memberGerry Schmitz4-Oct-17 6:29 
GeneralRe: Group Box Visibility Pin
Mycroft Holmes4-Oct-17 13:18
professionalMycroft Holmes4-Oct-17 13:18 
SuggestionRe: Group Box Visibility Pin
Richard Deeming4-Oct-17 9:21
mvpRichard Deeming4-Oct-17 9:21 
GeneralRe: Group Box Visibility Pin
Mycroft Holmes4-Oct-17 21:31
professionalMycroft Holmes4-Oct-17 21:31 
QuestionCreate Binding In View Model Code Pin
Kevin Marois21-Sep-17 7:08
professionalKevin Marois21-Sep-17 7:08 
I have a wizard. When page 1 is reached I get a UserControl from a list of MEF plugins and add it to the page.

The UserControl has a DP called IsValid on it. I want to bind this property to a property on the VM called IsDatabaseValid

Here's what I have
private void NextExecuted()
{
    CurrentPage = CurrentPage + 1;

    DatabaseSelectorControl = null;
    IDatabase control = null;

    switch (CurrentPage)
    {
        case 0:
            break;

        case 1:
            // Get the User Control from the plugins. Convert it from IDatabase to a user control
            control = ((App)Application.Current).DatabaseService.DBPlugins
                    .Where(x => x is UserControl && x.DatabaseType == SelectedDatabaseType.DatabaseType).FirstOrDefault();

            DatabaseSelectorControl = (DatabaseSelectorBase)control;
            break;
    }

    if (DatabaseSelectorControl != null)
    {
                Binding binding = new Binding();
                binding.Source = this;
                binding.Path = new PropertyPath("IsDatabaseValid");
                binding.Mode = BindingMode.TwoWay;
                binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
                BindingOperations.SetBinding(???, DatabaseSelectorControl.IsValid, binding); // This is the part I'm not sure of
    }

}

How do I create this binding?

Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: Create Binding In View Model Code Pin
Richard Deeming21-Sep-17 9:03
mvpRichard Deeming21-Sep-17 9:03 
GeneralRe: Create Binding In View Model Code Pin
Kevin Marois22-Sep-17 4:39
professionalKevin Marois22-Sep-17 4:39 
AnswerRe: Add Path To ItemsControl In Code Behind Pin
Pete O'Hanlon8-Sep-17 9:10
protectorPete O'Hanlon8-Sep-17 9:10 
GeneralRe: Add Path To ItemsControl In Code Behind Pin
Kevin Marois8-Sep-17 9:23
professionalKevin Marois8-Sep-17 9:23 
GeneralRe: Add Path To ItemsControl In Code Behind Pin
Pete O'Hanlon8-Sep-17 21:40
protectorPete O'Hanlon8-Sep-17 21:40 
QuestionLearning WPF Pin
Simon_Whale8-Sep-17 0:05
professionalSimon_Whale8-Sep-17 0:05 
AnswerRe: Learning WPF Pin
Richard MacCutchan8-Sep-17 5:17
protectorRichard MacCutchan8-Sep-17 5:17 
AnswerRe: Learning WPF Pin
Mycroft Holmes8-Sep-17 13:18
professionalMycroft Holmes8-Sep-17 13:18 
GeneralRe: Learning WPF Pin
Simon_Whale11-Sep-17 1:42
professionalSimon_Whale11-Sep-17 1:42 
QuestionShape Designer Pin
Kevin Marois23-Aug-17 6:47
professionalKevin Marois23-Aug-17 6:47 
AnswerRe: Shape Designer Pin
Gerry Schmitz23-Aug-17 7:06
memberGerry Schmitz23-Aug-17 7:06 
GeneralRe: Shape Designer Pin
Kevin Marois23-Aug-17 7:06
professionalKevin Marois23-Aug-17 7:06 
GeneralRe: Shape Designer Pin
Gerry Schmitz24-Aug-17 5:41
memberGerry Schmitz24-Aug-17 5:41 
GeneralRe: Shape Designer Pin
Kevin Marois24-Aug-17 5:42
professionalKevin Marois24-Aug-17 5:42 
GeneralRe: Shape Designer Pin
Gerry Schmitz24-Aug-17 6:07
memberGerry Schmitz24-Aug-17 6:07 
GeneralRe: Shape Designer Pin
Kevin Marois24-Aug-17 6:11
professionalKevin Marois24-Aug-17 6:11 
GeneralRe: Shape Designer Pin
Gerry Schmitz24-Aug-17 6:35
memberGerry Schmitz24-Aug-17 6:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web06-2016 | 2.8.180810.1 | Last Updated 8 Aug 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid