Click here to Skip to main content
15,899,935 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF MediaElement to play a UDP Stream Pin
Christian Graus28-Jun-09 10:33
protectorChristian Graus28-Jun-09 10:33 
QuestionTo design a screen dynamically at runtime using WPF 2008,C# Pin
cbe_pav27-Jun-09 3:13
cbe_pav27-Jun-09 3:13 
AnswerRe: To design a screen dynamically at runtime using WPF 2008,C# Pin
Mark Salsbery27-Jun-09 8:37
Mark Salsbery27-Jun-09 8:37 
GeneralRe: To design a screen dynamically at runtime using WPF 2008,C# Pin
cbe_pav29-Jun-09 0:12
cbe_pav29-Jun-09 0:12 
QuestionAmbiguous Match Found [SOLVED] Pin
#realJSOP26-Jun-09 6:17
professional#realJSOP26-Jun-09 6:17 
AnswerRe: Ambiguous Match Found Pin
Pete O'Hanlon26-Jun-09 9:55
mvePete O'Hanlon26-Jun-09 9:55 
GeneralRe: Ambiguous Match Found Pin
#realJSOP26-Jun-09 15:38
professional#realJSOP26-Jun-09 15:38 
QuestionSetting Label.Content via attached property [SOLVED] Pin
#realJSOP26-Jun-09 5:01
professional#realJSOP26-Jun-09 5:01 
I have the following line in a XAML style:

<Setter Property="udpcontrols:UDPTelerikGridView.TitleTextContent" Value="Search Results" />


In the custom control class, the attached property is defined like so:

//--------------------------------------------------------------------------------
public static readonly DependencyProperty TitleTextContentProperty = 
                       DependencyProperty.RegisterAttached("TitleTextContent", 
                                                           typeof(ContentControl), 
                                                           typeof(UDPTelerikGridView));

public static void SetTitleTextContent(UIElement element, ContentControl value)
{
	element.SetValue(TitleTextContentProperty, value);
}

public static ContentControl GetTitleTextContent(UIElement element)
{
	return (ContentControl)element.GetValue(TitleTextContentProperty);
}


And I have this code in the OnApplyTemplate method:

Label titleText = base.GetTemplateChild("PART_Title") as Label;
if (titleText != null)
{
	titleText.Content    = GetTitleTextContent(this);
}


The WPF designer is telling me this:

Error 2 - 'Search Results' is not a valid value for the 'Comet.UDPControls.UDPTelerikGridView.TitleTextContent' property on a Setter.

I'm off to google (yet again), but I thought I'd post this in advance. Anyone have any ideas?

========================

Solution - I changed the attached property type from ContentControl to object.


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


modified on Saturday, June 27, 2009 9:43 AM

AnswerRe: Setting Label.Content via attached property Pin
Gideon Engelberth26-Jun-09 9:49
Gideon Engelberth26-Jun-09 9:49 
GeneralRe: Setting Label.Content via attached property Pin
#realJSOP26-Jun-09 15:42
professional#realJSOP26-Jun-09 15:42 
GeneralRe: Setting Label.Content via attached property Pin
Gideon Engelberth26-Jun-09 15:56
Gideon Engelberth26-Jun-09 15:56 
GeneralRe: Setting Label.Content via attached property Pin
#realJSOP26-Jun-09 23:57
professional#realJSOP26-Jun-09 23:57 
QuestionApply Css for Silverlight controls Pin
pavanip25-Jun-09 1:11
pavanip25-Jun-09 1:11 
AnswerRe: Apply Css for Silverlight controls Pin
Mark Salsbery29-Jun-09 9:31
Mark Salsbery29-Jun-09 9:31 
AnswerRe: Apply Css for Silverlight controls Pin
Jeremy Likness1-Jul-09 8:40
professionalJeremy Likness1-Jul-09 8:40 
AnswerRe: Apply Css for Silverlight controls Pin
PumbaPumba21-Feb-11 0:33
PumbaPumba21-Feb-11 0:33 
QuestionConditional XAML Pin
krishnan.s24-Jun-09 22:01
krishnan.s24-Jun-09 22:01 
AnswerRe: Conditional XAML Pin
ABitSmart24-Jun-09 22:10
ABitSmart24-Jun-09 22:10 
QuestionWPF Toolkit DatePicker/Calender issue Pin
bonkers12324-Jun-09 21:26
bonkers12324-Jun-09 21:26 
AnswerRe: WPF Toolkit DatePicker/Calender issue Pin
bonkers12324-Jun-09 22:58
bonkers12324-Jun-09 22:58 
GeneralRe: WPF Toolkit DatePicker/Calender issue Pin
bonkers12325-Jun-09 1:40
bonkers12325-Jun-09 1:40 
GeneralRe: WPF Toolkit DatePicker/Calender issue Pin
Member 342384716-Nov-09 9:29
Member 342384716-Nov-09 9:29 
GeneralRe: WPF Toolkit DatePicker/Calender issue Pin
bonkers12323-Nov-09 0:20
bonkers12323-Nov-09 0:20 
GeneralRe: WPF Toolkit DatePicker/Calender issue Pin
Jimmy Carter23-Dec-09 9:57
Jimmy Carter23-Dec-09 9:57 
GeneralRe: WPF Toolkit DatePicker/Calender issue Pin
bonkers12312-Jan-10 2:07
bonkers12312-Jan-10 2:07 

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.