|
pavanip wrote: Can please anyone help me how to do that task using silverlight and .Net.
you can consider hiring some Silverlight consultants to get it done.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
I have a MFC dll, which one inherit the CFormView and I add a textbox in that FormView. I want to load that dll from WPF and display it in the window as a control. If anyone have an idea about this, please help me.
|
|
|
|
|
Why would you want to do this? It's easy enough (i.e. trivial) to do exactly this in WPF, so why would you want to go to all the trouble of adding in an external DLL to do this? BTW - I'm not the one who voted 1.
"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 All,
I've just started looking into this in relation to an app I've made. It's a fairly simple app, most of the pages just have a handful of controls (the main one being Infragistics Grid) spread over a few pages. The app has been designed and implemented using Prism (Composite).
When I first launch the app I'm seeing nearly 60Mb of ram in use before the application has opened any data files. I'm currently going through the WPF Performance Suite tools to see what this shows up. Any tips would be good!
Anyone else experiencing anything like this with their apps?
|
|
|
|
|
It is normal. See comments here.[^]
|
|
|
|
|
Interesting comments. I had bookmarked that article but it had slipped my mind, thanks for pointing me to it.
|
|
|
|
|
I'm stuck (as usual).
A have a user control with 6 textboxes. But to make it easier, I'm trying to break down the problem a bit and lets say there is one textbox.
USERCONTROL1.XAML:CS
public partial class AttenuationBox : UserControl
{
private String justAtest;
public String ATest { get { return justATest; } set { ...
public String LowChRx
{
get { return tbLowChRX.Text; }
set { tbLowChRX.Text = value; }
}
...
}
USERCONTROL1.XAML
<textbox name="tbLowChRX" text="{Binding Path=ATest}"></textbox>
Now I want tbLowChRX to be bound to justAtest. But just can't get it to work. Must be something I have missed in Source or Path or...
modified on Sunday, April 19, 2009 12:49 PM
|
|
|
|
|
You will need to make sure the source is right on the binding.
Here's a simple example of one way to do it:
WPF: Binding to Properties in your UserControl or Window[^]
I'm not sure why you'd want to bind directly to the field, nor do I think
you can, but you should be able to bind to the ATest property. Of course, for
change notifications when the property is updated, you may want to make that a
dependency property.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Oh, my fault, the intention was to bind to the property
|
|
|
|
|
Then that example at the link works...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello Friends I am getting these errors in my wpf application. Any help would be appreciated as I am totally new to this environment/
Error 1 'System.Windows.Data.BindingListCollectionView' does not contain a definition for 'AddNew' and no extension method 'AddNew' accepting a first argument of type 'System.Windows.Data.BindingListCollectionView' could be found (are you missing a using directive or an assembly reference?) D:\Other\Personal\WPF\Tutorial\Windows Client\Zip Files\Wpf-Data-MasterDetail_CS\WpfMasterDetail_CS\WpfMasterDetail_CS\Window1.xaml.cs 77 29 WpfMasterDetail_CS
Error 2 'System.Windows.Data.BindingListCollectionView' does not contain a definition for 'CommitNew' and no extension method 'CommitNew' accepting a first argument of type 'System.Windows.Data.BindingListCollectionView' could be found (are you missing a using directive or an assembly reference?) D:\Other\Personal\WPF\Tutorial\Windows Client\Zip Files\Wpf-Data-MasterDetail_CS\WpfMasterDetail_CS\WpfMasterDetail_CS\Window1.xaml.cs 78 29 WpfMasterDetail_CS
Error 3 'System.Windows.Data.BindingListCollectionView' does not contain a definition for 'RemoveAt' and no extension method 'RemoveAt' accepting a first argument of type 'System.Windows.Data.BindingListCollectionView' could be found (are you missing a using directive or an assembly reference?) D:\Other\Personal\WPF\Tutorial\Windows Client\Zip Files\Wpf-Data-MasterDetail_CS\WpfMasterDetail_CS\WpfMasterDetail_CS\Window1.xaml.cs 89 29 WpfMasterDetail_CS
Error 4 'System.Windows.Data.BindingListCollectionView' does not contain a definition for 'AddNew' and no extension method 'AddNew' accepting a first argument of type 'System.Windows.Data.BindingListCollectionView' could be found (are you missing a using directive or an assembly reference?) D:\Other\Personal\WPF\Tutorial\Windows Client\Zip Files\Wpf-Data-MasterDetail_CS\WpfMasterDetail_CS\WpfMasterDetail_CS\Window1.xaml.cs 121 29 WpfMasterDetail_CS
Error 5 'System.Windows.Data.BindingListCollectionView' does not contain a definition for 'CommitNew' and no extension method 'CommitNew' accepting a first argument of type 'System.Windows.Data.BindingListCollectionView' could be found (are you missing a using directive or an assembly reference?) D:\Other\Personal\WPF\Tutorial\Windows Client\Zip Files\Wpf-Data-MasterDetail_CS\WpfMasterDetail_CS\WpfMasterDetail_CS\Window1.xaml.cs 122 29 WpfMasterDetail_CS
Error 6 'System.Windows.Data.BindingListCollectionView' does not contain a definition for 'RemoveAt' and no extension method 'RemoveAt' accepting a first argument of type 'System.Windows.Data.BindingListCollectionView' could be found (are you missing a using directive or an assembly reference?) D:\Other\Personal\WPF\Tutorial\Windows Client\Zip Files\Wpf-Data-MasterDetail_CS\WpfMasterDetail_CS\WpfMasterDetail_CS\Window1.xaml.cs 129 33 WpfMasterDetail_CS
|
|
|
|
|
I have a MFC dll, which one inherit the CFormView and I add a textbox in that FormView. I want to load that dll from WPF and display it in the window as a control. If anyone have an idea about this, please help me.
|
|
|
|
|
|
I am implementing a scenario where I'm loading 3 or 4 views inside the tabcontrol. My tabcontrol region is defined using the TabControlRegionAdapter. I am able to load these views into this region without any problems. However, I am unable to control the layout of the tab control once these views get loaded. Thus my views scroll out of my page (so to speak) and are not visible on the screen. I understand that the tab control uses ItemsControl to display its content. I tried defining the layout using ItemsTemplate but even that seemed to have no effect.
How can I control the layout of the content inside a tab so that all my views can be completely visible on the screen? Also, is there a solution such that as I resize my browser, this content too gets automatically resized? In my present scenario, as I resize my window, more and more of my view content gets clipped.
Thanks for any help or guidance in advance.
|
|
|
|
|
I am working in WPF. Normally on lost focus of textbox , text are unselected. But if I set the value e.handled = true on lostfocus event handler, unselection doesn't happen. I need to set e.handled = true to prevent the event from bubbling up. Note: I am not stopping from lostfocus being triggered. LostFocus takes place, its just that, automatic unselection doesn't happen and I want the unselection to take place.
Private Sub MyTextBox_LostFocus(ByVal sender As Object, ByVal e As RoutedEventArgs)
e.Handled = True
End Sub
|
|
|
|
|
Try setting the TextBox.SelectionLength property to 0 in your LostFocus handler method.
|
|
|
|
|
Well setting that only leaves the textedit cursor blinking in the text box even after lost focus. I have already tried via default selection property settings e.g selectionlength or selectionstart, all results in setting the cursor blinking in the text box even if the next control get focus. Just tab through the text box and see the behviour of the cursor on txtFirst and txtSecond
< textbox x:name="txtTest" lostfocus="txtFirst_LostFocus" xmlns:x="#unknown" / >
< textbox x:name="txtFirst" lostfocus="txtFirst_LostFocus" xmlns:x="#unknown" / >
< textbox x:name="txtSecond" lostfocus="txtSecond_LostFocus" xmlns:x="#unknown" / >
< textbox x:name="txtFourth" xmlns:x="#unknown" / >
Private Sub txtFirst_LostFocus(ByVal sender As Object, ByVal e As RoutedEventArgs)
e.Handled = True
End Sub
Private Sub txtSecond_LostFocus(ByVal sender As Object, ByVal e As RoutedEventArgs)
e.Handled = True
End Sub
|
|
|
|
|
I see what you are saying about the caret staying in the TextBox that looses focus. Try setting the IsEnabled property to False and then True again after you set e.Handled = True. That seems to make the caret go away for me.
|
|
|
|
|
Hi all,
I want to download xml or any other file from physical location like C:\Documents and Settings\All Users\Documents\Test.xml and open a Save Dialog box to allow user to save it in desired location
Is it possible in Silverlight 2.0?
Can we do it in xaml.cs file?
If yes then plz share the code with me.....
Its very urgent.........
Thanks in advance,
|
|
|
|
|
salon wrote: Is it possible in Silverlight 2.0?
Opening a file you can do using the OpenFileDialog class, so the user
effectively needs to give permission first.
Saving a file, no, not in Silverlight 2.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Another option (not elegant but works) could be to perform a ping pong using services:
- Send your file to the server again using a WCF service, store it in session.
- Call a javascript method from SL that will make a request to a custom HTTP hanlder.
- That custom HTTP hanlder would return the file that was in session as an attachment (first time the nasty bar from IE would appear... you are going to download something...).
In my application I needed to export a DB Diagram to JPEG and to perform an export as well to an HTML report, I used that approach (ping pong ), I could set an attribute (attachment) and IE would ask me to save the JPEG as a file.
If you want to take a look at how it behaves:
http://www.dbschemaeditor.com
HTH Braulio
/// -------------------------
Braulio Díez
DBSchemaEditor.com
Free Silverlight based DB Schema Modeling Tool
/// -------------------------
|
|
|
|
|
If you don't mind !
Can you share the code/link to solution so that I get a clear picture of the entire thing?
I have searched for the above solution but not getting any way.............
Please help me....
|
|
|
|
|
I don't have alink with the whole solution, but the pieces and what I implemented on my project.
Let's go step by step:
About the solution:
It's a workaround, SL cannot do that, what we do then is to workaround it using ASP .net / Javascript (in ASP .net it's possible to return a file to client as an attachment).
In my case:
--> I have an XML file on my client side (that represents the database diagram), it could be whatever that can be serializable.
--> I have an WCF service that accepts as input parameter that XML file, I send a call from SL to the service (if you have question on this give me a shout and will try to find some tutorial about how to call services from SL).
--> This service that I'm calling inherits the context from the ASP .net application, that is, we have the ASP .net session available, to enable this you only have to add to the header of your service class:
<br />
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]<br />
public class RenderService<br />
--> In my case I stored the XML file in a session variable in the server (so for that user we get the file in his session / memory).
--> Once the Silverlight receives the callback from the service call (the service has been called successfully), I call from SL a javascript method:
public void ShowDiagramImageRenderPopup()
{
System.Windows.Browser.HtmlPage.Window.CreateInstance("showReportDiagramPopup");
}
--> This javascript methods opens a popup that points to a URL (if I want it to download a file I just have to open a page in the same navigator, the only thing is that the custom HTTP Handler must return an "attacment").
function showReportDiagramPopup() {
window.open("DiagramRenderPopup.aspx", "DatabaseDiagram", "scrollbars=yes, width=800,height=600", false);
}
--> Ok, now let's go for the CUstom HTTP Hanlder "DiagramImageHandler.ashx", the main code snippet that does the trick
public void ProcessRequest(HttpContext context)
{
EntityExportDiagram exportDiagram = (EntityExportDiagram)HttpContext.Current.Session["printreport"];
Bitmap bitmap = new Bitmap(width, height,
PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(bitmap);
SolidBrush br = new SolidBrush(Color.White);
g.FillRectangle(br, 0, 0, width, height);
br.Dispose();
(...)
g.Dispose();
context.Response.ContentType = "image/jpeg";
System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
bitmap.Save(memoryStream, ImageFormat.Jpeg);
context.Response.AddHeader("Content-Length", memoryStream.Length.ToString());
memoryStream.WriteTo(context.Response.OutputStream);
context.Response.End();
bitmap.Dispose();
context.Response.Flush();
context.Response.Close();
}
--> Then once the page is called, in my case a popup is shown with the diagram exported as JPEG, in your case (setting the attachment file) you will get a download / save file (watch out here, first time users will get a nasty IE warning and the SL application will reset, security stuff ).
HTH
Braulio
PS.: Hope to get sometime some day and write a complete sample about this.
/// -------------------------
Braulio Díez
DBSchemaEditor.com
Free Silverlight based DB Schema Modeling Tool
/// -------------------------
|
|
|
|
|
so... what used to be in app.config should now be in xaml this point forward?
I know for one the user interface is in xaml represented pretty much like HTML/ASP.NET tags, and we should also include resources in xaml. What about other configuration?
One of the article I stumbled upon ...
<br />
string xaml = @"<string assembly="" mscorlib=""><br />
<string xmlns=""><br />
hello world</string></string>";<br />
byte[] xaml_data = System.Text.Encoding.ASCII.GetBytes(xaml);<br />
System.IO.MemoryStream xaml_stream = new System.IO.MemoryStream(xaml_data);<br />
string xaml_object = (string)System.Windows.Markup.XamlReader.Load(xaml_stream);<br />
Console.WriteLine(xaml_object);<br />
Using XAML for Custom Application Configuration [^]
So seems like you can resurrect an object from xaml file - what I don't see is how it's superior to "add key=xxxx value=xxx" in old app.config or spring.net dependency injection.
a good article on this for reference? I've stumbled across couple but.. I want to answer key question - "Do I want to put app.config in xaml carrying forward?"
dev
modified on Friday, April 17, 2009 6:04 AM
|
|
|
|
|
devvvy wrote: I want to answer key question - "Do I want to put app.config in xaml carrying forward?"
Short answer - it depends. If it's something that fits neatly into app.config, e.g. a connection string, then leave it there. If it's something that you need the power of XAML for, then put it in the XAML.
"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
|
|
|
|