[OzSilverlight] WPF - Play Streaming Media

2008-09-19 Thread Steven Nagy
Hi all,

 

I'm starting on a project and just want some advice around using WPF to play
streaming media.

I have read that the MediaElement can't really do streaming media (only from
MMS uris?).

 

Anyway, any advice/gotchas around this would be greatly appreciated.

 

Cheers,

Steve 




--- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net


RE: [OzSilverlight] A couple of questions

2008-09-19 Thread Miguel Madero
Scott, 

 

This looks like something I’ve been looking for, actually I’ve been
discussing this before with several people and thought we might not see it
til v3. 

Could you let me know more about how to dynamically load the xaps? This
could really help to load 3rd party libraries, frameworks, dlr, etc without
double taxing. 

 

 

 

 Miguel A. Madero Reyes

  http://www.miguelmadero.com/ www.miguelmadero.com (blog)
  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] 
 (871)730-8319
 (871)763-0020
 Peten #509 
 Fracc Florida Blanca, 27260
 Torreón, Coahuila

P Please reconsider your environmental responsibility before printing this
e-mail

The information in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee. If you are not the
intended recipient, any disclosure, copying, distribution or any action
taken or omitted to be taken in reliance on it, is prohibited and may be
unlawful.

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Scott Barnes
Sent: Friday, 19 September 2008 3:34 PM
To: listserver@ozSilverlight.com
Subject: RE: [OzSilverlight] A couple of questions

 

Jonas,

 

Correct but it also depends at what level you’re at and what you define is
secret. In that if a user is authenticated and you have all the “forms” for
example housed in the .XAP (which is fine), then before you accept and
receive data between the client and server you need to sanitize it and
ensure the user doesn’t go rogue. It’s something at times I’ve seen folks in
both Flash and Silverlight space overlook (as once they get through the
security gate, it’s an assumed the user will not interfere with the client).
It can be small things like switching parts of the UI on or off and the more
clues you give a malicious user, the more they have to work with in terms of
figuring out what it is you have written and how you expect data to be sent
back and forth.

 

It’s more of a cautionary tip and I’d highly recommend folks (when it comes
to Admin vs. Public) look into dynamically loading .XAP files or more to the
point bring XAML in over the wire as well.

 

I’ve gotten loading of modules to work dynamically and should post some demo
code around this as it’s quite cool to bring in .XAP files over the wire as
needed. As when you load a .XAP file, it stores it local cache (ie not in
memory) and then feeds from it when it needs it as well, so the tax isn’t
high. You also can do sniff tests to determine if an assembly is loaded or
not and if it isn’t go get it.

 

I’ve taken a framework I wrote in the early days of Flex and ported it over
to Silverlight, (SynergyFlex = SynergyLight) :D and as we draw closer to
Silverlight 2 ship dates I’ll see if I can spare up some time to release it
as a basic starter guide to some of these ideas.

 

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jonas Follesø
Sent: Thursday, September 18, 2008 5:12 AM
To: listserver@ozsilverlight.com
Subject: Re: [OzSilverlight] A couple of questions

 

Scott,

 

On point 3, why would that matter? Even if you fake the response and trick
your Silverlight app (which would be easy, just download the XAP, unzip it,
and have it talk to a different end-point), your XAML shouldn't really
contain any secret information anyway. Your users is not part of your
markup, that's just data. That information should be sent to the user in an
authenticated WCF call So even if you manage to enable the show all
user screen, your service should re-validate on the server side before
giving you that data.

 

But there might be cases where what you describe makes allot of sense. And
partial loading of XAP's is quite interesting stuff - could be useful for
things like composite Silverlight applications, where you download modules
as needed. 

 

 

 

On Thu, Sep 18, 2008 at 5:19 PM, Scott Barnes [EMAIL PROTECTED]
wrote:

Hi Ross! (long time no speak) J

 

1)  You have a number of options, essentially the easiest way is to tap
into the Windows Communication Foundation services and utilize this option.
It's essentially sending data over the wire in XML format, Silverlight has
great hooks already built in to handle these type of requests. We're also
looking to do more here to make things more seamless in upcoming versions. I
can't say more than that, but it will get a lot easier in the long term.

