![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | How to access Parent Element of the ItemsControl's Panel? Here is the situation: I have created an overloaded Canvas object as an external assembly. Now I use it as a panel object in ItemsControl: <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:Custom="clr-namespace:CustomNamespace" Stretch="Fill"> <ItemsControl> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Custom:CustomCanvas/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> ........ </Viewbox> How can I access that ItemsControl object from my assembly. Thing is that I define some resources on ItemsControl and I want to use them in my Canvas Assebmly C# code. On runtime the CustomCanvas has Parent property set to null, so I'm really interested almost all the day how to get that damn parent. I will really appreciate your help with that. Anton |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: How to access Parent Element of the ItemsControl's Panel? Hi Anton, Parent refers to the logical tree. Perhaps try checking the visual tree using the VisualTreeHelper.GetParent method. -- Bill Henning Actipro Software WPF Wizard Control - http://www.actiprosoftware.com/Produ...d/Default.aspx "Anton" <akhodakivskiy@gmail.com> wrote in message news:1169585562.903229.58600@j27g2000cwj.googlegroups.com... > Here is the situation: I have created an overloaded Canvas object as an > external assembly. > Now I use it as a panel object in ItemsControl: > > <Viewbox > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" > xmlns:Custom="clr-namespace:CustomNamespace" > Stretch="Fill"> > <ItemsControl> > <ItemsControl.ItemsPanel> > <ItemsPanelTemplate> > <Custom:CustomCanvas/> > </ItemsPanelTemplate> > </ItemsControl.ItemsPanel> > </ItemsControl> > ....... > </Viewbox> > > How can I access that ItemsControl object from my assembly. Thing is > that I define some resources on ItemsControl and I want to use them in > my Canvas Assebmly C# code. On runtime the CustomCanvas has Parent > property set to null, so I'm really interested almost all the day how > to get that damn parent. > > I will really appreciate your help with that. > Anton > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: How to access Parent Element of the ItemsControl's Panel? Hi Anton, Parent refers to the logical tree. Perhaps try checking the visual tree using the VisualTreeHelper.GetParent method. -- Bill Henning Actipro Software WPF Wizard Control - http://www.actiprosoftware.com/Produ...d/Default.aspx "Anton" <akhodakivskiy@gmail.com> wrote in message news:1169585562.903229.58600@j27g2000cwj.googlegroups.com... > Here is the situation: I have created an overloaded Canvas object as an > external assembly. > Now I use it as a panel object in ItemsControl: > > <Viewbox > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" > xmlns:Custom="clr-namespace:CustomNamespace" > Stretch="Fill"> > <ItemsControl> > <ItemsControl.ItemsPanel> > <ItemsPanelTemplate> > <Custom:CustomCanvas/> > </ItemsPanelTemplate> > </ItemsControl.ItemsPanel> > </ItemsControl> > ....... > </Viewbox> > > How can I access that ItemsControl object from my assembly. Thing is > that I define some resources on ItemsControl and I want to use them in > my Canvas Assebmly C# code. On runtime the CustomCanvas has Parent > property set to null, so I'm really interested almost all the day how > to get that damn parent. > > I will really appreciate your help with that. > Anton > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: How to access Parent Element of the ItemsControl's Panel? TemplatedParent lets you access the itemspresenter, which should give you access to the itemscontrol via parent or templatedparent. if you don't expect things to change much, use visualtreehelper. Florian Bill Henning wrote: > Hi Anton, > > Parent refers to the logical tree. Perhaps try checking the visual tree > using the VisualTreeHelper.GetParent method. > |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: How to access Parent Element of the ItemsControl's Panel? TemplatedParent lets you access the itemspresenter, which should give you access to the itemscontrol via parent or templatedparent. if you don't expect things to change much, use visualtreehelper. Florian Bill Henning wrote: > Hi Anton, > > Parent refers to the logical tree. Perhaps try checking the visual tree > using the VisualTreeHelper.GetParent method. > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cannot access control panel | rebwriter | General Discussion | 3 | 07-15-2008 12:45 AM |
| Control Panel access | jamien59 | Vista General | 7 | 09-30-2007 06:21 PM |
| Unable to Access Control Panel | Si | Vista General | 2 | 09-16-2007 07:25 PM |
| Control Panel Access | Roger Jackson | Vista performance & maintenance | 1 | 07-21-2007 12:14 AM |
| UAC and Control Panel access problem | bramthorn | Vista security | 0 | 02-05-2007 04:21 AM |