![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | ItemControl broken? When I run the following XAML, I get: - An exception; or - A infinite loop (100% CPU, no workingset delta) <ItemsControl Grid.Row="2" Margin="5,5,5,5" ItemsSource="{Binding Path=Attributes}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel> *** <Rectangle Height="100" Width="20" Fill="Red" /> </StackPanel> etc. Here is the wierd part: if I remove the <StackPanel> ***, it works fine. Any thoughts? |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: ItemControl broken? One thing I forgot to mention, is that XAMLPad runs it fine - works, no exceptions of CPU saturation. Wierd huh. -- Regards, Fil. |
My System Specs![]() |
| | #3 (permalink) |
| Guest | RE: ItemControl broken? OK, here is the really wierd part. This version works fine: <ItemsControl Grid.Row="2" Margin="5,0,5,5" ItemsSource="{Binding Path=Attributes}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Grid/> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> ... but if "<Grid/>" gets split out into "<Grid><Grid/>" then it breaks. For the record, under VS2005 there is an exception thrown: "Object reference not set to an instance of an object." at - public static void Main() { System.Threading.Thread.CurrentThread.SetApartmentState(System.Threading.ApartmentState.STA); XmlViewer2.MyApp app = new XmlViewer2.MyApp(); app.InitializeComponent(); app.Run(); // <== exception thrown here } ... not very helpful. All forms work under XAMLPad, but they dont under EID - due to other necessary parts of the XAML that the designer can't handle at this stage. |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: ItemControl broken? ummm... do you mean <grid></grid> and not <grid><grid/>? The latter leaves an unclosed <grid> tag. "Fil Mackay" <FilMackay@discussions.microsoft.com> wrote in message news:85B11D46-30C7-4557-88D7-3046BFFA206D@microsoft.com... > OK, here is the really wierd part. This version works fine: > > <ItemsControl Grid.Row="2" Margin="5,0,5,5" > ItemsSource="{Binding Path=Attributes}"> > <ItemsControl.ItemsPanel> > <ItemsPanelTemplate> > <StackPanel Orientation="Vertical" /> > </ItemsPanelTemplate> > </ItemsControl.ItemsPanel> > <ItemsControl.ItemTemplate> > <DataTemplate> > <Grid/> > </DataTemplate> > </ItemsControl.ItemTemplate> > </ItemsControl> > > .. but if "<Grid/>" gets split out into "<Grid><Grid/>" then it breaks. > For > the record, under VS2005 there is an exception thrown: "Object reference > not > set to an instance of an object." at - > > public static void Main() { > > System.Threading.Thread.CurrentThread.SetApartmentState(System.Threading.ApartmentState.STA); > XmlViewer2.MyApp app = new XmlViewer2.MyApp(); > app.InitializeComponent(); > app.Run(); // <== exception thrown here > } > > .. not very helpful. > > All forms work under XAMLPad, but they dont under EID - due to other > necessary parts of the XAML that the designer can't handle at this stage. > |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: ItemControl broken? "Winthrop Chan" wrote: > ummm... do you mean <grid></grid> and not <grid><grid/>? The latter leaves > an unclosed <grid> tag. Errk.. um.. yes. (it did parse both times ![]() |
My System Specs![]() |
| | #6 (permalink) |
| Guest | Re: ItemControl broken? I had the exact same behavior while replacing the ItemsPanel on a StackPanel... The syntaxt thing about where the / goes is not relevant in this case however... In my case, I received an error indicating that the DataTemplate could only have one child... When I tried out of the blue to put <WrapPanel />, it started working... I am wondering if it could not mean that the space between <WrapPanel> and <WrapPanel> is somehow interpretted for the ItemTemplate as a "Children"(Children is the default content property for the Panel classes) element while nothing is assigned to the "content" when <WrapPanel /> notation is used (this is a wild guess, and your opinion is welcomed)... Marcus |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lots of problems - regedit is broken, taskbar is misbehaving, audio is broken.. HELP! | Elspeth | Vista General | 3 | 07-02-2008 05:19 PM |
| SP1 seems to have broken WMP 11 | David | Vista General | 19 | 05-27-2008 06:50 PM |
| ICS is Broken | Brad | Vista General | 1 | 03-26-2008 01:26 PM |
| IE7 and WMP Broken! | Ray | Vista performance & maintenance | 0 | 06-09-2007 01:53 PM |
| broken icons | Rodolfo | Vista General | 4 | 04-11-2007 04:22 PM |