Click here to Skip to main content
15,174,232 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: ResourceDictionary swapped at run-time only applies to MainWindow Pin
Richard Deeming5-Aug-16 8:02
mveRichard Deeming5-Aug-16 8:02 
GeneralRe: ResourceDictionary swapped at run-time only applies to MainWindow Pin
James A. Young5-Aug-16 8:18
MemberJames A. Young5-Aug-16 8:18 
QuestionKeepTextBoxDisplaySynchronizedWithTextProperty Pin
Kevin Marois28-Jul-16 8:18
professionalKevin Marois28-Jul-16 8:18 
AnswerRe: KeepTextBoxDisplaySynchronizedWithTextProperty Pin
Matt T Heffron28-Jul-16 8:33
professionalMatt T Heffron28-Jul-16 8:33 
GeneralRe: KeepTextBoxDisplaySynchronizedWithTextProperty Pin
Kevin Marois28-Jul-16 8:39
professionalKevin Marois28-Jul-16 8:39 
QuestionCreating a line break to keep visible tabitems from wrapping when other tabitems become visible. Pin
holdorf28-Jul-16 4:16
Memberholdorf28-Jul-16 4:16 
AnswerRe: Creating a line break to keep visible tabitems from wrapping when other tabitems become visible. Pin
holdorf28-Jul-16 15:41
Memberholdorf28-Jul-16 15:41 
QuestionDP not Working Pin
Kevin Marois27-Jul-16 9:01
professionalKevin Marois27-Jul-16 9:01 
This is a very simple example, and I can't get it to work

My UserControl
<Grid>
    <Border>
        <TextBlock Text="{Binding DayNameCaption}"
                    Background="Green"
                    Foreground="White"
                    Height="25"
                    Width="75"/>
    </Border>
</Grid>

Code Behind
public partial class MonthViewDayColumnHeader : UserControl
{
    #region DP DayName
    public static readonly DependencyProperty DayNameCaptionProperty =
        DependencyProperty.Register("DayNameCaption",
            typeof(string),
            typeof(MonthViewDayColumnHeader),
            new PropertyMetadata("Today", 
            new PropertyChangedCallback(OnDayNameCaptionChanged), 
            new CoerceValueCallback(CoerceDayNameCaption)));

    public string DayNameCaption
    {
        get { return (string)GetValue(DayNameCaptionProperty); }
        set { SetValue(DayNameCaptionProperty, value); }
    }

    private static void OnDayNameCaptionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        MonthViewDayColumnHeader control = (MonthViewDayColumnHeader)d;
        var dayNameCaption = control.DayNameCaption;  // dayNameCaption is null
    }

    private static object CoerceDayNameCaption(DependencyObject d, object value)
    {
        MonthViewDayColumnHeader control = (MonthViewDayColumnHeader)d;
        var dayNameCaption = control.DayNameCaption;   // dayNameCaption is 'Today', the default value
        return null;
    }
    #endregion

    #region CTOR
    public MonthViewDayColumnHeader()
    {
        InitializeComponent();

        this.DataContext = this;
    }
    #endregion
}

Usage:
<Grid>
    <schedule:MonthViewDayColumnHeader DayNameCaption="Monday" 
                                        Height="50"
                                        Width="120"/>
</Grid>

The text "Monday" doesn't show up.

WTF IS WRONG HERE!!!!
If it's not broken, fix it until it is

AnswerRe: DP not Working Pin
Gerry Schmitz27-Jul-16 16:44
mveGerry Schmitz27-Jul-16 16:44 
GeneralRe: DP not Working Pin
Kevin Marois27-Jul-16 17:38
professionalKevin Marois27-Jul-16 17:38 
AnswerRe: DP not Working Pin
PureNsanity28-Jul-16 13:50
professionalPureNsanity28-Jul-16 13:50 
GeneralRe: DP not Working Pin
Kevin Marois28-Jul-16 14:29
professionalKevin Marois28-Jul-16 14:29 
GeneralRe: DP not Working Pin
PureNsanity28-Jul-16 14:51
professionalPureNsanity28-Jul-16 14:51 
GeneralRe: DP not Working Pin
Kevin Marois28-Jul-16 15:14
professionalKevin Marois28-Jul-16 15:14 
SuggestionRe: DP not Working Pin
Richard Deeming29-Jul-16 3:11
mveRichard Deeming29-Jul-16 3:11 
GeneralRe: DP not Working Pin
Richard Deeming29-Jul-16 3:12
mveRichard Deeming29-Jul-16 3:12 
GeneralRe: DP not Working Pin
PureNsanity29-Jul-16 4:47
professionalPureNsanity29-Jul-16 4:47 
AnswerRe: DP not Working Pin
Meshack Musundi2-Aug-16 23:33
professionalMeshack Musundi2-Aug-16 23:33 
QuestionScrolling data table area on a XAML page Pin
holdorf26-Jul-16 14:41
Memberholdorf26-Jul-16 14:41 
AnswerRe: Scrolling data table area on a XAML page Pin
Mycroft Holmes26-Jul-16 15:32
professionalMycroft Holmes26-Jul-16 15:32 
GeneralRe: Scrolling data table area on a XAML page Pin
holdorf27-Jul-16 1:31
Memberholdorf27-Jul-16 1:31 
GeneralRe: Scrolling data table area on a XAML page Pin
Mycroft Holmes27-Jul-16 13:44
professionalMycroft Holmes27-Jul-16 13:44 
QuestionWhere to call OnPropertyChanged Pin
Bernhard Hiller25-Jul-16 22:47
MemberBernhard Hiller25-Jul-16 22:47 
AnswerRe: Where to call OnPropertyChanged Pin
Gerry Schmitz26-Jul-16 4:47
mveGerry Schmitz26-Jul-16 4:47 
QuestionEnter key invokes button click Pin
GrooverFromHolland23-Jul-16 10:44
MemberGrooverFromHolland23-Jul-16 10:44 

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.