Click here to Skip to main content
15,884,176 members
Home / Discussions / WPF
   

WPF

 
QuestionPerformance stymied by UIElement_CreateAutomationPeer Pin
Lee Reid16-Jul-11 14:01
Lee Reid16-Jul-11 14:01 
AnswerRe: Performance stymied by UIElement_CreateAutomationPeer [modified] Pin
SledgeHammer0118-Jul-11 10:20
SledgeHammer0118-Jul-11 10:20 
GeneralRe: Performance stymied by UIElement_CreateAutomationPeer Pin
Lee Reid18-Jul-11 16:40
Lee Reid18-Jul-11 16:40 
Questionwpf time picker control in vb.net Pin
prachi_sathep16-Jul-11 0:30
prachi_sathep16-Jul-11 0:30 
AnswerRe: wpf time picker control in vb.net Pin
Kim Breugelmans18-Jul-11 22:07
Kim Breugelmans18-Jul-11 22:07 
AnswerRe: wpf time picker control in vb.net Pin
Oludayo Alli16-Aug-11 2:29
Oludayo Alli16-Aug-11 2:29 
QuestionHow to enable wpf controls through data binding on a selected item from a combo box Pin
Member 297299215-Jul-11 4:20
Member 297299215-Jul-11 4:20 
AnswerRe: How to enable wpf controls through data binding on a selected item from a combo box [modified] Pin
Mark Salsbery15-Jul-11 6:11
Mark Salsbery15-Jul-11 6:11 
One way is to bind IsEnabled on the control(s) to the ComboBox SelectedIndex or SelectedItem property using a value converter[^] on the binding to convert the Selectedxxx value to a bool.

[System.Windows.Data.ValueConversion(typeof(int), typeof(bool))]
public class SelectedIndexToIsEnabledConverter : System.Windows.Data.IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return ((int)value >= 0) ? true : false;
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new System.NotImplementedException();
    }
}

    <UserControl.Resources >
        <local:SelectedIndexToIsEnabledConverter x:Key="SelectedIndexToIsEnabledConverter" />
    </UserControl.Resources>
...

Example binding:
    IsEnabled="{Binding Path=SelectedIndex,ElementName=comboBox1,Converter={StaticResource SelectedIndexToIsEnabledConverter},Mode=OneWay}" 

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]
modified on Friday, July 15, 2011 12:33 PM

QuestionGame algorithm problem Pin
Neo1010115-Jul-11 4:05
Neo1010115-Jul-11 4:05 
AnswerRe: Game algorithm problem Pin
Mark Salsbery15-Jul-11 6:41
Mark Salsbery15-Jul-11 6:41 
AnswerRe: Game algorithm problem Pin
Abhinav S15-Jul-11 6:51
Abhinav S15-Jul-11 6:51 
GeneralRe: Game algorithm problem Pin
Neo1010119-Jul-11 0:02
Neo1010119-Jul-11 0:02 
GeneralRe: Game algorithm problem Pin
Pete O'Hanlon19-Jul-11 1:46
mvePete O'Hanlon19-Jul-11 1:46 
GeneralRe: Game algorithm problem Pin
Neo101017-Nov-11 0:25
Neo101017-Nov-11 0:25 
QuestionWCF Async Call random response Pin
NTheOne13-Jul-11 18:01
NTheOne13-Jul-11 18:01 
AnswerRe: WCF Async Call random response Pin
Abhinav S13-Jul-11 20:36
Abhinav S13-Jul-11 20:36 
Questionvisualstudio/experssion blend Pin
arkiboys13-Jul-11 10:31
arkiboys13-Jul-11 10:31 
AnswerRe: visualstudio/experssion blend Pin
Mark Salsbery13-Jul-11 11:24
Mark Salsbery13-Jul-11 11:24 
AnswerRe: visualstudio/experssion blend Pin
Abhinav S13-Jul-11 20:37
Abhinav S13-Jul-11 20:37 
AnswerRe: visualstudio/experssion blend Pin
Kunal Chowdhury «IN»20-Jul-11 0:19
professionalKunal Chowdhury «IN»20-Jul-11 0:19 
AnswerRe: visualstudio/experssion blend Pin
Oludayo Alli20-Aug-11 7:15
Oludayo Alli20-Aug-11 7:15 
GeneralRe: visualstudio/experssion blend Pin
arkiboys20-Aug-11 7:20
arkiboys20-Aug-11 7:20 
GeneralRe: visualstudio/experssion blend Pin
Oludayo Alli20-Aug-11 8:39
Oludayo Alli20-Aug-11 8:39 
QuestionBind to converter in XAML Pin
_Madmatt13-Jul-11 9:54
_Madmatt13-Jul-11 9:54 
AnswerRe: Bind to converter in XAML [modified] Pin
Mark Salsbery13-Jul-11 11:27
Mark Salsbery13-Jul-11 11:27 

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.