2)  That's the intent going forward. We see a great deal of positive
power with using LINQ inside Silverlight and WPF. It's almost safe to say
out loud to think of LINQ as  you're Data Passport between client and
server. There will be more expansion on this in the future as well.

3)  Security will remain similar or if not the same as ASP.NET today.
The difference is on the client, you essentially need to architect in such a
way that the initial first ask is defining whom the person is and what
their session may look like. From there, it's a case of
CanIHaveAccessTo(args) style security access (given 

RE: [OzSilverlight] Canvas Overflow

2008-09-19 Thread Miguel Madero
Jordan, 

 

I think the main problem is that your C# code doesn’t have semicolons and
looks I don’t know if the compiler recognize the Sub keyboard. 

 

 

I ended up doing this in c# - 

 

Private Sub doClip()

Dim avmb As AnnotationViewModelBase = CType(DataContext,
AnnotationViewModelBase)

Dim r As New Rect(0, 0, avmb.ConfiguredWidth, avmb.ConfiguredHeight)

Dim rect As New RectangleGeometry()

rect.Rect = r

LayoutRoot.Clip = rect

 

 

 Miguel A. Madero Reyes

  http://www.miguelmadero.com/ www.miguelmadero.com (blog)
  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] 
 (871)730-8319
 (871)763-0020
 Peten #509 
 Fracc Florida Blanca, 27260
 Torreón, Coahuila

P Please reconsider your environmental responsibility before printing this
e-mail

The information in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee. If you are not the
intended recipient, any disclosure, copying, distribution or any action
taken or omitted to be taken in reliance on it, is prohibited and may be
unlawful.

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jordan Knight
Sent: Friday, 19 September 2008 3:26 PM
To: listserver@ozSilverlight.com
Subject: RE: [OzSilverlight] Canvas Overflow

 

I ended up hacking it a bit…

 

I wanted to bind the values for the clip (as you can move the item around
the screen) – i.e. it’s a magnifying glass for an image…

 

You can’t do this though:

 

Canvas.Clip

RectangleGeometry Rect=”{Binding MyRect}”/

Where myrect is a Rect object from the ViewModel…

 

I ended up doing this in c# - 

 

Private Sub doClip()

Dim avmb As AnnotationViewModelBase = CType(DataContext,
AnnotationViewModelBase)

Dim r As New Rect(0, 0, avmb.ConfiguredWidth, avmb.ConfiguredHeight)

Dim rect As New RectangleGeometry()

rect.Rect = r

LayoutRoot.Clip = rect

 

avmb.ConfiguredWidth is from the ViewModel and changes as the drags happen…
I’m not happy with this solution so if anyone can tell me how to bind to
that Clip stuff…

 

 

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of .net noobie
Sent: Friday, 19 September 2008 3:14 PM
To: listserver@ozsilverlight.com
Subject: Re: [OzSilverlight] Canvas Overflow

 

Could you used a ScrollViewer, might not be exactly what you after, but
might be able to stop your canvas from going bigger than you wanted?

 

 

On Fri, Sep 19, 2008 at 1:27 PM, Jordan Knight [EMAIL PROTECTED]
wrote:

Hi all,

 

I can't for the life of me figure out how to stop elements in a canvas from
overflowing J

 

I want to truncate content when is too big J

 

Cheers,

 

Jordan

---
OzSilverlight.com - to unsubscribe from this list, send a message back to
the list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net 




-- 
.net noobie™

---
OzSilverlight.com - to unsubscribe from this list, send a message back to
the list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net 

---
OzSilverlight.com - to unsubscribe from this list, send a message back to
the list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net 




--- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.

Powered by mailenable.com - List managed by www.readify.net



RE: [OzSilverlight] A couple of questions

2008-09-19 Thread Miguel Madero
Scott, 

 

