 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers, Chris Maunder
The Code Project Co-founder Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 5.00/5 (2 votes) |
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers, Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 4.40/5 (2 votes) |
|
|
|
 |
|
|
 |
|
 |
If you are accessing through HTTP you need to provide a clientaccesspolicy.xml in the root of the site.
My question is for the TCP access, it appears you must setup a TCP listener on the TCP address where Silverlight is accessing on port 943. Correct?
It has nothing to do with the hosting web server. Right?
Thanks
Programmer Glenn Earl Graham Austin, TX
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
earlgraham wrote: If you are accessing through HTTP you need to provide a clientaccesspolicy.xml in the root of the site.
Only if you'll be accessing resources on a domain other than the one the Silverlight app is hosted on. Then the target domain must have the policy file at its root.
earlgraham wrote: It has nothing to do with the hosting web server. Right?
Correct. You have to supply the server code (listening on port 943) that returns the policy information.
Mark Salsbery Microsoft MVP - Visual C++
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
In Windows Forms, when I set the position of an UIElement I do it that way:
UIElement.Location = new Point(X, Y);
UIElement.Location.X UIElement.Location.Y
How can I do this simple task in Silverlight, for example with canvas, called "MyCanvas";
MyCanvas.Margin.Left MyCanvas.Margin.Top
What is this Margin about?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
TCPMem wrote: What is this Margin about?
From the docs: "The margin is the space between this object and other objects that will be adjacent when layout creates the UI."
There's a variety of ways to layout elements in Silverlight/WPF beyond simple XY coordinates. There are elements that layout their child elements, and there are elements that layout based on their child elements. Maybe at least glossing over the documentation will help in understanding at least the basics of layout in Silverlight.
There's Silverlight documentation available both online[^] and offline[^].
Mark Salsbery Microsoft MVP - Visual C++
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello I have developed a silver light web application.This is working fine when it is running from Visual Studio2008 but if i host it after publishing and accessing via the following link.
URI: http://localhost/WapCosGraph/SilverLightGraphTestPage.aspx
i am getting error:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Timestamp: Fri, 6 Nov 2009 05:20:37 UTC
Message: Unhandled Error in Silverlight 2 Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at SilverLightGraph.ServiceReference1.getEmpWorkIndivIsualCompletedEventArgs.get_Result() at SilverLightGraph.Page.objService_getEmpViseArea(Object sender, getEmpWorkIndivIsualCompletedEventArgs e) at SilverLightGraph.ServiceReference1.Service1Client.OngetEmpWorkIndivIsualCompleted(Object state) Line: 1 Char: 1 Code: 0 URI: http://localhost/WapCosGraph/SilverLightGraphTestPage.aspx
Please help.. -Raghvendr Singh
modified on Friday, November 6, 2009 1:53 AM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Looks like a web service problem.
Did you adjust the web service's configuration based on the service's published location?
Mark Salsbery Microsoft MVP - Visual C++
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Is it possible to write and run a basic Hello World Silverlight Application using just Notepad, the C* compiler and the command prompt?
Call me crazy but I like to work from first principles. Gives me a better and in-depth understanding of everything. Also helps me to give my students a fundamental view of programming
Have tried it without success and I am wondering if anyone out there has tried it?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
I have defined a grid like this:
<Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*" MinHeight="300" /> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions>
I would like to know what the height of Grid.Row 1 is at runtime. Giving it a name and asking for the height only returns a "*". Is there a way to determine this?
Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Never mind. I just added a panel around everything in that grid row and the panel knows how high it is.
Thanks
Brent
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello,
How can I call a MVC controller method in Silverlight en give the method some parameters. The parameter wil be a IList.
Thanks,
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I am working on a silverlight application. In this I need to send mail from a .aspx page. But while sending mail I am getting the below exception
"The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required."
Code I hve written is
string to = "test2@gmail.com"; System.Net.Mail.MailMessage MyMailMessage = new System.Net.Mail.MailMessage("test1@gmail.com", to,"Hi", "Test"); MyMailMessage.IsBodyHtml = true; System.Net.NetworkCredential mailAuthentication = new System.Net.NetworkCredential("test1@gmail.com", "pswpsw"); System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587); mailClient.EnableSsl = true; mailClient.UseDefaultCredentials = false; mailClient.Credentials = mailAuthentication; mailClient.Send(MyMailMessage);
If you have have any idea to solve this please reply me.
Thanks in advance.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Since this question has nothing to do with Silverlight, you may get more response on perhaps the .NET Framework or ASP.NET board.
Mark
Mark Salsbery Microsoft MVP - Visual C++
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
I' m building a sample in which I want to move an object. I'm not fully familiar with Blend and Xaml and the C# code behind, but I really don't understand why my cursor is far away from the object (is it canvas?... I don't know, in fact I'm shooting in the dark).
Here' s my xaml:
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="CanvasMove.MainPage" Width="640" Height="480">
<Grid x:Name="LayoutRoot" Background="White"> <Canvas Height="80" HorizontalAlignment="Left" Margin="100,100,0,0" VerticalAlignment="Top" Width="80"> <Rectangle Fill="#FF80C1E4" Height="80" Width="80" RenderTransformOrigin="0.5,0.5" MouseLeftButtonUp="CanvasUp" MouseLeftButtonDown="CanvasDown"/> <Rectangle Fill="#FF7AB7D8" Height="32" Width="32" Canvas.Left="24" Canvas.Top="24"/> <Canvas.RenderTransform> <TranslateTransform X="0" Y="0" x:Name="CanvasTransform"/> </Canvas.RenderTransform> </Canvas> </Grid> </UserControl>
Here's my C#:
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e);
CanvasTransform.X = e.GetPosition(null).X; CanvasTransform.Y = e.GetPosition(null).Y; }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
TCPMem wrote: I really don't understand why my cursor is far away from the object
You are responding to all the MouseMove events for the UserControl.
When you call e.GetPosition(null) you are getting the cursor position relative to the entire Silverlight plugin.
Your Canvas is 100 pixels down and to the right of the plugin. The Rectangle you are moving is another 24 pixels down and to the right of the Canvas.
So the cursor is always 124x124 away from the object.
What are you trying to do? Do you want to be able to drag the rectangle with the mouse by clicking on it?
Mark Salsbery Microsoft MVP - Visual C++
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
"What are you trying to do? Do you want to be able to drag the rectangle with the mouse by clicking on it?"
Yes. That's exactly what I want. How can I make it?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
TCPMem wrote: That's exactly what I want. How can I make it?
First, I misread your code so I was wrong about how far off the cursor was from the Canvas. I now see you're moving the entire canvas, not just the rectangle, which is the way I read it 
Anyway, here's a simple example that will hopefully get you going:
<Grid x:Name="LayoutRoot" Background="White"> <Canvas Height="80" HorizontalAlignment="Left" Margin="100,100,0,0" VerticalAlignment="Top" Width="80" MouseLeftButtonUp="Canvas_MouseLeftButtonUp" MouseMove="Canvas_MouseMove" MouseLeftButtonDown="Canvas_MouseLeftButtonDown" > <Rectangle Fill="#FF80C1E4" Height="80" Width="80" RenderTransformOrigin="0.5,0.5" /> <Rectangle Fill="#FF7AB7D8" Height="32" Width="32" Canvas.Left="24" Canvas.Top="24"/> <Canvas.RenderTransform> <TranslateTransform X="0" Y="0" x:Name="CanvasTransform"/> </Canvas.RenderTransform> </Canvas> </Grid>
Point anchorPoint; bool isInDrag = false;
private void Canvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { FrameworkElement element = sender as FrameworkElement; anchorPoint = e.GetPosition(null); element.CaptureMouse(); isInDrag = true; }
private void Canvas_MouseMove(object sender, MouseEventArgs e) { if (isInDrag) { Point currentPoint = e.GetPosition(null); CanvasTransform.X = CanvasTransform.X + currentPoint.X - anchorPoint.X; CanvasTransform.Y = CanvasTransform.Y + currentPoint.Y - anchorPoint.Y; anchorPoint = currentPoint; } }
private void Canvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (isInDrag) { FrameworkElement element = sender as FrameworkElement; element.ReleaseMouseCapture(); isInDrag = false; } }
Mark Salsbery Microsoft MVP - Visual C++
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hello,
I have made a property in a Silverlight project on the Page. How can I call this propery in the code behind page of ASP.net(c#)?
Thanks,
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |