|
|
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
|
|
|
|
|
Hi
I'm having a bit of an issue with my progress bar in WPF. Let me first explain why I want a progress bar. I have a list of products that I save back to a database when clicking a Save button. Sometimes this list can contain quite a lot of items, and this takes a while to save. I use a for loop to loop through and save each item in this list. So what I want to do is increment the progress bar after each loop iteration. Is this possible? Below is what I tried doing but it only updates the progress bar after the loop has finished, even though I'm running it on a different thread:
for (int i = 0; i < someList.Count; i++)<br />
{<br />
<br />
new Thread(delegate()<br />
{<br />
UpdateProgress(100 / productPartsList.Count);<br />
}).Start(); <br />
}
<br />
public void UpdateProgress(double increment)<br />
{<br />
progressIncrement = progressIncrement + increment;<br />
<br />
Dispatcher.BeginInvoke(DispatcherPriority.Background, (SendOrPostCallback)delegate { progressBar1.SetValue(System.Windows.Controls.ProgressBar.ValueProperty, progressIncrement); }, null);<br />
}
Any hints?
|
|
|
|
|
Hi,
I think you have to use another DispatcherPriority flag.
Because : DispatcherPriority.Background means the enumeration value is 4. Operations are processed after all other non-idle operations are completed.
So i would recommend you to use at least DispatcherPriority.Normal or you also could try DispatcherPriority.Render .
Cheers Noodles
|
|
|
|
|
Thanks Noodles. That didn't help though, and I tried every priority available.
Here's another code sample I tried:
NOTE: This is called inside my loop, so it gets done for every loop iteration
System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(
delegate()
{
System.Windows.Threading.DispatcherOperation
dispatcherOp = prgbSave.Dispatcher.BeginInvoke(
System.Windows.Threading.DispatcherPriority.Render,
new Action(
delegate()
{
progressIncrement = progressIncrement + (100.0 / productPartsList.Count);
prgbSave.Value = progressIncrement;
}
));
dispatcherOp.Completed += new EventHandler(dispatcherOp_Completed);
}
));
thread.Start();
This does the same The progressbar only gets updated after the loop has completed.
|
|
|
|
|
This[^] blog post will show you how to implement a version of DoEvents(), that should help.
|
|
|
|
|
The normal way to do this in a WPF application is to implement a background worker, where you'd save the items in your background thread, and you'd dispatch the updated progress values back to the calling thread which would update the progress bar.
"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
|
|
|
|
|
Hello
I have a textBox which I want to add some "ghost" text on, which is visible whenever the textbox does not have focus.
I could do it with codebehind, but since I am new to WPF and XAML I would like to do it all from XAML code, to get some practice.
Currently my XAML code looks like this:
<TextBox x:Name="textBoxUsername" Margin="5,5">
<TextBox.Style>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="IsFocused" Value="false">
<Setter Property="Text" Value="Username"/>
<Setter Property="Foreground" Value="LightGray"/>
<Setter Property="FontStyle" Value="Italic"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
What I would like to do, is add another statement to the trigger so
it checks if the text is set by the user.
This is where I need help, I cannot figure out what to write, so
it checks if the text is set by the user or not.
If this is not the right way to solve this, I would be happy to get
an Article/blog/something which describes how to do it
//QzRz
|
|
|
|
|
|
Hello, I have a WPF application which runs in a Window. I would like to change that and have it replace the Windows desktop (this makes sense since the application is a file manager, among other things.).
I need some generic explanation of how to do that because I have no clue if it's possible and how. So far I only understand that I'll probably have to call some Win32 functions. I am imagining something like "take the hwnd H of your wpf window, call GetDesktopWindow() as W, take the parent P of W, and replace H as the child of P". (This is what I seem to understand that I probably have to do, but I may be completely wrong. For example, I may need to implement some COM interfaces or create shell extensions.).
Currently I am browsing the source code of some "shell replacements" like geoshell, but I still can't locate the piece of code which replaces the desktop, and I am not sure this would apply to a WPF application anyway. So, I would be very grateful if somebody pointed at the right direction. Thank you very much for any pointers.
Update :
it looks like I did it with the help of this link[^]. It seems to work. Here is the code (the language is F#):
let tWnd =
let help = Interop.WindowInteropHelper mainWindow
help.Handle
mainWindow.ResizeMode <- ResizeMode.NoResize
mainWindow.WindowStyle <- WindowStyle.None
let mutable pWnd = FindWindow("Progman", null)
pWnd <- FindWindowEx(pWnd, IntPtr.Zero, "SHELLDLL_DefVIew", null)
pWnd <- FindWindowEx(pWnd, IntPtr.Zero, "SysListView32", null)
SetParent(tWnd, pWnd) |> ignore
mainWindow.WindowState <- WindowState.Maximized
modified on Saturday, October 10, 2009 7:47 AM
|
|
|
|
|
Hey All,
I am building a Textbox that will have multiple regular expressions that validate when the control looses focus.
I can get this all to work, but at design time in Expression Blend 3 when I go to set the "Validators" I get and error saying "No types are available for you to add to this collection."
does anyone have any ideas on how I can make this work?
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Hi,
i have RibbonControl.dll, used in my application. but i want to change the base color of this ribbon control. look at this demo project which i have downloaded from codeproject.com itself.
http://www.codeproject.com/KB/WPF/ribboncontrol/ribboncontrol_demo.zip
can any body help me out..
Thanks!
|
|
|
|
|