|
thanks.. great.. but it took about 1 second to display the tooltip message when i hover the mouse over the texbox..
so in my textblock i put a image beside the textbox
<TextBlock DockPanel.Dock="Right"
Foreground="Orange"
FontSize="12pt">
<Image Stretch="None" Source="error.gif" />
</TextBlock>
can i display the message when i hover that image instead of hover the textbox?
|
|
|
|
|
Not sure if you can display a ToolTip in the Adorner Layer.
You can try and alter the code so that the ToolTip for the above TextBlock, but I'm not sure, I've never tried.
There is a property on the ToolTipService that controls how long it waits before displaying the ToolTip. Look into this and change the value.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Could you recommend me a good way to render 3D text in a simple way?
|
|
|
|
|
|
Hi,
I have also googled.
The first link doesn`t work. I included it into my project and it produces RuntimeException.
The second one doesn`t contain any code - or I just couldn`t find it.
|
|
|
|
|
Does his code work independently of your code? If so, you may need to look at what you are doing.
Did you try taking the files from the \Text3D folder and just including them in your project? Then you can use the methods.
I see what you mean about the second link but there are others out there.
You can also write Charles Petzold the author of the article. His email is at the bottom of the first article.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi, I've spent a good couple of days trying without luck to solve this problem I've run into to with my WPF browser application. Basically this is what I have :
A WCF service with a method that returns a large array which is called from my WPF browser application (XBAP). The XBAP is partial trust with the security zone set as "Internet". I'm using VS2008 team system.
I need to increase the maxReceivedMessageSize so that the array can be passed to the XBAP. I'm using basicHttpBinding so I need to increase the maxBufferSize by the same amount as well. My app.config file for the XBAP looks like the following:
<configuration>
<system.servicemodel>
<bindings>
<basichttpbinding>
<binding name="BasicHttpBinding_IService1" closetimeout="00:01:00">
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="1000000" maxBufferPoolSize="524288" maxReceivedMessageSize="1000000"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384">
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None" />
</readerquotas></binding>
</basichttpbinding>
</bindings>
<client>
<endpoint address="http://{machine_name}/WcfWinService/Service1.svc">
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
</endpoint></client>
</system.servicemodel>
</configuration>
But when I change the maxReceivedMessageSize and maxBufferSize by any amount I get a "System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." exception.
The stack trace I get back is :
Startup URI: http://{machine_name}/WpfBrowserApp/WpfBrowserApplication.xbap
Application Identity: http://{machine_name}/WpfBrowserApp/WpfBrowserApplication.xbap#WpfBrowserApplication.xbap, Version=1.0.0.33, Culture=neutral, PublicKeyToken=d11ee682d0580e4f, processorArchitecture=msil/WpfBrowserApplication.exe, Version=1.0.0.33, Culture=neutral, PublicKeyToken=d11ee682d0580e4f, processorArchitecture=msil, type=win32
System.Windows.Markup.XamlParseException: Cannot create instance of 'Page1' defined in assembly 'WpfBrowserApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Page1.xaml' Line 1 Position 7. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---><b> System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</b>
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
<b> at System.Net.HttpWebRequest.set_DefaultMaximumErrorResponseLength(Int32 value)</b>
at System.ServiceModel.Channels.HttpChannelFactory.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelFactory.TypedServiceChannelFactory`1.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.ChannelFactory.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
at System.ServiceModel.ChannelFactory.EnsureOpened()
at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
at System.ServiceModel.ClientBase`1.CreateChannel()
at System.ServiceModel.ClientBase`1.CreateChannelInternal()
at System.ServiceModel.ClientBase`1.get_Channel()
at WpfBrowserApplication.ServiceReference1.Service1Client.GetData(UserObj[] users)
at WpfBrowserApplication.Page1..ctor()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Net.WebPermission
I also created a normal ASP.net web application and tried increasing the maxReceivedMessageSize and maxBufferSize and calling the wcf service from there to test it with no problems at all.
Please help
modified on Thursday, February 21, 2008 3:45 AM
|
|
|
|
|
|
Thanks for your help Karl. Yes this would indeed work but I need to get my solution working in partial trust as I would like it to be used in the Internet zone. Is there any way to get it working without installing certificates on all the client machines?
|
|
|
|
|
|
thanks karl, but the article doesn't really solve my issue. let me rephrase this then:
Is the any other way I can send a large dataset across from a WCF service to an XBAP WPF browser app without changing the maxReceivedMessageSize settings as it seems there is no way to change the settings in partial trust as the "WebPermission" needed to do this cannot be granted. Can the setting be changed globally on the machine itself instead of in the application (like modifying the machine.config or something similar?)
It seems really stupid that a simple task like this would be impossible
|
|
|
|
|
Hashen wrote: Is the any other way I can send a large dataset across from a WCF service
Any way to break the dataset into smaller pieces and merge the parts on the XBAP side?
Can you compress it and ship the compressed bytes across the wire?
Are you using efficient binary serialization for the dataset?
Hashen wrote: Can the setting be changed globally on the machine itself instead of in the application (like modifying the machine.config or something similar?)
What setting?
Any setting in web.config, can be set in machine.config.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Karl Shifflett wrote: Any way to break the dataset into smaller pieces and merge the parts on the XBAP side?
This would be possible but not ideal
Karl Shifflett wrote: Can you compress it and ship the compressed bytes across the wire?
Could you point me to an example on how I can do this for an object array please?
Karl Shifflett wrote: Are you using efficient binary serialization for the dataset?
I'm not quite sure what you are referring to when you say efficient binary serialization. Could you please elaborate a bit for me.
Karl Shifflett wrote: What setting?
Any setting in web.config, can be set in machine.config.
I'm reffering to the maxReceivedMessageSize and maxBufferSize setting for the basicHttpBinding that I'm using. My thinking was that if I could increase these settings globally and permanently on the machine then the application would take the increased values as default and there would be no need for the application to request for web permission to increase these values.
Thanks for all your help so far
|
|
|
|
|
|
Yes this is possible.
I finally found the answer to this here...
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2196129&SiteID=1
Quote:
"The problem is not with MaxReceivedMessageSize but with MaxBufferSize. MaxBufferSize seems to have a limit of 65536 in partial trust mode. To get around this you can leave MaxBufferSize at 65536 and change the transferMode to Streamed or StreamedResponse."
After doing this you can set the MaxReceivedMessageSize to as big as you need.
|
|
|
|
|
I could have asked this in a number of sections, I know, but the following is using WPF..
I'm working on an application that graphs data for given time intervals. For example, I could be collecting data in real time, and i'm graphing the last 5 minutes of the data up to the current point. When I have multiple axes, the number of points for each axis can become large fast. I have to go though and process all of these points every time I update the graph. When I have points that are in a pattern, or straight line, it doesn't make since to keep all of the ones in the middle. Does anyone know of any algorithms/data structures to efficiently process a large number of coordinates?
Thanks!
|
|
|
|
|
Hi,
somehow, I don't see why you posted this to the WPF Forum: You are asking for a data structure or an algorithm. This is independent from the way you display it.
Next, why do you have to process all points every time you update? Do you need real-time averages or something? Just moving the graph can certainly be accomplished in a smarter way.
Concerning patterns/straight lines: Are you sure that your data will ever show up something like that? Measurement data is almost never precise enough.
There are, however, interpolation and approximation algorithms using polynomials, splines, etc. But this is not exact anymore, and if the algorithm screws up, you might not notice that (e.g. you data jiggles wildly but the interpolation comes up with an almost straight line). In general, if this is measurement data, you should keep the original input somewhere or have your algorithm determine the interpolation/approximation error. It really depends on what you're up to. Note that these algorithms are usually computationally expensive, so it is probably not a good idea to apply them in real time. Are you sure you will have so many points that memory will be the bottleneck?
Cheers,
Chris
"Obstacles are those frightening things you see when you take your Eyes off your aim"
- Henry Ford
Articles
Blog
|
|
|
|
|
Thanks Chris,
I understand that the there are other places i could have posted it, but since i'm utilizing WPF, i thought there might be some features or anything else i didn't know about. Oh well.
I agree, measurement data would be too difficult to find patterns. I'm displaying the data in real-time (say 10 points/sec), and could have up to 6 axes. I'm using the Polyline in WPF, and it's just something that could potentially be a processing/memory bottleneck.
Thanks for the help though
|
|
|
|
|
There is no anchor property in WPF, yet there are VerticalAlignment and HorizontalAlignment which do simply the same. But there is one problem:
Suppose that I have an Image control with some png image loaded. When I put this control in the center region of my form and set both Vertical and Horizontal Alignments to STRECH, everything works fine. But when I move this Image towards form`s edges - for example towards top, the VerticalAlignment changes from STRECH to TOP. When I try to change VerticalAlignment back to STRECH, the Image control automatically moves to center region of the form.
How to enable streching in both directions while an element is near the edges of the form?
Thank you for any help in advance
|
|
|
|
|
Moving an image in the designer can sometimes change its anchoring automatically, which can be really annoying. However, you can, after moving the image in the designer, directly change its anchoring in the designer, too.
If you select the image, then each of the 4 sides of the image will have either an empty circle or an anchor bar, depending on whether or not the image is anchored on that side or not. Clicking the empty circle will change it to an anchor bar, and clicking the anchor bar will turn it to an empty circle.
|
|
|
|
|
|
Hi,
I have a WPF form for the user to edit some details of an object. Most of the fields are fairly simple text/numeric style fields. I've bound the controls to the properties on the object being edited, and everything works great.
Except, how do I cancel the changes when the user hits the cancel button?
Simon
|
|
|
|
|
Simon,
You have some options.
1. You can keep a copy of the object and replace the original values from the copy if the user cancels.
2. If this is a database application, just reread the record from the database. (or reread from the original source)
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Thanks Karl,
I was hoping there was something simpler than that. To be honest, it's easier to just go back to the old style and copy the object to the controls when the form is opened, then from the controls to the object when the user hits OK. I don't get the advantage of data binding. Am I missing something?
Simon
|
|
|
|
|
Yes I think you may be missing a number of built in features.
WPF 3.5 now supports the IDataErrorInfo interface.
There is plenty of info out there on WPF object data binding.
I'm working on an article today that includes a notification control that is wired up to the business object.
I about 2 weeks I'll also have a the 4th in my WPF Business Application series that covers "how to" do a great number of things with the data binding and business objects.
Trust me, you want to try and use the WPF Data Binding. Very powerful.
Bea Costa is the First Lady of WPF Data Binding. Here blog is here: http://www.beacosta.com/blog/[^]
modified 27-Feb-21 21:01pm.
|
|
|
|