|
Oct
4
Written by:
Jeremiah Morrill
10/4/2009 10:57 PM
The code in the WPF portion of WPF Mediakit was starting to get a little spahgetti-ish. This was mostly do to me trying to handle as many usages of this control as possible and also dealing with the async nature of MediaKit. It has to support the XAML parser and code-behind. But what if you had properties set in a certain order in the xaml, but you put them in another order and everything breaks? What if you set the source property and start playing in code-behind, then you put it in the visual tree and it executes the “LoadedBehavior”? Things just weren’t predictable enough. I now use the ISupportInitialize, which is implemented in FrameworkElement and has overrides for BeginInit/EndInit. Now the code is much cleaner and further additions won’t be so confusing and buggy. The idea behind this usage is the xaml parser will automatically call the BeginInit/EndInit when the control is loaded, therefore within the control, we can ensure the properties are set in the correct order and we have some predictability when using the code from code-behind. If you just mainly use the built in MediaKit controls, things should work, but if you use the BeginInit/EndInit when starting to initialize the control and when you are done initializing it. After the EndInit is called and properties are set, the next property changes will go directly to the DShow COM thread. Here is an example of how to create a MediaUriElement from codebehind. 1: var player = new MediaUriElement(); 2: 3: player.BeginInit(); 4: player.Source = new Uri(GetRandomFileFromDirectory()); 5: panel.Children.Insert(pos, player); 6: player.EndInit();
As always, if you have any issues, contact me directly or leave a message on codeplex.
Tags:
15 comment(s) so far...
|
|
Re: Some more breaking changes in MediaKit
I'm definitely interested in EVR support ... how do you think the performance will compare with your VMR9 work?
By replica Dior-Handbag on
1/5/2010 11:14 PM
|
Re: Some more breaking changes in MediaKit
Police on Wednesday were tracking a series of car break-ins, during the past month.
"The whole passenger front window had been shattered, and we knew immediately that my purse had been taken. It was on the passenger floor," said Shannon Reed, who was victimized by thieves.
Reed's purse was in plain view and the thieves took advantage of the easy target, 10TV's Tino Ramos reported.
Ads:クラシックトール,アグ 梨花,UGG ショート,腕時計コピー,ルイヴィトンコピー,コピールイヴィトン
Ads:アバクロ ホリスター,アバクロ 通販,アバクロ レディース,アバクロ 通販,アグ 店舗,UGG アグReed said she knew better. "Frustration, violation," she said. "You feel stupid for doing something like that."
Police said Reed is not the only victim; during the past several weeks more than a dozen cars have been broken into, with thieves stealing everything from cell phones to cameras.
The thefts have happened in parking lots around the city and businesses are now posting signs reminding people to secure their valuables, Ramos reported.
pop:ファッショントール,UGG 通販,UGG ショート,アバクロ メンズ,アバクロ ジャケット,人気 ブランド靴
pop:UGG キッズ,アグ 激安,UGG 取扱店,アグ 販売店,UGGブーツ,UGG 新作,UGG メンズ,IWC時計
It only took Westerville Detective Larry French minutes to find exposed valuables and said people have to use common sense to protect themselves, which means keeping those things out of sight.
hot:ブランドコピー,アバクロ キッズ,アバクロ アウトレット,アバクロ 店舗,アバクロ ダウン
fashon:アバクロ キッズ,アバクロ 新作,アバクロ 激安,アバクロ コピー,アバクロ セール,アバクロ 日本
"Here's some Ugg boots - those are $200 a pair," French said.
French also found keys left in one vehicle. "All someone has to do is shatter one of these windows, take those keys and drive away in this town car," French said.
Police are still trying to identify the men seen using one of the stolen credit cards in a store surveillance video, but have not yet identified any suspects.
Watch 10TV News HD and refresh 10TV.com for additional information.
By アバクロ ホリスター on
1/23/2010 12:22 AM
|
Re: Some more breaking changes in MediaKit
Serach for your air max?Search for your nike air jordan shoes?Onlinepretty,Inc provide you jordan shoes,gucci shoes,mbt shoes and so on.Good quality mbt also means cheap mbt shoes.Plus,gucci handbags.ugg boots sale,uggs.
By ugg boots sale on
2/5/2010 9:11 PM
|
|
|
Re: Some more breaking changes in MediaKit
gucci shoes gucci handbags gucci handbags
By ugg boots sale on
2/24/2010 4:52 PM
|
Re: Some more breaking changes in MediaKit
百度 [url=http://www.sina.com]sina[/url] [url="http://www.baidu.com"]baidu[/url] [url=www.google.com]google[/url] [link=http://www.yahoo.com]yahoo[/link] [a/]http://www.yahoo.com[a]yahoo[/a]
By d on
2/26/2010 9:31 PM
|
|
|
|
|
Re: Some more breaking changes in MediaKit
I agree with you, there are some things that you would love: gucci shoes gucci handbags gucci shoes for men jordan shoes cheap jordan shoes air jordans
By uggs sale on
3/10/2010 9:52 PM
|
Re: Some more breaking changes in MediaKit
thank you for your great post, and I did want to share this. I hope you will also like it, if you think it is spamming, please kindly delete it. thank you!abercrombie see what is this? abercrombie and fitch uk abercrombie and fitch abercrombie fitch uk abercrombie mens abercrombie london
By abercrombie on
3/11/2010 6:47 AM
|
|
|
|
|
ed hardy
ED Hardy Hoodies ED Hardy Hoodies Ed Hardy Swimwear Ed Hardy Swimwear ed hardy tops ed hardy tops ed hardy shoes ed hardy shoes ed hardy t shirt ed hardy t shirt ed hardy shirts ed hardy shirts christian audigier christian audigier ed hardy kids ed hardy kids Ed Hardy Sunglasses Ed Hardy Sunglasses ED Hardy belts ED Hardy belts ed hardy Bags ed hardy Bags ed hardy purse ed hardy purse ed hardy mens ed hardy mens ed hardy womens d hardy womens ed hardy mens shirts ed hardy mens shirts ed hardy mens tops ed hardy mens tops ed hardy mens hoodies d hardy mens hoodies ed hardy mens swim trunks ed hardy mens swim trunks ed hardy mens shoes ed hardy mens shoes ed hardy womens swimwear ed hardy womens swimwear ed hardy womens t shirt ed hardy womens t shirt ed hardy womens tops ed hardy womens tops ed hardy womens pants ed hardy womens pants ed hardy womens hoodies ed hardy womens hoodies ed hardy womens shoes ed hardy womens shoes ed hardy womens clothing ed hardy womens clothing
By ed hardy on
3/15/2010 9:37 PM
|
cheap nike shox
There are wide variety of Nike Shox for both men and women's selection.The Nike Shox Sale are best selling nowadays.Get your own Cheap Nike Shox now.It's definitely time for you to buy womens nike shox and wens nike shox, Wearing them will keep you in a perfect condition.
By nike shox on
3/16/2010 10:43 PM
|
|
|
|