Click here to Skip to main content
15,913,487 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How can I use Application Idle Event in WPF? Pin
Christian Graus28-Jun-09 23:32
protectorChristian Graus28-Jun-09 23:32 
GeneralRe: How can I use Application Idle Event in WPF? Pin
Kunal Chowdhury «IN»29-Jun-09 2:15
professionalKunal Chowdhury «IN»29-Jun-09 2:15 
GeneralRe: How can I use Application Idle Event in WPF? Pin
Ravi Mori29-Jun-09 2:40
Ravi Mori29-Jun-09 2:40 
GeneralRe: How can I use Application Idle Event in WPF? Pin
Kunal Chowdhury «IN»29-Jun-09 3:44
professionalKunal Chowdhury «IN»29-Jun-09 3:44 
GeneralRe: How can I use Application Idle Event in WPF? Pin
Kunal Chowdhury «IN»29-Jun-09 20:02
professionalKunal Chowdhury «IN»29-Jun-09 20:02 
NewsNeed some feed back on my new Silverlight articles Pin
ProtoBytes28-Jun-09 16:43
ProtoBytes28-Jun-09 16:43 
GeneralRe: Need some feed back on my new Silverlight articles Pin
ProtoBytes28-Jun-09 16:46
ProtoBytes28-Jun-09 16:46 
QuestionSilverlight 3 Offline Application from Notification Area Pin
nmreddy8328-Jun-09 8:11
nmreddy8328-Jun-09 8:11 
AnswerRe: Silverlight 3 Offline Application from Notification Area Pin
Mark Salsbery29-Jun-09 9:29
Mark Salsbery29-Jun-09 9:29 
GeneralRe: Silverlight 3 Offline Application from Notification Area Pin
nmreddy8329-Jun-09 12:24
nmreddy8329-Jun-09 12:24 
GeneralRe: Silverlight 3 Offline Application from Notification Area Pin
Mark Salsbery29-Jun-09 13:43
Mark Salsbery29-Jun-09 13:43 
GeneralRe: Silverlight 3 Offline Application from Notification Area Pin
Pete O'Hanlon29-Jun-09 21:35
mvePete O'Hanlon29-Jun-09 21:35 
QuestionWPF MediaElement to play a UDP Stream Pin
jklanka27-Jun-09 21:00
jklanka27-Jun-09 21:00 
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 

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.