|
Christian Graus wrote: You should use ActualWidth if it exists, rather than width.
ColumnDefinition.Width is not the same as UIElement.Width. The latter is a double, the former is a GridLength and doesn't work the same way as a UIElement.Width. You can't use ActualWidth to solve this problem.
Christian Graus wrote: The preview events always fire, but the non preview events may not fire if something further up the tree consumes the event. Upshot is, I typically use the preview events only.
As I explained above, this is because a tunneling event is needed here, i.e. a Preview event.
|
|
|
|
|
fjparisIII wrote: BTW, I never did get my answer on how to save a lossless rotation of a JPEG. This may be impossible with WPF (you probably could do it in that nightmarish WIC). Looks like I'm going to have to stoop to using the GDI+ .NET classes.
Well, if you read my blog, http://thingsihateaboutmicrosoft.blogspot.com/2009/06/wpf-destroys-images-when-resizing-them.html[^], I started my blog b/c you reminded me of that WPF resizing image bug. If they can't fix that, they are not going to add the sort of thing you wanted to do....
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
If I define a namespace (xmlns) in app.xaml, does the whole application assembly see it, or do I have to redefine it in each xaml file from which I wish to use it?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
No. An XML namespaces binding scope is limited to the tag where they were defined[^]. I don't know whether XAML is XML v1.0 or v1.1 but a namespace binding attribute value cannot be empty.
And the first binding up the tree from where you use it is the one applied.
<StackPanel>
<Grid xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Grid.Resources>
<sys:Int32 x:Key="i">
6
</sys:Int32>
</Grid.Resources>
</Grid> <!-- mscorelib binding scope ends here -->
<Grid xmlns:sys="clr-namespace:System;assembly=System">
<Grid.Resources>
<sys:Uri x:Key="uri">
http:
</sys:Uri>
</Grid.Resources>
<Grid xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Grid.Resources>
<sys:Byte x:Key="b"> <!-- The binding used is mscorlib's -->
8
</sys:Byte>
</Grid.Resources>
</Grid>
</Grid>
</StackPanel>
There seems to be a problem displaying the code. Solved, the encode HTML option was disabled
Eslam Afifi
modified on Friday, June 19, 2009 12:50 PM
|
|
|
|
|
That would make sense, right ? I'd also like to be able to define resources in one place and have them included through the project.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Now you're just talking crazy...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Christian Graus wrote: That would make sense, right ?
No. You don't define namespaces in XAML.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am right in thinking you are refering to defining a namespace for e.g. a bunch of controls, and you wish to reference those controls in xaml using a (Xml) namespace rather than by code namespace and assembly, as in the example below (controls vs scm)
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
xmlns:controls="http://schemas.xxx.com/wpf/xaml/controls">
To create your own (xml) namespace defintion, just done something like the following in you AssemblyInfo file
[assembly: XmlnsDefinition("http://schemas.xxx.com/wpf/xaml/controls", "xxx.Common.Controls")]
[assembly: XmlnsPrefix("http://schemas.xxx.com/wpf/xaml/controls", "controls")]
You can then use the xmlns definition in any xaml files that reference your controls project, but unfortunately, you can not use the xmlns defintition withn the project, eg. in a Resource dictionary within the project, which is understandable, but disappointing.
|
|
|
|
|
I have to write an web browser application in WPF having database. I want to know if there are good sample database applications. I am looking for something like the sample on Microsoft SQL. I need all the basic functionality expected on line of business applications like master/detail or at least a similar functionality. Someone could please help me!
|
|
|
|
|
A SQL database isn't implimented any differently in WPF, compared to a winforms app. I need to know tho, why does your 'web browser application' need a database ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Christian Graus wrote: I need to know tho, why does your 'web browser application' need a database ?
So he can properly catalog his inabilities.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i need database because i want to store data from user and show the data to the user on demand
|
|
|
|
|
What data ? Why ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I have problem that the database created in WPF web browser application cant open.It provides an error.
The following code is written in the page2.xaml.vb under the event button1_click of button1
imports system.data
imports syste.data.sqlclient
dim sqlconnection1 as new sqlconnection(my.settings.database1connectionstring)
dim dr as sqldatareader
dim sqlcommand1 as sqlcommand
try
sqlconnection1.open()
sqlcommand1=new sqlcommand("select FirstName from Table1",sqlconnection1)
dr=sqlcommand1.executereader()
while dr.read()
combobox1.items.add(dr(0))
end while
dr.close()
catch ex as exception
msgbox ex.message
end try
sqlconnection1.close()
THE ABOVE CODE GENRATE THE FOLLOWING ERROR AT RUNTIME
REQUEST FOR THE PERMISSION OF TYPE 'system.sqlclient.sqlclientpermission,system.data,version=2.0.0.0,culture=neutral,publickeytoken=b77a5c561394e089 failed.
please tell me what should i do.
thanks in advance......
|
|
|
|
|
Try here[^]
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
OHHHH ,, YYYYYAAAAA
I have done It.
Now I am Able to connect the database in WPF web browser application
Thanks to all of them who helps me
|
|
|
|
|
Hi,
In my Silverlight Apps, I m unable to drag and drop 'Silverlight XAML controls' on the page.xaml surface. I could add the same by typing XAML markups. Whats the problem? I m using Visual Studio 2008 with VS 2008 SP1.
modified on Friday, June 19, 2009 4:13 AM
|
|
|
|
|
The Visual Studio Silverlight XAML editor's GUI pane is currently only a preview window.
There's no editing features there.
VS 2010 will have it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I'm trying to write a Winforms Application, in which one Windows has the sole purpose to host a WPF Control.
The window itself is transparent (using the TransparencyKey-Property) and so are parts of the hosted WPF control(Using Background-Color=Transparent).
The ElementHost has its BackColorTransparent property set to true.
Problem is: The transparent areas of the WPF control are painted in the background color of the winforms-host. The one that should be replaced by transparency (because of the TransparencyKey).
Seems like an airspace-problem to me, but I'm not sure about that.
How can i achieve true transparency (so i can see the underlying desktop through my WPF Control)?
Any help would be appreciated.
Michael.
|
|
|
|
|
I've never actually done it, but I don't see any reason you couldn't just have a WPF window and create and launch it from your Winforms Form. Then you don't have to worry about airspace and interop problems.
|
|
|
|
|
Simple, but did it - didn't thought of it, because Visual Studio won't let you add one in a Winforms-project.
Thanks.
|
|
|
|
|
I generate all my 3D models in the code-behind file. What I want to know is, is it possible to assign names to the ModelVisual3D's as I create them?
In the XAML I could just use x:Name, but as I said, the models are created in the code-behind.
|
|
|
|
|
Have you tried setting the Name property?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
There is no such thing as a Name property for either a ModelVisual3D or a Model3DGroup when using it in the code-behind. It's the first thing I tried
|
|
|
|
|
There isn't an x:Name property?
|
|
|
|