Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

How to access Parent Element of the ItemsControl's Panel?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-23-2007   #1 (permalink)
Anton
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 SpecsSystem Spec
Old 01-24-2007   #2 (permalink)
Bill Henning
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 SpecsSystem Spec
Old 01-24-2007   #3 (permalink)
Bill Henning
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 SpecsSystem Spec
Old 01-25-2007   #4 (permalink)
Florian Kruesch
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 SpecsSystem Spec
Old 01-25-2007   #5 (permalink)
Florian Kruesch
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 SpecsSystem Spec
Closed Thread

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


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51