in Education by
I am working on WPF application.I have bound my textblock to my button. I want to set foreground of my textblock to black color when its associated button's isEnabled is true. I want to do this using converter. But its not working. also not giving any error. I have declared following class in my "Models" folder. public class BrushColorConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if ((bool)value) { { return System.Windows.Media.Colors.Black; } } return System.Windows.Media.Colors.LightGreen; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } Button's enable,isable property changes from viewmodel(e.g using RaiseCanExecuteChanged)()) textblock related things in XAML are: JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
use return new SolidColorBrush(Colors.Black);

Related questions

0 votes
    I am working on WPF application.I have bound my textblock to my button. I want to set foreground ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I have implemented a User Control in which I have bound the DataContext to itself like this... this. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I been receiving date in the "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" format from JSON input, which gets ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    Explain what is Converter in Backbone.js ?...
asked Nov 13, 2020 in Technology by JackTerrance
0 votes
    Top 10 Best FREE Online YouTube To MP4 Converter Tools...
asked Oct 27, 2020 in Technology by Editorial Staff
0 votes
    Top 10 FREE YouTube To MP3 Converter [Updated 2020]...
asked Oct 27, 2020 in Technology by Editorial Staff
0 votes
    When assigning a background color of a table cell on hover, the box shadow is covered. I have found ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    When assigning a background color of a table cell on hover, the box shadow is covered. I have found ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I have a Theme attribute that I can load like this: AeroTheme is a class. How can I achieve the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I'm totally new to Xamarin, so please be patient! Somehow Xamarin adds a mysterious Margin to all my ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    Is there a way, for the FlipView control, to ONLY have it load the selected item?? The default ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 10, 2022 in Education by JackTerrance
0 votes
    Is there a way, for the FlipView control, to ONLY have it load the selected item?? The default ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 5, 2022 in Education by JackTerrance
0 votes
    I have a Theme attribute that I can load like this: AeroTheme is a class. How can I achieve the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 5, 2022 in Education by JackTerrance
0 votes
    I want to add a single model object that has been instantiated once in XAML, and add it to two ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I have a ListBox that scrolls images horizontally. I have the following XAML I used blend to create it. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
...