Sounds interesting, specially for composite applications (a’la CAB), but I
think that could be a bit complex for simpler views/apps, something like
what Nikhil did with the Scripts was really simple and straightforward, the
only disadvantage I saw was that it added heavy dependencies to the dlr. 

 

 

 Miguel A. Madero Reyes

  http://www.miguelmadero.com/ www.miguelmadero.com (blog)
  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] 
 (871)730-8319
 (871)763-0020
 Peten #509 
 Fracc Florida Blanca, 27260
 Torreón, Coahuila

P Please reconsider your environmental responsibility before printing this
e-mail

The information in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee. If you are not the
intended recipient, any disclosure, copying, distribution or any action
taken or omitted to be taken in reliance on it, is prohibited and may be
unlawful.

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Scott Barnes
Sent: Friday, 19 September 2008 3:52 PM
To: listserver@ozSilverlight.com
Subject: RE: [OzSilverlight] A couple of questions

 

The other benefit of Commands is that essentially you can throw the same
command from different areas within your View, which helps reduce coupling
of the View with how the overall traffic flows within your Client.

 

You can build a FrontController class which marries both the Event and
Command together today. Given that Silverlight has RoutedEvents, one could
simply throw an Event (through a homemade EventDispatcher), the
FrontController catches it and marries the event with a command and then the
command fires a execute method. This in turn will carry out the workflow
required in order to achieve a successful command delivery. Upon a result,
the command can also throw another command (depending on the data returned)
and so on.

 

This is good, as it essentially allows again multiple events to feed off the
same commands (but yet have different semantic value) whilst at the same
time keeping parts of the overall view abstracted from one another.

 

Martin Fowler’s J2EE patterns have some good paths here to follow around
this kind of thing.

 

Actually I feel a blog post + code brewing now.. stand by.. (*cracks
fingers* - time to put my code where my mouth is!)

 

 

--

Scott Barnes 
(Rich Platforms Product Manager)

 http://www.microsoft.com/ Microsoft Corp. | Blog:
http://blogs.msdn.com/msmossyblog http://blogs.msdn.com/msmossyblog |
Mobile: + 1 (425) 802-9503 (New!)

Twitter:  http://twitter.com/mossyblog twitter.com/mossyblog | MSN:
[EMAIL PROTECTED]
P Please consider your environmental responsibility before printing this
e-mail

 

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jonas Follesø
Sent: Thursday, September 18, 2008 8:23 PM
To: listserver@ozsilverlight.com
Subject: Re: [OzSilverlight] A couple of questions

 

Well, I can't answer for Jordan but I'll try to illustrate.

 

While using the Model-View-ViewModel pattern you have all your UI state and
behavior in a separate class. This class is normally set as the data context
on your View (XAML page), and you bind everything against this class. Even
things like IsSaveEnabled to enable the save button. 

 

The View communicates back to the ViewModel by commands. The benefit is that
you don't have any btnSave_Click event handler in your codebehind. Instead
your ViewModel waits for that Command to trigger, and then do the work.

 

The benefit of designing your application using these patterns is that you
can build quite big applications with (almost) no code-behind. This makes
your app easier to test, more maintainable, and easier to work with for a
designer using Blend. So what is the problem? The problem is that there is
no declarative(XAML) way of triggering animations when thing happens. So if
you want to start a storyboard then the ViewModel IsBussy property is true,
you will have to write this code by hand.

 

Typically that would involve listening to a PropertyChanged event in the
codebehind of the form, and when the ViewModel IsBussy changes to true, then
start the storyboard, when it changes to false, then stop it. This isn't the
end of the world, but when we're so close to achieving no-code behind it
would be nice to go all the way. Also, doing this forces your designer to
have a stroyboard with that exact name (say ShowProgressanimation) present,
so you as the developer ends up owning part of the user experience. If the
designer accidentally deletes the storyboard the app will fail at runtime,
or perhaps not even compile. The less named elements in your XAML file the
better.

 

- Jonas

 

On Fri, Sep 19, 2008 at 1:12 PM, Barry Beattie [EMAIL PROTECTED]
wrote:

 It's a PITA to make apps with all the bells and whistles in XAML then have
 to break M-V-VM to finish it off.

got an example to show what you mean? (just curious/wanting to learn)