|
|
You're welcome.
"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 DrawingGroup and GeometryDrawing classes are available in system.windows.media but it is not availble for me in silverlight3.0. What should I do ?
|
|
|
|
|
|
Hi,
I've a datagrid contains a list of items (Check boxes, link buttons and normal text) and a delete button above the datagrid.
After check the check boxes (one or more), i have to delete those rows from the datagrid by clicking the delete button which is placed above the datagrid..
How to achieve this .......... Pls help me out.......
Regards,
Ravi Vellanki
|
|
|
|
|
Use Foreach Loop And Make a string which have all id of that rows.
after that send this string in a stored procedure which use delete DML with IN clause.
i think your problem is solved...
|
|
|
|
|
I'm trying to use Log4net to log messages within my application. I'm adding a WPF window and want to stream the messages to the window. Log4net provides a TextWriterAppender that takes a StringWriter and writes logged events to the StringWriter, flushing it after each event.
I want to simply connect the output of the StringWriter as the Text property on a TextBox. When I started this, it seemed simple and obvious - now I'm less sure. Ideally, I would simply like to bind the StringWriter to the TextBox, but haven't found the incantation.
The basic problem is that the StringWriter doesn't provide something like the INotifyPropertyChanged event to trigger code output a new log message (unless there is something behind the scenes I haven't found).
I've see many examples of binding, all of which seem to presume that I have control over the writer itself. Am I missing something simple (I hope), or is this really not that straightforward.
Any thoughts/help appreciated.
Thanks,
--Don
|
|
|
|
|
Don - based on your post here, I knocked a sample application up using a custom appender. You can find it here[^].
"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 guys ,
i am using ve silver map ctrl and i have some problem..
default.aspx.cs
<br />
namespace SilverlightApplication1.Web<br />
{<br />
public partial class _Default : System.Web.UI.Page<br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
TokenWebReference.CommonService commonService = new TokenWebReference.CommonService();<br />
commonService.Url = "https://staging.common.virtualearth.net/find-30/common.asmx";<br />
commonService.Credentials = new System.Net.NetworkCredential("VE Account ID", "VE Account Password");<br />
<br />
TokenWebReference.TokenSpecification tokenSpec = new TokenWebReference.TokenSpecification();<br />
<br />
tokenSpec.ClientIPAddress = Page.Request.UserHostAddress;<br />
<br />
tokenSpec.TokenValidityDurationMinutes = 480;<br />
<br />
s1.InitParams = "clientToken= " + commonService.GetClientToken(tokenSpec); <br />
<br />
}<br />
<br />
}<br />
}<br />
and my default.aspx
<%@ Page Language="C#" AutoEventWireup="true" %><br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head id="Head1" runat="server"><br />
<title>SilverlightApplication1</title><br />
<style type="text/css"><br />
html, body {<br />
height: 100%;<br />
overflow: auto;<br />
}<br />
body {<br />
padding: 0;<br />
margin: 0;<br />
}<br />
#silverlightControlHost {<br />
height: 100%;<br />
text-align:center;<br />
}<br />
</style><br />
<script type="text/javascript" src="Silverlight.js"></script><br />
<script type="text/javascript"><br />
function onSilverlightError(sender, args) {<br />
var appSource = "";<br />
if (sender != null && sender != 0) {<br />
appSource = sender.getHost().Source;<br />
}<br />
<br />
var errorType = args.ErrorType;<br />
var iErrorCode = args.ErrorCode;<br />
<br />
if (errorType == "ImageError" || errorType == "MediaError") {<br />
return;<br />
}<br />
<br />
var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";<br />
<br />
errMsg += "Code: " + iErrorCode + " \n";<br />
errMsg += "Category: " + errorType + " \n";<br />
errMsg += "Message: " + args.ErrorMessage + " \n";<br />
<br />
if (errorType == "ParserError") {<br />
errMsg += "File: " + args.xamlFile + " \n";<br />
errMsg += "Line: " + args.lineNumber + " \n";<br />
errMsg += "Position: " + args.charPosition + " \n";<br />
}<br />
else if (errorType == "RuntimeError") {<br />
if (args.lineNumber != 0) {<br />
errMsg += "Line: " + args.lineNumber + " \n";<br />
errMsg += "Position: " + args.charPosition + " \n";<br />
}<br />
errMsg += "MethodName: " + args.methodName + " \n";<br />
}<br />
<br />
throw new Error(errMsg);<br />
}<br />
</script><br />
</head><br />
<body><br />
<form id="form1" runat="server" style="height:100%"><br />
<div id="silverlightControlHost"><br />
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"><br />
<param name="source" id="s1" value="ClientBin/SilverlightApplication1.xap" /><br />
<param name="onError" value="onSilverlightError" /><br />
<param name="background" value="white" /><br />
<br />
<param name="minRuntimeVersion" value="3.0.40624.0" /><br />
<param name="autoUpgrade" value="true" /><br />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none"><br />
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/><br />
</a><br />
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div><br />
</form><br />
</body><br />
</html><br />
<br />
my problem is that despite the fact i have set id="s1"
when compiled gave me an error which says that s1 doesn't exist in the context...
i would appreciate if you could help me..
|
|
|
|
|
The Silverlight plugin is on the client so accessing it
from ASP.NET code on the server isn't going to work
(even if you did put the "id="s1"" in the right place).
You can, however, pass initial parameters to the Silvelight plugin:
How to: Specify and Retrieve Custom Initialization Parameters[^]
Using that, you could pass parameters something like this
protected string GetSilverlightInitParams()
{
TokenWebReference.CommonService commonService = new TokenWebReference.CommonService();
commonService.Url = "https://staging.common.virtualearth.net/find-30/common.asmx";
commonService.Credentials = new System.Net.NetworkCredential("VE Account ID", "VE Account Password");
TokenWebReference.TokenSpecification tokenSpec = new TokenWebReference.TokenSpecification();
tokenSpec.ClientIPAddress = Page.Request.UserHostAddress;
tokenSpec.TokenValidityDurationMinutes = 480;
return "clientToken= " + commonService.GetClientToken(tokenSpec);
}
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" id="s1" value="ClientBin/SilverlightApplication1.xap" />
<big><param name="initParams" value="<%= GetSilverlightInitParams() %>" /></big>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object>
<iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
</div>
</form>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
BTW (FWIW), through Silverlight version 2, there was a asp:Silverlight
ASP.NET control that you could use the way you were trying, but as of
Silverlight 3, that control is deprecated (only there for Silverlight 2
apps).
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
in silver 2 i did this and it gave me the same wrong..
<%@ Page Language="C#" AutoEventWireup="true" %><br />
<br />
<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"<br />
TagPrefix="asp" %><br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<br />
<html xmlns="http://www.w3.org/1999/xhtml" style="height:100%;"><br />
<head id="Head1" runat="server"><br />
<title>last</title><br />
</head><br />
<body style="height:100%;margin:0;"><br />
<form id="form1" runat="server" style="height:100%;"><br />
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><br />
<div style="height:100%;"><br />
<asp:Silverlight runat="server" ID="s1" Source="~/ClientBin/last.xap" MinimumVersion="2.0.31005.0" Width="100%" Height="100%" /><br />
</div><br />
</form><br />
</body><br />
</html><br />
now what is going on???
|
|
|
|
|
billy dev wrote: now what is going on???
I have no idea.
The System.Web.Silverlight assembly is not included with the
Silverlight 3 SDK so I can't try it.
The Silverlight ASP.NET control should not be used anymore anyway.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
you are right..but look this http://msdn.microsoft.com/el-gr/library/cc879136(en-us).aspx ..this article is based on silverlight 2,they have not updated yet so it's a bit difficult without doc..
|
|
|
|
|
I personally wouldn't go to the Bing Services SDK
for Silverlight info.
I linked to the latest docs on passing initial parameters to the
Silvelight plugin:
How to: Specify and Retrieve Custom Initialization Parameters[^]
I'm not sure what you're asking at this point...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How do I make rounded corners for textbox, combobox and other controls
|
|
|
|
|
ahsansharjeel wrote: How do I make rounded corners for textbox, combobox and other controls
They have borders, which can have a CornerRadius applied to them.
"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
|
|
|
|
|
|
Until recently, this forum was not overrun with idiocy. I guess WPF is mainstream now.
What have you tried ? What research have you done ? What are you hoping for here, that someone will give you source code ? Your question suggests you've done nothing bar ask us to do it for you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
If you don't know the answer, then do not reply. its the best way, I just started WPF few days back, I have lot of questions. I have live projects which have to be written in WPF, I will ask forums, no one reply me like this. I help lot of peoples around me for .NET 2.0, SQL Server, Designing and other things, I never discourage any one. If you don't know, just stop replying, no one like this type of answers.
|
|
|
|
|
Christian has asked a fair question. What have you done so far? Before you get all shirty, you might want to consider that he has actually asked you what the starting point is? If you are just after the final couple of bits of information for an almost complete implementation, then you aren't going to want us to tell you about how to bind data into the combo box - that's a waste of your time and ours.
More importantly though, there is an expectation that you have done some work for yourself so far. Code Project is predicated on the fact that you have a starting point. Nobody here has the time or inclination to tell you how to write a fairly complex control from scratch. That's what the articles are for.
"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
|
|
|
|
|
This is a follow-up to an post I made a few days ago that didn't receive any answers. I was asking why events like MouseDown and MouseUp cannot be captured inside FlowDocument containers. Those mouse events don't seem to be generated, and I can't find any explanations either in MSDN or the Microsoft WPF forums explaining why mouse events are thrown away. You'd think they'd explicitly state why this happens. The problem isn't mentioned in any of the several WPF books I also have. When other people ask the same question on other forums, no one really comes up with an answer, not that I've found anyway.
There is one mouse event that is reported, and that is the Click event for UI objects that can listen for that event, such as the Button and Hyperlink elements. These need to be placed inside BlockUIContainers or InlineUIContainers within FlowDocuments. What I was actually trying to do was receive control on a MouseUp event when the user clicked a thumbnail of a screenshot (in the form of an Image element) within a FlowDocument, so that I could bring up another dialog showing the screenshot full size. So one way to get this effect is to put the thumbnail of the screenshot on a button, inviting the user to click the button to get the dialog showing the screenshot full size. That works rather nicely and is a straightforward solution. But an even more attractive option is an inline Hyperlink:
<InlineUIContainer>
<TextBlock>
<Hyperlink
Name="optimal"
Click="optimal_Click"
>
Screenshot
</Hyperlink>
</TextBlock>
</InlineUIContainer>
In any case I think that for some reason, Microsoft is deliberately crippling all elements derived from TextElement (such as Paragraph). All I'm asking for is an explanation for why they do this. Maybe the answer is as simple as, "You should be using Button or Hyperlink within FlowDocuments to do such things." It's actually rather annoying that Microsoft documents all the mouse and preview mouse events for TextElements as if they're all legitimate and yet none of them do anything. Based on the number of Google responses I get when I tried to find out how to get mouse events inside FlowDocuments, the MSDN documentation sure is sending a lot of people on wild goose chases.
modified on Sunday, October 11, 2009 11:26 AM
|
|
|
|
|
They aren't crippling these events. They are capturing them because they have a particular purpose, i.e. they are captured so that you can do things like drag/highlight text, or select paragraphs.
"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 also saw your answer to my previous post. So I guess I should have been looking for PreviewMouseLeftButtonDown instead of PreviewMouseLeftButtonUp. The only reason I was looking for Up instead of Down is because I wanted to make it look like a Click event.
My wording, "crippling these events," was probably too extreme, but not totally off base, it seems to me. Pre-empting would perhaps be a better term. Microsoft isn't literally crippling these mouse events, but it is pre-empting them, for selecting text. But now I don't understand why it has to do this. For example, it doesn't do it for the TextBox element. You can select text in a TextBox and drag it somewhere else, and at the same time, capture PreviewMouseLeftButtonUp. I know because I do that all the time.
Maybe there's a good reason for pre-empting these mouse events for the TextElement class. But what is it? I wasn't able to find any MSDN documentation explaining this, and if it is documented somewhere, it must be pretty obscure because I ran into a lot of posts Googling with the same issues I had, with no one giving your answer.
I think pre-empting is a fair description, because if I do capture the Down event to bring up a dialog, that interfers with highlighting (and perhaps dragging) text, even if I don't say e.handled = true . As mentioned above, this isn't true for the much simpler TextBox element.
In any case, after wrestling with various possibilities, I saw that the best way to accomplish what I want is to put a Hyperlink inline in my text and capture its Click event. That looks very clean for the user and doesn't interfere with text highlighting at all. So in the end I got what I want without intercepting any of the mouse events (other than Click).
modified on Sunday, October 11, 2009 8:15 PM
|
|
|
|