|
One more thing Kevin, and I apologise for not mentioning it. Setting IsHitTestVisible="false" on a container affects the children of the container as well. This is something to be very careful of because you can find that your hit testing doesn't behave quite the way you'd think it does by things higher up the tree. Here's a test for you to try:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="HitTester.MainWindow"
x:Name="Window"
Title="Hit testable window"
Width="788" Height="621">
<Canvas IsHitTestVisible="False">
<Button Content="Button" Width="75" IsHitTestVisible="True" />
</Canvas>
</Window>
|
|
|
|
|
Ok, will do. Thanks
Everything makes sense in someone's mind
|
|
|
|
|
I'm so glad POH gave you a sensible answer b/c the first thing that I thought of was if someone smacks you in the face and you react then you have been hittested. A number of other facetious replies also occurred to me but you get the point.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Actually, my first thought was to post that it was an online exam for assassins.
|
|
|
|
|
You've been spending too much time in the Lounge listening to JSOP (and others)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is the most Strangest error i have ever received from Silverlight. I have each control with its own name and i just added a Link button and a Menu item , i did a copy and paste of other items and renamed them from the xaml and i added a page that will be used by that menu item and i compiled the app and when i run it i get the following Error
Line: 54
Error: Unhandled Error in Silverlight Application
Code: 2028
Category: ParserError
Message: The name already exists in the tree: EchashDev.
File:
Line: 0
Position: 0
i tried googling and a lot of people are have different scenario which might be different from mine. I am not sure why Silverlight does not point to a problem element.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I believe you've added two components with the same name (or key).
A simple search within the code may give you an idea.
Also trying cleaning your solution once.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
thanks for your reply. It was a bit complicated than that, the problem is now resolved , here was a problem.
i Had two Projects, opened. i was doing my demo on one project , so they liked it and i copied some controls and paste from one project to another and it created a reference and now it means the control exists in two projects that are linked so it caused a Conflict.
When i was typing some namespaces , i realised that there were namespaces that i did not create and i looked at the name of the demo project and i realised that i could access its object from another class. So i went to the References in the solution explorer and there was a dead reference marked with an exclation mark and i knew it was it.
its a lesson , don't copy controls between projects unless you copy code.
I see there is a duplicate post , please delete it. i think it was created when i lost connection trying to post the question.
thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
modified on Friday, April 8, 2011 4:12 PM
|
|
|
|
|
We can't delete it, but you can. We'll leave it with no answers so you can remove it.
Good job on finding the solution.
|
|
|
|
|
Thank you , i just deleted the post.
kind Regards
Vuyiswa Maseko
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Thanks for posting the solution.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
You are Welcome
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
After programming WPF for sometime and reading so many articles[^] ... I'm still a little bit confused distinction between Logical and Visual Tree.
To simply put, my understanding is that Logical Tree is just a simplified version of Visual Tree! They are no different is just a way to confuse developers, they really should have one tree type - i.e. Visual Tree
And one additional property to let the guy decide if they need detail or not:
VisualTree.Mode = PresentationMode.Simple (i.e. LogicalTree) or PresentationMode.Complex (i.e. VisualTree)
Am I missing something here?
dev
|
|
|
|
|
You're missing quite a lot. While it may have been possible to combine the two types of trees, the resulting kludge would have been quite horrible.
Something that most people don't realise is that, while there is only one visual tree in a WPF application, there can be many logical trees. This is down to the purpose that they serve, and also covers the fact that the visual tree can only work with elements derived from Visual or Visual3D (hence it's name) while the logical tree can contain any type of object (and is one of the reasons that LogicalTreeHelper is not the most optimal way of walking the logical tree because it only walks DependencyObject elements. Without logical trees, it would be impossible for WPF/Silverlight to be able to use templates, for instance.
|
|
|
|
|
hi Peter, can you point me to a decent url? I been coding WPF for almost two years, didn't buy any book but did read quite numerous articles. Still in the dark.
thanks
dev
|
|
|
|
|
Josh Smith wrote an excellent article on the two. You can find it here[^].
|
|
|
|
|
I should have added that this is an excellent question - because the differences between the two are not very well explained in the documentation. Let me correct that voting oversight.
|
|
|
|
|
|
|
Sorry I read the article you suggested and still have so questions - I posted the question 1 here but nobody is picking up...[^]
Think you can have a quick look please?
dev
|
|
|
|
|
|
Good afternoon.
I have an WPF application with a grid consisting of two rows and two columns, containing players.
My problem is that I would change at runtime the layout of the grid. Such as leaving only one row and one column or two rows with a column...
From the code behind, I haven´t the ability to access or the colspan rowSpan ...
It is possible to do this functionality with the grid? or there is another control that allows me to change the arrangement of the players at runtime?
Thank you very much in advance
<Grid Name="MainGrid">
<Grid.RowDefinitions >
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<dbf:DbfPlayerUserControl x:Name="player1" Grid.Column="0" Grid.Row="0" ></dbf:DbfPlayerUserControl>
<dbf:DbfPlayerUserControl x:Name="player2" Grid.Column="1" Grid.Row="0" ></dbf:DbfPlayerUserControl>
<dbf:DbfPlayerUserControl x:Name="player3" Grid.Column="0" Grid.Row="1" ></dbf:DbfPlayerUserControl>
<dbf:DbfPlayerUserControl x:Name="player4" Grid.Column="1" Grid.Row="1" ></dbf:DbfPlayerUserControl>
</Grid>
|
|
|
|
|
You mean something like:
player1.SetValue(Grid.ColumnProperty,1);
|
|
|
|
|
myGrid.SetValue(Grid.RowSpanProperty, intSpan);
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Thank´s,
I think it might be a solution
|
|
|
|