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

WPF

 
GeneralRe: WPF Image Uploading Pin
Chris Ivey12-Jun-09 11:33
Chris Ivey12-Jun-09 11:33 
GeneralRe: WPF Image Uploading Pin
Mark Salsbery12-Jun-09 11:42
Mark Salsbery12-Jun-09 11:42 
GeneralRe: WPF Image Uploading Pin
Chris Ivey12-Jun-09 12:23
Chris Ivey12-Jun-09 12:23 
GeneralRe: WPF Image Uploading Pin
Mark Salsbery12-Jun-09 12:28
Mark Salsbery12-Jun-09 12:28 
GeneralRe: WPF Image Uploading Pin
Chris Ivey12-Jun-09 12:42
Chris Ivey12-Jun-09 12:42 
GeneralRe: WPF Image Uploading Pin
Christian Graus12-Jun-09 13:27
protectorChristian Graus12-Jun-09 13:27 
GeneralRe: WPF Image Uploading Pin
Chris Ivey15-Jun-09 4:32
Chris Ivey15-Jun-09 4:32 
QuestionBinding IsChecked to AncestorType problem Pin
DavidRen2312-Jun-09 0:40
DavidRen2312-Jun-09 0:40 
I would like to bind a MenuItem.IsChecked property to another using the FindAncestor approach.   The problem I have is that the binding fails since the MenuItem is not in the same visual tree as it's ancestor due to (I think) the way it is created.

See http://munkiisoft.com/blog/archive/2007/02/01/binding-contextmenu-to-its-logical-parent.aspx as an example however my problem cannot be solved using this approach sine the ancestor is not the PlacementTarget.

Any ideas in how to how I can achieve this without I guess creating my own markup extension??????

Just in case the Xaml is shown below, nothing (I think again) is wrong here.

<MenuItem IsCheckable="True" x:Name="verticalRuler" Header="Vertical ruler" IsChecked="{Binding Path=VerticalRulerVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type demo:demoBox}}, Mode=TwoWay}"/>

The error:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Demo.DemoBox', AncestorLevel='1''. BindingExpression:Path=VerticalRulerVisible; DataItem=null; target element is 'MenuItem' (Name=verticalRuler); target property is 'IsChecked' (type 'Boolean')

Thanks in advance. . .
AnswerRe: Binding IsChecked to AncestorType problem Pin
Pete O'Hanlon12-Jun-09 2:10
mvePete O'Hanlon12-Jun-09 2:10 
GeneralRe: Binding IsChecked to AncestorType problem Pin
DavidRen2312-Jun-09 3:24
DavidRen2312-Jun-09 3:24 
GeneralRe: Binding IsChecked to AncestorType problem Pin
Pete O'Hanlon12-Jun-09 3:55
mvePete O'Hanlon12-Jun-09 3:55 
AnswerRe: Binding IsChecked to AncestorType problem Pin
ABitSmart12-Jun-09 4:41
ABitSmart12-Jun-09 4:41 
GeneralRe: Binding IsChecked to AncestorType problem Pin
DavidRen2312-Jun-09 5:06
DavidRen2312-Jun-09 5:06 
QuestionHow to get space between the items in stack panel Pin
Nekkantidivya11-Jun-09 18:37
Nekkantidivya11-Jun-09 18:37 
AnswerRe: How to get space between the items in stack panel Pin
ABitSmart11-Jun-09 19:31
ABitSmart11-Jun-09 19:31 
QuestionHeight Property Appears Frozen Pin
#realJSOP11-Jun-09 6:40
professional#realJSOP11-Jun-09 6:40 
AnswerRe: Height Property Appears Frozen Pin
Mark Salsbery11-Jun-09 10:41
Mark Salsbery11-Jun-09 10:41 
GeneralRe: Height Property Appears Frozen Pin
#realJSOP11-Jun-09 10:48
professional#realJSOP11-Jun-09 10:48 
GeneralRe: Height Property Appears Frozen Pin
#realJSOP11-Jun-09 10:51
professional#realJSOP11-Jun-09 10:51 
AnswerRe: Height Property Appears Frozen Pin
Christian Graus11-Jun-09 17:42
protectorChristian Graus11-Jun-09 17:42 
GeneralRe: Height Property Appears Frozen Pin
#realJSOP11-Jun-09 23:26
professional#realJSOP11-Jun-09 23:26 
GeneralRe: Height Property Appears Frozen Pin
Christian Graus12-Jun-09 0:05
protectorChristian Graus12-Jun-09 0:05 
GeneralRe: Height Property Appears Frozen Pin
#realJSOP12-Jun-09 3:01
professional#realJSOP12-Jun-09 3:01 
GeneralRe: Height Property Appears Frozen Pin
Christian Graus12-Jun-09 12:04
protectorChristian Graus12-Jun-09 12:04 
GeneralRe: Height Property Appears Frozen Pin
#realJSOP13-Jun-09 4:50
professional#realJSOP13-Jun-09 4:50 

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.