|
I answered this here[^]. Add the namespace I mention in the answer and you are good to go.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks, you identified the cause though I think your linked solution is wrong (in this case anyway). It's now working but I had to use:
<br />
<x:XData><br />
<colors xmlns=""><br />
rather then the
<br />
<x:XData xmlns=""><br />
<colors ><br />
in your link. I found another MS example which uses xmlns in this manner:
<StackPanel.Resources>
<XmlDataProvider x:Key="InventoryData" XPath="Inventory/Books">
<x:XData>
<Inventory xmlns="">
<Books>
<Book ISBN="0-7356-0562-9" Stock="in" Number="9">
<Title>XML in Action</Title>
<Summary>XML Web Technology</Summary>
</Book>
|
|
|
|
|
Hey Guys,
I am drawing custom user controls onto a Canvas using a placement algorithm, the problem is that when the placement algorithm runs the controls Height has not yet been calculated and is 0 causing other object around it to be placed invalidly, how can I get it so that the height is set before I run my placement algorithm?
Cheers,
Ian
|
|
|
|
|
Hi Ian,
You can set a fixed height and width to your UserControl and then you will have the ActualHeight property set to it before drawing it to the screen.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
Do you mean that I set the User Controls .Width and .Height properties?
|
|
|
|
|
Yes, you have to set the height & width of the UserControl in the XAML itself, else it will set after rendering.
Have a look into the following code snippet for setting the dimension of the control:
<UserControl ...
...
Height="200" Width="400">
</UserControl>
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
But the control is created programmatically in code.
|
|
|
|
|
If you created it programmatically, then use the following way to set the height & width of the usercontrol:
MyUserControl uc = new MyUserControl();
uc.Height = 200.0;
uc.Width = 400.0;
...
...
...
LayoutRoot.Children.Add(uc);
Let me know, if you have any queries.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
I've developed several WPF controls and themes, and would like to showcase them. I've created another WPF application which contains them all, which works fine. Now, I want to put those controls onto web. Is it possible without re-writing the whole code for Silverlight? I've few problems due to Silverlight restrictions. I am using 3.5 framework.
Also, can we edit/create a Silverlight project in Visual C# 2008 express edition?
modified on Friday, July 23, 2010 5:13 AM
|
|
|
|
|
WPF != Silverlight ... ish!
You need Web Developer Express to do Silverlight ...
|
|
|
|
|
You can create a WPF Bowser application an XBAP
http://www.xbap.org/tutorial.html
Every one among us was a beginner once
|
|
|
|
|
That's not, actually, a good suggestion - while you can create a WPF browser app, it's not going to run on certain browsers, and not on a Mac or Linux box. This limits the target audience who can view what he's done.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
Looking for a bit of help. I have two listboxes and a calender control.
One listbox contains different years (2010,2011,2012 etc) and my other listbox contains the months of the year. What I'm trying to do is bind what is selected in the listboxes and then display the correct month and year. I have the binding setup for one direction.
My calender xaml looks as follows
<calender>
<calender.displaydate>
<multibinding converter="{StaticResource myConverter}">
<binding elementname="lstYears" path="SelectedItem">
<binding elementname="lstMonths Path=" selecteditem"="">
My converter class is as follows
Public Class ListBoxToDateConverter
Implements IMultiValueConverter
Public Function Convert(ByVal values() ....etc
Dim year As ListBoxItem = CType(values(0), ListBoxItem)
Dim month As ListBoxItem = Ctype(values(1), ListBoxItem)
' Create my date object from the data and return it ....
.
.
.
return date
End Function
Anyways I dont know how to do the ConvertBack() function. Kinda lost as what to do. Any help would be appreciated
|
|
|
|
|
I have a xaml file, which has a codeline, something like.
xmlns:a="http://schemas.someadress.com/bla/bla/bla" - the name is defined in an assembly which contains that desired namespace.
Above mentioned namespace contains a class, that I'd like to use in my xaml. But I cannot build the project with this file, bc Visual Studio throws me an error
"The tag '<my class="" name="">' doesn't exist in a namespace "http://schemas.someadress.com/bla/bla/bla" Line A Position B"
Interesting enough, that the intellisence can see that class in "a:" - when I start typing it pops up the class that I need. Adress "http://schemas.someadress.com/bla/bla/bla" is correct - I've copypasted it from an assemblyinfo. Besides, other xaml files in a project can perfectly use that specific class from that assembly.
Note, that this question comes from a WPF noobie, and can sound dumb. Still, I've spent more than an hour and ran out of ideas.
Any help will be greatly appreciated.
Thanks in advance
------------
UPDATE: I got this one figured. The problem was that the project's compilation settings were set for .NET Framework 4.0 Client Profile. Once I switched to a regular 4.0, everything got fixed
modified on Friday, July 23, 2010 9:12 AM
|
|
|
|
|
<br />
BitmapImage imageSource = new BitmapImage();<br />
Stream stream = fu.File.OpenRead();<br />
BinaryReader binaryReader = new BinaryReader(stream);<br />
byte[] currentImageInBytes = binaryReader.ReadBytes((int)stream.Length);<br />
stream.Position = 0;<br />
imageSource.SetSource(stream);<br />
imagePreview.Source = imageSource;<br />
<br />
catastrophic failure error occoured,Plz help
HI after a lot of RND i got something like imagetool on codeplex did anyone has some idea how to use the same.
HI All its done, my problem is been resolved now, I used imagetool classes to convert gif and bmp files, but still looking for TIFF decoder, did any one have teh solution for the same????
Thanks
modified on Friday, July 23, 2010 12:13 AM
|
|
|
|
|
My friend had trouble testing Custom Installation screen for silverlight application then we found
out a nice way to debug/test is disabling the plugin. Have posted on my blog an article about Silverlight(.NET 3.0) it is about how to test Silverlight Installation Screen.
http://avikas.blogspot.com/2010/07/test-silverlight-installation-screen.html
Vikas Amin
Credit Suisse
-- Modified Wednesday, July 21, 2010 4:44 PM
|
|
|
|
|
Dude - this is a question answer forum.
I don't think this is a question.
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.
My latest tip/trick - Silverlight *.XCP files
modified on Thursday, July 22, 2010 1:25 AM
|
|
|
|
|
I checked in ourt silverlight project, and the other team members checked it out built it on their own machines (we're all running identical machines with the same OS, and everything else).
On my machine, Application.Current.Host.Source.Host is set to "localhost" (as expected). On the other guys' machines, it's an empty string. Why is that happening?
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
You are right. You will not see the "localhost" there. Just confirm with other guy's machine. They are running from local path and not from web url.
Check in your browser url. It is something like: http://localhost/blahblah
But in other's machine it is: X:\blahblah\
If it is running from physical path it will be always empty. Run from webserver and you will find it.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
I don't think you understand... I AM seeing "localhost", but nobody else is. I'm not concerned about it when it's on a web server, I'm only concerned about it when it's running on my local box.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
I think I got the actual problem. It is not related to webserver stuffs. In your local devbox also you can come to this situation. If you run your Silverlight application from IIS you will always get the host name. If you execute the HTML file of your Silverlight application by double clicking on it, you will see it as empty string. Now come to the point of Visual Studio. There seems to be two option. One, if you run the application hosted on IIS or Visual Studio's inbuilt server you will find the value as the name of the host (generally localhost). In case, you don't have any web application project or your startup project is not your Web application project, you will see the value as empty string.
As I mentioned, please check the URL. If it is pointing to http://localhost/blahblah it will show proper value (in your case) and if it is pointing to some local drive path (i.e. C:\Documents\blahblah\blahblah.html etc.) it will show as empty string (in your team members case).
Please confirm that one first.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
KunalChowdhury wrote: As I mentioned, please check the URL
Check *what* url?
In the clientconfig? That's set to localhost. We're running from the IDE, so it's using the internal server.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Check *what* url?
I mean to say here the URL in which you are running. Once run from your Visual Studio check in the browser address bar. If you don't have any web application added into the Silverlight solution or your Silverlight project itself set as a Startup Project, you will see this behavior. Just check the URL in your PC and also in your team mates PC (where you are seeing empty string). I think those are different and one is pointing to "localhost" (in your case) and the other is pointing to "physical path" (in your team mates case).
Let me know, what's the result.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
Any update on your problem?
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
We implemented a workaround.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|