|
I am developing a video asset manager for clips and full movies using Silverlight 3. It plays many different flavors of clips and everything works fine on the PC.
This problem is strictly a problem when on a Mac using Leopard and/or Snow Leopard with current updates. It has been a problem on several types of Mac machines, from a beast of a Mac Pro, to a standard Mac Mini, to a MacBook Pro that is relatively new. I tested with Safari 4 and Firefox 3. Both had the issue.
We have an issue using progressive download for full movies, yet shorter clips of 10 minutes or less are fine. This is only with a Mac; there are no problems at all on the PC. The details on the file we are currently using to test with are at the end of this entry.
The problem is: when the movie is played, it plays fine. It starts downloading, but once it hits a certain point (roughly 80% to 98.8%) the downloading stops and the player will no longer play or do anything. The silverlight app is not frozen on a fast machine though and I can navigate to other screens within the app and go back to the player, but the same problem still exists. We were streaming it from a server in that was not local, then tried streaming on a local network machine (which was much faster to test) but still had the problem.
I did notice that the % that is loaded before the player freezes is pretty constant for each instance of browser used; i.e. if I open Firefox, it will download to 80% 9 out of 10 times. Then if I close Firefox and re-open it will download to 89% 9 out of 10 times.
Tested on a Mac Pro with 8 cores at 3GHz, 12 GB RAM and OS X (10.5.8), the silverlight app does not freeze. Tested on a Mac Mini with 1.83 GHz Duo, 1 GB RAM and OS X (10.5.8) the silverlight app crashed in safari, but not in firefox, though firefox performance was very bad when the problem occurred.
I have searched all over the net for some data on this problem without any luck.
I tried disabling the download status update, but the video still froze.
Has anyone encountered this or have any guidance?
Regards,
Justin
--
File info:
General
Format : MPEG-4
Format profile : Apple TV
Codec ID : M4VH
File size : 1.24 GiB
Duration : 1h 54mn
Overall bit rate : 1 556 Kbps
Encoded date : UTC 2010-03-16 04:44:42
Tagged date : UTC 2010-03-16 04:45:58
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.0
Format settings, CABAC : No
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1h 54mn
Bit rate mode : Variable
Bit rate : 1 430 Kbps
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 23.976 fps
Resolution : 8 bits
Colorimetry : 4:2
Scan type : Progressive
Bits/(Pixel*Frame) : 0.194
Stream size : 1.14 GiB (92%)
Language : English
Encoded date : UTC 2010-03-16 04:44:36
Tagged date : UTC 2010-03-16 04:45:58
Color primaries : BT.601-6 525, BT.1358 525, BT.1700 NTSC, SMPTE 170M
Transfer characteristics : BT.709-5, BT.1361
Matrix coefficients : BT.601-6 525, BT.1358 525, BT.1700 NTSC, SMPTE 170M
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 1h 54mn
Bit rate mode : Constant
Bit rate : 121 Kbps
Nominal bit rate : 128 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Stream size : 99.4 MiB (8%)
Language : English
Encoded date : UTC 2010-03-16 04:44:37
Tagged date : UTC 2010-03-16 04:45:58
|
|
|
|
|
VS2008, SL3...
I have a UserControl that dyanically adds buttons in a grid. I want to display another UserControl when the user clicks one of those buttons, essentially replacing the UserControl on which the user clicked the button.
In a nutshell...
User naviagtes to my SL app
UserControl A is displayed
User clicks a button in A
UserControl B is displayed
--------
How do I do this?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
You need to look at this[^].
Another approach actually could be to use Microsoft Prism - this allows you to remove and add regions into a placeholder (but this would mean re-designing your application to adapt to Prism).
|
|
|
|
|
You can create multiple templates for the data grid (or any controls), and switch them at runtime. If you use Prism, you can specify a region in the data grid, and use the region manager to register a view (or multiple views).
|
|
|
|
|
Hi there!
In our application (we use MVVM pattern) we have a treeview that uses a ViewModel as DataContext. Each node then has its own ViewModel. Depending on the type there are different HierarchicalDataTemplates. In other words we have a ViewModel hierarchy. This works without any problems.
Now I implemented a context menu that should enable the user to open a modal dialog that shows some properties of the ViewModel (actually of the underlying business object). As it is not easy to open a modal dialog with MVVM pattern, I used the WPF Quick Recipes - Dialogs[^].
To abbreviate things, I need to place the following code snippet within my TreeViewItem. This is responsible to show the modal dialog when setting the ModalDialogViewModel property. I need to put this into the treeviewitem in order to get the correct DataContext from the ViewModel of the item.
<FrameworkElement DataContext="{Binding Path=ModalDialogViewModel}">
<behaviour:DialogBehavior.DisplayModal>True</behaviour:DialogBehavior.DisplayModal>
</FrameworkElement>
Where and how can I place this in my TreeViewItem. ControlTemplate? DataTemplate?
Hopefully you understand what I mean. Otherwise tell me, what's not clear!
Thanks in advance!
Florian
modified on Tuesday, April 13, 2010 9:53 AM
|
|
|
|
|
OK, I try to give more information. Maybe the last post was misleading. I have the following attached property (shortened):
public class DialogBehavior
{
public static DependencyProperty DisplayModalProperty = DependencyProperty.RegisterAttached("DisplayModalProperty",
typeof(Boolean),
typeof(DialogBehavior),
new UIPropertyMetadata(false, AttachToDataContextChanged));
public static void SetDisplayModal(DependencyObject target, Boolean value)
{
target.SetValue(DialogBehavior.DisplayModalProperty, value);
}
public static Boolean GetDisplayModal(DependencyObject target)
{
return (Boolean)target.GetValue(DisplayModalProperty);
}
private static void AttachToDataContextChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
{
FrameworkElement element = target as FrameworkElement;
element.DataContextChanged += (a, b) =>
{
var dialog = new Dialog();
dialog.DataContext = b.NewValue;
dialog.Owner = Application.Current.MainWindow;
if (GetDisplayModal(target))
{
dialog.ShowDialog();
}
else
{
dialog.Show();
}
};
}
}
}
When this is attached a handler for the DataContextChanged -event is registered. The handler opens a dialog when the DataContext changed.
Now I need to nest a FrameworkElement which is holding the DataContext into a TreeViewItem . What I did up to now is the following:
<HierarchicalDataTemplate DataType="{x:Type ViewModels:TreeNodeViewModel}"
ItemsSource="{Binding Children}">
<StackPanel>
<FrameworkElement DataContext="{Binding Path=ModalDialogViewModel}">
<behaviour:DialogBehavior.DisplayModal>True</behaviour:DialogBehavior.DisplayModal>
</FrameworkElement>
<TextBlock Text="{Binding DisplayName}" />
</StackPanel>
</HierarchicalDataTemplate>
But, as soon as new TreeViewItem s are added, I get a first chance exception of type 'System.NullReferenceException' occurred in PresentationFramework.dll. The problem must be in my DialogBehavior. Because as soon as I take this out, the code works.
So what is my mistake?
I appreciate any ideas!
Florian
|
|
|
|
|
OK, finally I found the mistake:
The first parameter in the constructor of the DisplayModalProperty needs to be "DisplayModal" instead of "DisplayModalProperty".
public static DependencyProperty DisplayModalProperty = DependencyProperty.RegisterAttached("DisplayModal",
typeof(Boolean),
typeof(DialogBehavior),
new UIPropertyMetadata(false, AttachToDataContextChanged));
No, answer! Anyway, thanks to everyone who thought about it!
Florian
|
|
|
|
|
i want to open my control in new browser window
currently i m using radwindow control but its not opening new browser window.
below is sample code of mine
frmEntityMaster = new EntityMaster();
window.Content = frmEntityMaster;
window.show();
please please let me know is it possible to open this in new window browser.
because in silverlight we have only one aspx page where we used to load
usercontrol that's why HtmlPage.Window.Navigate option is eliminated in mine case because i need not open another uri i have navigate in my applictation but with new browser window
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|
|
Did you check the rad controls website?
You might find some documentation available there.
|
|
|
|
|
yes i did checked with rad controls website but i did not find anything
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|
|
Hi guys, after some advice.
We're currently using Prism to architect an MVVM soulution to one of our business requirements. The requirement is essentially to allow detail record editing in a form. The form itself will contain several drop down lists to limit what the user can choose. My question is how / at which point should we be getting the items to fill these drop downs. As it stands, when we return the "record" to be edited (see next question also), we're also returning all of the lookup lists and binding at that point - is this the "de-rigeur" way of doing it, or should we be making multiple calls - one for the data, one for the lookups?
Secondly, our view model currently contains an entity field, which we're using to bind to controls via a binding Path - something like {Binding Path=Customer.Name}. Now the entity class (Customer) implements INotifyPropertyChanged, and when one of (For example), my text fields change, the entity itself correctly updates and fires PropertyChanged event, but the ViewModel appears not to pick this up. The problem is that I need to intercept the change (or at least know that it's happened) at the ViewModel to requery some CanExecutes for commands. The only way around it I can see is to expose a filed per field on the form as separate properties, and then munge them together into the object when necessary, but this seems like overkill to me - is there another "recommended" way of doing it?
C# has already designed away most of the tedium of C++.
|
|
|
|
|
RichardGrimmer wrote: My question is how / at which point should we be getting the items to fill these drop downs. As it stands, when we return the "record" to be edited (see next question also), we're also returning all of the lookup lists and binding at that point - is this the "de-rigeur" way of doing it, or should we be making multiple calls - one for the data, one for the lookups?
I always feel that this depends on 1) how much data do expect to be returned on an average scenario 2) how you expect your application to be deployed - making multiple calls to different web services is not always a good idea - but if you are going to deploy your application on a intranet, I would say it would also not be a huge performance hit. After all, you will be making async calls, anyway.
RichardGrimmer wrote: Secondly, our view model currently contains an entity field, which we're using to bind to controls via a binding Path - something like {Binding Path=Customer.Name}. Now the entity class (Customer) implements INotifyPropertyChanged, and when one of (For example), my text fields change, the entity itself correctly updates and fires PropertyChanged event, but the ViewModel appears not to pick this up. The problem is that I need to intercept the change (or at least know that it's happened) at the ViewModel to requery some CanExecutes for commands. The only way around it I can see is to expose a filed per field on the form as separate properties, and then munge them together into
Are you using two-way binding?
|
|
|
|
|
Abhinav S wrote: I always feel that this depends on 1) how much data do expect to be returned on an average scenario 2) how you expect your application to be deployed - making multiple calls to different web services is not always a good idea - but if you are going to deploy your application on a intranet, I would say it would also not be a huge performance hit. After all, you will be making async calls, anyway.
That's what I figured- it's a judgement call....
Abhinav S wrote: Are you using two-way binding?
Absolutely....
C# has already designed away most of the tedium of C++.
|
|
|
|
|
I just noticed that your class Customer actually implements INotifyPropertyChanged.
The alternative to this could be to allow your view model to implement it. Bind your xaml control to a property in the view model - a property that represents your customer entity. Using this, you should be able to get a notification to your view model.
|
|
|
|
|
Now you see, that was how I had things set up originally. The problem is (as I mentioned) with CanExecute functions being called for my various commands - the binding is successfuly updating the entity. If I implement INPC on the entity, then I know that a field has changed at that level, but there's no way to let the ViewModel know, and since that's where the CanExecute functions live, it's never getting called.
Going the other way, if I implement INPC on the VM, then it correctly calls CanExecute when the entity itself changes, but not when one of the fields changes...
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hi,
I am unable to select an item of a particular value of a combobox in wpf.
For example say i have a textbox, a button and a combobox. The combobox has 3 items with values as 1 , 2 , 3 and display text as a , b , c. On load of the window these values and text gets binded to the combobox. On load nothing is being selected i.e. the combobox is blank.
Now when i type 1 in the textbox and click the button i want to show the value 1 as selected i.e. on click of the button "a" should get displayed.
Can anyone please help. Thanks in advance.
Regards,
Samar
|
|
|
|
|
Are you using MVVM pattern?If so then bind the SelectedValue of combobox to a property in view model and while clicking button set that property in view model.
|
|
|
|
|
Hi arun,
No i am not using MVVM. I want to keep this simple but yes i do not want to do it in xaml. I can do it in xaml by using binding and elementname.
I want to do it in c# code. Is there anything in wpf which is similar to the following what we do in web?
DropDownList1.Items.FindByValue("1").Selected = true;
modified on Tuesday, April 13, 2010 5:32 AM
|
|
|
|
|
comboboxId.SelectedValue = yourvalue.
But instead add a property in the code behind, bind it to the selected value of combobox and while clicking button set that property.
|
|
|
|
|
Thanks a million Arun!!! This solved by problem. I had tried this earlier but somehow was not able to get through but now it is working. thx again..!!!
|
|
|
|
|
Happy to see that your problem solved.
|
|
|
|
|
Samar Can u try with the selectedItem .......
|
|
|
|
|
Hi sunil i tried with selecteditem but it is showing me null as there is nothing selected.
|
|
|
|
|
Ok can u loop throught the source that u have binded and get the excat object that satisfy u r requirement and make that object as the selected item .Beacuse the data binding concept is something different in WPF
|
|
|
|
|
I think selected item was again throwing me null or something. I do not remember correctly now. But i got thru with the problem as below. Thank you very much for your help.
omboboxId.SelectedValue = yourvalue;
|
|
|
|
|