|
Browser buttons are not used in Silverlight by default.
IN Silverlight 3, you can use the navigational framework[^].
My signature "sucks" today
|
|
|
|
|
Can u help me in this ...i did not find any solution for this.
With Regards
Ch.Gayatri
|
|
|
|
|
Search on the internet - you will find some startup and medium level examples on the navigational framework.
My signature "sucks" today
modified on Thursday, June 10, 2010 7:39 AM
|
|
|
|
|
You need to use the navigation framework for Silverlight. The easiest way to do this is to start from scratch by building a Silverlight Navigation Application.
BTW, you need to be writing Silverlight 3 or higher...
.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 am trying to display an icon from a file on my WPF page. I am successfully able to get the icon. I then convert it to a bitmap using icon.ToBitmap(). I then convert it to a BitmapImage using the following code...
private BitmapImage ConvertIconToBitmapImage(Icon icon)
{
Bitmap bitmap = icon.ToBitmap();
MemoryStream ms = new MemoryStream();
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
BitmapImage bImg = new BitmapImage();
bImg.BeginInit();
bImg.StreamSource = new MemoryStream(ms.ToArray());
bImg.CreateOptions = BitmapCreateOptions.None;
bImg.CacheOption = BitmapCacheOption.Default;
bImg.EndInit();
ms.Close();
return bImg;
}
This also works, BUT there is a black border around the image. How do I get rid of this black border? I read some post that say use a manifest file to enable visual styles. But I can't seem to get that to work. Maybe I'm including the manifest file wrong. I've also read some places to use Application.EnableVisualStyles() but that doesn't work with WPF (I believe). Does anyone have any ideas?
Thanks.
|
|
|
|
|
In the XAML, set the image BorderBrush to {x:Null} .
"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
|
|
|
|
|
I figured this out for anyone else that has the same problem. It's very simple actually.
In the code..
<br />
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);<br />
change it to...
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
Thats it!
|
|
|
|
|
I have asked two questions on data-binding already but I'm still stuck .
Maybe it would be better if I asked more generally -- what are reasons which can spoil data-binding?
Greetings - Jacek
|
|
|
|
|
That's a bit too general. Post some code and the problem you are having (after Googling and trying to figure it out yourself, of course).
|
|
|
|
|
I found that your collection should be an ObservableCollection , and your collection items object should be derived from INotifyPropertyChanged . Once that's done' it should just work (assuming your Binding Path and ItemsSource is correct).
.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 know, I use Observable collections as sorces for my controls. I construct them from EF data classes. But it doesn't really matter how do I construct them -- they stay as a part of GUI and are commited on a clich on a button.
OK, I know it's bad, but here I upload my project.
You are welcome to solve the WPF challenge. I think it will be easy for a professional -- most probably I do a big bad error which is usual for noobies. Enjoy.
Hotfile download[^]
I'm sorry - it's not because I am too lazy. I just don't know how to formulate a question. I have no idea what's going on - it should work, you know.
Thanks
Greetings - Jacek
|
|
|
|
|
When I call a method in a WCF web service from a silverlight app, I get this:
An exception occurred during the operation, making the result invalid. Check InnerException for exception details.<br />
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()<br />
at FMDashboard2.FMDashSvc3Ref.GetMetricDataCompletedEventArgs.get_Result()<br />
at FMDashboard2.Objects.DataRetrieval.service_GetMetricDataCompleted(Object sender, GetMetricDataCompletedEventArgs e)
Calling webService.OpenAsync() succeeds, but I can't call a method (which happens to be the one and only method in the service).
.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
|
|
|
|
|
Does inner exception provides something useful?
|
|
|
|
|
Wrap the code inside your MetricData method with a try/catch block and log the resulting exception using the .ToString() method. The method is just wrapped with a proxy for the asynchronous code, so the exception will be occurring in the context of the body of the method. I normally use log4net for tracking exceptions in my web services.
"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
|
|
|
|
|
The web service works fine when I run it locally (in the IDE), but I'll give it a try.
BTW, how can I debug the service locally? I can't get the debugger to jump into the code.
.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
|
|
|
|
|
If you've got the pdb files located alongside it, you can normally get to it via
Attach to Process from the Tools menu.
"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
|
|
|
|
|
No exception is being written. :/
.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
|
|
|
|
|
So, we've pretty much ascertained that the problem isn't in the service. Basically, you need to look at the whole exception that's being received at the client end. Check the inner exceptions (right the way up the stack) to see what's going on.
"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
|
|
|
|
|
The body is alreadt wrapped in a try/catch block, and it works fine locally. The only reason I could think of why it would fail remotely is that the appropriate version of .Net wouldn't be installed, but I checked that, and the server has 3.5...
The first call (which fails) is simply returning a string that uses no .Net objects/methods to construct it.
.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
|
|
|
|
|
But what do you get when you log the exception? It sounds like a permissions issue is at fault here, so let's try to get to the bottom of that.
"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
|
|
|
|
|
Permissions where - writing the log file? FWIW, I also tried turning on the WCF tracing, but i don't get a log file.
.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 actually meant you'd need to write out a log file (using log4net).
The permissions I was talking about was the permissions on the actual service itself.
"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
|
|
|
|
|
Well, I fingered out how to get the inner exception (and wrote a tip/trick about it ), and for your reading pleasure, here it is:
An exception occurred during the operation, making the result invalid. Check InnerException for exception details.<br />
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()<br />
at FMDashboard2.FMDashSvc3Ref.GetMetricDataCompletedEventArgs.get_Result()<br />
at FMDashboard2.Objects.DataRetrieval.service_GetMetricDataCompleted(Object sender, GetMetricDataCompletedEventArgs e)<br />
============<br />
Inner exception: An error occurred while trying to make a request to URI 'https://myUrl/FMDash3.svc/secure'. <br />
This could be due to attempting to access a service in a cross-domain way without a proper <br />
cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may <br />
need to contact the owner of the service to publish a cross-domain policy file and to ensure <br />
it allows SOAP-related HTTP headers to be sent. This error may also be caused by using <br />
internal types in the web service proxy without using the InternalsVisibleToAttribute <br />
attribute. Please see the inner exception for more details.<br />
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)<br />
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)<br />
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)<br />
at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)<br />
at FMDashboard2.FMDashSvc3Ref.FMDash3Client.FMDash3ClientChannel.EndGetMetricData(IAsyncResult result)<br />
at FMDashboard2.FMDashSvc3Ref.FMDash3Client.FMDashboard2.FMDashSvc3Ref.FMDash3.EndGetMetricData(IAsyncResult result)<br />
at FMDashboard2.FMDashSvc3Ref.FMDash3Client.OnEndGetMetricData(IAsyncResult result)<br />
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)<br />
============<br />
Inner exception: <br />
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)<br />
at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)<br />
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)<br />
============<br />
Inner exception: Security error.<br />
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)<br />
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)<br />
at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)<br />
.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
|
|
|
|
|
Are your clientaccesspolicy.xml or crossdomain.xml files visible? Have a read of this[^].
"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
|
|
|
|
|
Visible? I have a ClientAccessPolicy.xml file in my web services's folder:
="1.0"="utf-8"
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri ="*" />
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
I also have a CrossDomain.xml , but I'm not really sure where to put it, so I have it in a few places.
="1.0"="utf-8"
<cross-domain-policy>
<allow-http-request-headers-from domain="*" headers="*"/>
<strong>
<allow-http-request-headers-from domain="*" headers="SOAPAction" />
</strong>
<allow-https-request-headers-from domain="*" headers="*"/>
<strong>
<allow-https-request-headers-from domain="*" headers="SOAPAction" />
</strong>
</cross-domain-policy>
Where *should* I put it?
.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
|
|
|
|