Click here to Skip to main content
13,764,827 members

Silverlight / WPF

 
AnswerRe: Databind to a ListView or TreeView with an Observable Collection with several array properties Pin
Gerry Schmitz7-Oct-17 8:13
memberGerry Schmitz7-Oct-17 8:13 
AnswerRe: Databind to a ListView or TreeView with an Observable Collection with several array properties Pin
Mycroft Holmes7-Oct-17 16:07
memberMycroft Holmes7-Oct-17 16:07 
QuestionGroup Box Visibility Pin
Mycroft Holmes3-Oct-17 22:50
memberMycroft Holmes3-Oct-17 22:50 
AnswerRe: Group Box Visibility Pin
Gerry Schmitz4-Oct-17 7:29
memberGerry Schmitz4-Oct-17 7:29 
GeneralRe: Group Box Visibility Pin
Mycroft Holmes4-Oct-17 14:18
memberMycroft Holmes4-Oct-17 14:18 
SuggestionRe: Group Box Visibility Pin
Richard Deeming4-Oct-17 10:21
mvpRichard Deeming4-Oct-17 10:21 
GeneralRe: Group Box Visibility Pin
Mycroft Holmes4-Oct-17 22:31
memberMycroft Holmes4-Oct-17 22:31 
QuestionCreate Binding In View Model Code Pin
Kevin Marois21-Sep-17 8:08
professionalKevin Marois21-Sep-17 8: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 10:03
mvpRichard Deeming21-Sep-17 10:03 
GeneralRe: Create Binding In View Model Code Pin
Kevin Marois22-Sep-17 5:39
professionalKevin Marois22-Sep-17 5:39 
AnswerRe: Add Path To ItemsControl In Code Behind Pin
Pete O'Hanlon8-Sep-17 10:10
protectorPete O'Hanlon8-Sep-17 10:10 
GeneralRe: Add Path To ItemsControl In Code Behind Pin
Kevin Marois8-Sep-17 10:23
professionalKevin Marois8-Sep-17 10:23 
GeneralRe: Add Path To ItemsControl In Code Behind Pin
Pete O'Hanlon8-Sep-17 22:40
protectorPete O'Hanlon8-Sep-17 22:40 
QuestionLearning WPF Pin
Simon_Whale8-Sep-17 1:05
professionalSimon_Whale8-Sep-17 1:05 
AnswerRe: Learning WPF Pin
Richard MacCutchan8-Sep-17 6:17
protectorRichard MacCutchan8-Sep-17 6:17 
AnswerRe: Learning WPF Pin
Mycroft Holmes8-Sep-17 14:18
memberMycroft Holmes8-Sep-17 14:18 
GeneralRe: Learning WPF Pin
Simon_Whale11-Sep-17 2:42
professionalSimon_Whale11-Sep-17 2:42 
QuestionShape Designer Pin
Kevin Marois23-Aug-17 7:47
professionalKevin Marois23-Aug-17 7:47 
AnswerRe: Shape Designer Pin
Gerry Schmitz23-Aug-17 8:06
memberGerry Schmitz23-Aug-17 8:06 
GeneralRe: Shape Designer Pin
Kevin Marois23-Aug-17 8:06
professionalKevin Marois23-Aug-17 8:06 
GeneralRe: Shape Designer Pin
Gerry Schmitz24-Aug-17 6:41
memberGerry Schmitz24-Aug-17 6:41 
GeneralRe: Shape Designer Pin
Kevin Marois24-Aug-17 6:42
professionalKevin Marois24-Aug-17 6:42 
GeneralRe: Shape Designer Pin
Gerry Schmitz24-Aug-17 7:07
memberGerry Schmitz24-Aug-17 7:07 
GeneralRe: Shape Designer Pin
Kevin Marois24-Aug-17 7:11
professionalKevin Marois24-Aug-17 7:11 
GeneralRe: Shape Designer Pin
Gerry Schmitz24-Aug-17 7:35
memberGerry Schmitz24-Aug-17 7: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
Web01-2016 | 2.8.181114.1 | Last Updated 14 Nov 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid