|
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
|
|
|
|
|
Following is the exception that occurs at client side(Silverlight) when we add reference of WCF service created through WCF Software Factory (tool by microsoft).
“An error occurred while trying to make a request to URI 'http://localhost:58159/WssWCFService.Host/WssService.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.”
I have already put the CrossDomain.xml and clientaccesspolicy.xml file at root location of WCF hosting project but still error exists.
Note: If we create simple WCF service without using WCF software factory tool then that works fine with existing silverlight application.
Any suggestions from anyone who has faced this type of problem will be appreciable
|
|
|
|
|
Dear All,
Here is my combobox in Silverlight
<br />
<ComboBox x:Name="drpUserList" Width="200" Height="30" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left" DisplayMemberPath="FullName" SelectedValuePath="UserNumber"><br />
and i use
<br />
drpUserList.ItemsSource = e.Result;<br />
To fill my combobox, it works fine and will file the combobox with values but i want the selectedvalue which is my userid for selected user from dropdown. How could i get the value.
|
|
|
|
|
Have a look at this post[^].
|
|
|
|
|
You can directly bind from XAML like this,
SelectedValue="{Binding UserID}"
|
|
|
|
|
Do the following:
var selectedUser = (from user in usersList
where user.UserId.Equals(selectedUserId)
select user).FirstOrDefault();
drpUserList.SelectedItem = selectedUser;
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 have a custom user control loaded in the main window of the application. Inside of the custom user control I have a list box.
If the mouse left click is held down, I want the user to be able to drag the main window to a different location on the screen. Is it possible to handle this event inside of the listbox? If so, how can I go about doing it?
|
|
|
|
|
Try this for a starting point ...
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}
|
|
|
|
|
There is a problem with MouseEvents in ListBox - if you click on ListBoxItem, event will be handled and your application will not get event. Possible solutions are useing preview event or using AddHandler for handled events. See this article for sample code: How to Attach to MouseDown Event on ListBox[^]
|
|
|
|
|
hello,
I'm new in Silverlight Development. I want to know how to include "System.Data.SQLClient" in Silverlight application.
In other words, I want to use SQlConnection in Silverlight application
.
Please help
|
|
|
|
|
vinci007 wrote: System.Data.SQLClient
This is not part of the Silverlight runtime.
You can user either Web services or the Entity framework to access data.
|
|
|
|
|
It's simply not possible. Silverlight apps can't connect directly to a database. You have to use a web service (or RIA services).
.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 can use the ADO.net DataModel to mappe your Database or the LinqToSQl(dbml)
then you create a WCF for (ADO.Net DataModel) and a web serice for LinqToSql.
|
|
|
|