|
Hi,
Somehow it takes ~5 sec to open my Silverlight web site at 1st visit. I built it using Visual Studio 2008 and Expression Blend 3. In deployment, I compiled and then uploaded the folder to the hosting. This my first Silverlight application. I believe I didn't do anything particularly smart or stupid. Here is the [link^].
How do I shorten the first open time? Thanks!
Best,
Jun
modified on Sunday, February 27, 2011 10:48 AM
|
|
|
|
|
It takes time to download the app the first time, then it gets cached on the local PC.
|
|
|
|
|
Thanks.
Is there a way to speed up the first request? It's a shame that the performance of my web site is so poor and I dare not show it to others.
Best,
Jun
|
|
|
|
|
There are some ways.
1) Break your app into smaller xap's and load the other xap's on demand.
2) Make sure copylocal is set to false in your projects (except the first one that loads).
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
I have just started using VS2010 and have written the tiniest possible WPF program using a MediaElement, with an openFileDialog to load a Uri filename into the Source property of the MediaElement.
It works fine with a .WMV file, but any other sort of file (.MPG, .AVI, even .JPG) causes a message to come up "Debugger detected - please close it down and restart".
My research so far indicates that it is some sort of clash between video codecs, the most common theory being something to do with Nero 6/7 and the DivX codec. I do have Nero 6 installed, but I've checked in Control Panel | Sounds and Audio Devices | Video Codecs, and although I have a whole list Video Compression Codecs, none is called DivX or anything with Nero in the name.
I could uninstall Nero 6, but I do use it, and it seems a bit drastic for what must be basically a bug somewhere that needs fixing.
I have also downloaded GraphEdit, which seems to be the diagnostic tool of choice for this problem, but not being an expert in video codecs I haven't the faintest idea what to do with it now that I've got it. (I tried Graph | Insert Filters, but there are a million of them to choose from!)
I am running XP pro, and my program is in C# under VS2010.
I would really appreciate some help.
(NB This problem has obviously been around for a while - I'm finding posts about it from as early as 2005 - but no solutions!)
Dave
|
|
|
|
|
Those video formats are not supported in Silverlight
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Sorry, in which bit of my post did I mention Silverlight? I'm using WPF, and anyway this is obviously not a problem of what formats are supported - and if you read the documentation they quite clearly ARE supported.
Dave
|
|
|
|
|
For the benefit of anyone reading this, after much searching I did eventually find the solution. It does seen to be a problem caused by Nero (anyone who wants a more technical discussion might like to look at my thread here[^], which was mostly over my head). I finally found the solution here[^], which was to rename c:\Program Files\Common Files\Ahead\DSFilter\NeVideo.ax to something else. This fixed it immediately, didn't even need a reboot. I don;t know whether this classes as a "bug" or a "feature" in Nero 6, or whether it has been fixed in later versions. By all accounts it only affects programs when they are being debugged, so shouldn't be a problem for the released version. Hope this helps someone else.
Dave
|
|
|
|
|
Hello CP, a few days ago I read a very interesting article about using XAML differently (And Now for XAML Completely Different) which I thought was a really cool way to use the XamlReader so I decided to implement a behaviour tree this way because I'm currently toying around with some game AI logic.
I've implemented all the behavior tree specific logic now however I'm stuck with how to bind the XAML together with the game lib to execute different functions and check for different conditions.
Here's an example of what my XAML looks like for a small behavior tree which doesn't work:
<Root
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns="clr-namespace:XamlBT.BT;assembly=XamlBT"
>
<Root.Child>
<Sequence>
<Execute Function="{d:Binding StaticFuncs.Func}" />
</Sequence>
</Root.Child>
<Root.Condition>
<IfNot State="{d:Binding StaticFuncs.B}"/>
</Root.Condition>
</Root>
and my Execute class looks like this:
public class Execute : DependencyObject, INode
{
public bool Evaluate()
{
if (Function != null)
{
return Function();
}
return false;
}
public int Priority { get; set; }
public Func<bool> Function
{
get { return (Func<bool>)GetValue(StateProperty); }
set { SetValue(StateProperty, value); }
}
public static readonly DependencyProperty StateProperty = DependencyProperty.Register(
"Function", typeof(Func<bool>), typeof(Execute), new PropertyMetadata(null));
}
Right now the above code fails without ever resolving any of the properties
What I would like to be able todo is to bind a static methode which returns a bool and takes no parameters (or at the very least a static Func<bool> property but that is less desirable because it means repetetive code) to a Execute node's delegate or Func<bool> property so i would avoid lots wrapping functions into node types... Anyone that have a solution to my problem or maybe even a completly different aproach?
Thanks in advance and sorry for the rather bad English, especially the explenation because English is not my native language and the kind of English i'm used to talking doesn't involve explaining code intentions
|
|
|
|
|
Is there any way to force the client's brower to update the cache of a silverlight application after I have updated it? It doesn't happen automatically for some reason.
Brent
|
|
|
|
|
I got stung with this recently, there seems to be 2 ways to do it, someone mentioned that you can make a change to the web config file and it will force the refresh (add a space and remove it was quoted)
However the method I use is to change the footprint of the aspx by adding a paramter to it, and parameter just so long as it changes from 1 deploy to the next. In the following v is the parameter and I simply increment it each deployment.
;param name="source" value="ClientBin/Some.xap?v=3"/>
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Please. You have created a question in one location, do not then go and create a question in another location. The best you can hope for then is a fragmented answer where different people give you information in two locations which is not coherent or, indeed, cohesive.
|
|
|
|
|
Thanks for your comment. the purpose was if somebody check Lounge on daily basis and not interested to view Question and Answer, then my question will get chance for solution.
but any way i got solution from following link: i think this may helpful to people who are looking for the same.
Beginning Silverlight 3[^]
Thanks,
Imdadhusen
sunaSaRa Imdadhusen
+91 99095 44184
|
|
|
|
|
Double posting is strictly frowned upon here. BTW, don't try to condescend to me with your bolding text. I've been an active user on this site for so long that I know the posting rules here. When you post a question in one place, then all of the answer to that question is in one place. When you post it in more than one place then the answer may be dealt with in multiple places. This means that a vital piece of information may be missed because the piece that is needed is in a different location than the one you're answering.
More importantly, these questions are meant to help others with the same problem. If somebody follows a link from Google, Bing or whatever search engine they choose, they may get part of an answer, not knowing that the bit they really need is in a completely different thread.
|
|
|
|
|
Sorry for inconvenience.
Can i delete the question from here?
sunaSaRa Imdadhusen
+91 99095 44184
|
|
|
|
|
Sadly not. Anyway, you've learned a valuable lesson about CPs posting etiquette, so no harm-no foul.
|
|
|
|
|
I have one main View inside that view i have multiple views(usercontrol) it is basically a Form to get the patient records.
Now how i can pass the values of main ViewModel to the Child control ViewModels and then get the value back when user save the Form Main View?
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
Presumably you have static versions of your viewmodels so the state of the data has not changed when you move from one control to another. Therefore when you save the main VM all the other data is sitting there ready to be saved in the other VMs.
This may break the MVVM model as the main VM is aware and uses the other VMs but as I'm not a purist so it does not bother me, I even have code in the codebehind (shock horror).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Don't know about MEF in particular, but how does it construct all the VMs to put 'inside' your main VM -
The way I would do it (no Framework) would be to have references to each of the child VMs in my main VM (thus your main VM is truly describing the interaction)
The alternative is to use a Controller (or some singleton class) to which every viewModel has a reference, and so can use this to communicate. This allows for better abstraction (e.g. your main VM asks the Controller "save the patient's data, because the Save button command has been raised by my View"
The Controller either has direct access to the various data used by the other VMs, or has access to the other VMs from where it can obtain that data (e.g. VMBloodPressure, give me your data...)
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
_Maxxx_ wrote: The alternative is to use a Controller
Isn't that just moving the linkage one step away, the controller still needs to be aware of all the VMs
Here is another thought, how about a message style where the main VM sends a message to save and the other VMs consume the message. All the VMs must subscribe to the message pump.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: the controller still needs to be aware of all the VMs
You're right - but I don't see not nuffin' wrong with that.
IN the example cited by the OP I would probably have a property of VM1, VM2 etc. in my parent Vm - and access either methods, messages or events on or from them.
The controller just allows for more consistent communication - your children VM ask the controller to do something (Hey controller, this data has changed, better handle that for me). The Controller then says to itself "Hey! this is a change in this data - I better let everyone know!" so it raises an event/sends a message/calls a method on a VM - whatever to let those interested parties know.
Mycroft Holmes wrote: how about a message style where the main VM sends a message to save and the other VMs consume the message.
Not sure that works - if a child Vm receives the message, how does it give the modified data back to the parent VM?
I prefer the "I've changed something, please deal with it" paradigm, rather than the "Hey, have you changed anything? If so, give me the changes." paradigm.
(Although, now I am thinking about at least implementing a "Some data has been changed by this VM" property in my base VM class - which in turn can send a message... So now the Parent VM can subscribe to any Child VM messages, and the message (at least potentially) can carry the modified data.
Hmmm
Child Vm1 changes the patient BP - it is now 'dirty' and sends a message to say so.
Parent Vm0 has subscribed to the "BP Has Changed" message which carries with it a BP object.
VM0 saves the data to the repository and sends out a "BP Has been Saved" message - which is (of course) subscribed to by the Vm1, which resets itself to "Clean"
Sorry to think outloud in a reply - no sensible buggers at work to talk to!
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
I go with the last scenario (after Hmmm) except (there is always an except)
I would have vm1 (child) deal with it's own data (save to the DB) and tell VM0 that the data was saved. This assumes the database structure reflects the actual data where VM0 is the patient and VM1 is a BP record.
VM0 may need to reload the list of BP records when told by VM1 that the record was saved and this would be prompted by the message pump.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Because this is a medical system (and the last system I developed was a medical system!) there may be requirements to save multiple uncommitted changes at one time; In fact in the system I developed, I did exactly what you are suggesting, but used a caching mechanism at the back-end so nothing was finally committed until the consultation was complete.
It's amazing how much one can learn posting on CP! I'm in a situation where I am pretty much the sole developer, so don't have minds to bounce ideas off - every day I get home and completely change my MVVM application!
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
@max thanks i think controler will help me.
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|