|
Hi,
I have a Silverlight application in that one page i am having 1-8 videos will present.I placed each media element in seperate canvas. I want to fullscreen one particular media element with outer canvas.
For Full screen individula video I have written the following code
private
void FullscreenChange(object sender, RoutedEventArgs e)
{
if (SLHost.Content.IsFullScreen)
{
ToolTipService.SetToolTip(fullscreen, "Full Screen");
ms1.ScaleX = c;
ms1.ScaleY = d;
SLHost.Content.IsFullScreen = false;
}
else
{
ToolTipService.SetToolTip(fullscreen, "Resize");
ms1.ScaleX = ms1.ScaleX * 5.90;
ms1.ScaleY = ms1.ScaleY * 4.10;
SLHost.Content.IsFullScreen = true;
isFullScreen = true;
flag = false;
}
}
But here I am using same full screen button to resize video.If I use like this its working properly.But I dont want to use same button for Resize if I press Escape it will go to normal stage but its not working like that if I press Escape button it will go to noraml state but the video size is not reducing to original it is in bigger size only.Can you please guide me what is the mistake i have done.If I press Escape button it has to go to normal state and also it has to reduce the video size like previous size.
Thanks in Advance
Pavani
|
|
|
|
|
Hi,
I think full screen Escape functionality is not supported in Silverlight. But you can use double click.
When you double click video which is in full screen mode it will be back to normal size.
|
|
|
|
|
Hello. I am still a newbie in the programming world and I am about to start an IT degree at UNI. Unfortunately they don't teach any of the .net framework at any of the UNI's in my area, so because of this I have to teach myself .net. I have learnt the .net framework in the past through a different tertiary education (we call it TAFE in Australia) however they never taught us WPF.
What I am mainly looking for is advice on the following;
I want to have a main window that includes all the primary navigation controls. From this I want to have a portion of the window that contains a panel that is populated based on what navigation is selected. In the past I have done this simply by using MDI forms. I could try and recreate the MDI forms however I am looking to design applications that are more artistic and because of this I feel as though the MDI forms looks isn't as appealing.
Another way that I can think of doing it is to recreate that portion of the screen as a series of grids that contain the controls for each section and are layered over the top of each other. I can then simply show and hide the grids that a relevant to that section. The problem that I see with this approach is that, depending on the amount of sub pages, this could become a very messy form that is hard to manage. The other problem is that the code for that page will become extremely large, which I would like to try and avoid (I liked how the code for each page was kept separate in MDI forms).
So what is my best option for completing this task? I have considered pages but I am unsure on how these work and if they are a viable option. Also what if I want to do something similar to how Windows media centre does things, in which you start at 1 level and work your way down to the last level being the video? Is this all done on one form with simple show and hide or done through pages with transition effects between each level?
Any advice you can give me is greatly appreciated.
|
|
|
|
|
Keep an eye on my blog (link below). I have a new addition to my Ocean library that includes a ViewManager that does exactly what you are looking for. I'll also be posting a series of articles here on Code Project.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
The WPF Frame control has navigation buttons if that is what you are looking for. Try Kevins Bag Of tricks samples application:
http://j832.com/bagotricks/[^]">
|
|
|
|
|
Thank you for both of your replies. I'm not too sure if these options will help me out. I think for the mean time I might go back to reading more books until I discover what I am looking for.
Also can someone explain to me what the point is for WF and will this help me solve my earlier problem, or is it simply a visual way of doing the code?
Once again thank you
|
|
|
|
|
Say, if I have a data member which is string, I want to specify that its length need to be between 6 to 9 characters, or a data member is positive integer which needs to be less than 1000. Are there any attributes I can apply to data members to do this rather than validate this sort in the code?
Thanks.
|
|
|
|
|
I think you need to validate the business object.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Karl's exactly right. You wouldn't apply the rules on the data member because this is just a contract - it's not a business rule, because your rules may change, but your contract should remain the same. I would also add a check in your client code as well.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I think it's still useful if it's able to specify some constraints on data contracts, the reasons are the same as it in XSD. Besides, when publish those data contracts, WCF still makes use of XSD, right?
|
|
|
|
|
As of right now there is no native Attribute-based method of doing this. However, it is not difficult to create your own framework and set of attributes to encapsulate this behavior.
Soon (well more like next year), Microsoft will be releasing the RIA services framework for Silverlight. It includes an attribute based method of providing validation. Eventually, it will be made available for WPF.
If you have a more pressing need, this is something I've been looking into and could be convinced to accelerate my process on it. I've been a bit stagnant lately and need to get my finger on the keys (outside of work). Let's connect and I can get information on what you would need a validation framework to do and how you'd like to use it.
|
|
|
|
|
That's be great, thanks very much.
My email
|
|
|
|
|
Does anyone know the answer to this question? I can' find the answer anywhere. I found this information at this[^] site:
"Because of its exceptional performance and quality, Advanced Audio Coding (AAC) is at the core of the MPEG-4, 3GPP and 3GPP2 specifications and is the audio codec of choice for Internet, wireless and digital broadcast arenas. AAC provides audio encoding that compresses much more efficiently than older formats, such as MP3, yet delivers quality rivaling that of uncompressed CD audio."
Therefore it would be most surprising if MediaPlayer doesn't support this format. What are the file extensions for AAC? I haven't been able to find out that information, either.
|
|
|
|
|
No, I am sure it does not. Why would it be surprising ? The media control in WPF barely works, why would it have all the latest formats in it ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I'm absolutely shocked to hear this. If what you say is true, I was completely mislead by Matthew MacDonald's book, Pro WPF in C# 2008 and had big plans for adding music to my application, which has been requested for years.
Christian Graus wrote: Why would it be surprising ?
Because MacDonald's book makes statements like this: "The support WPF provides for audio is a signficant step up from previous versions of .NET...WPF gives you the ability to play a wide variety of sound formats, including MP3 and anything else supported by Windows Media Player."
You also say,
Christian Graus wrote: The media control in WPF barely works, why would it have all the latest formats in it ?
According to this[^] article, AAC has been around for ten years. I'd hardly call that one of the "latest" formats. And who said it had "all the latest formats" to begin with? I asked about one format. Are you absolutely certain you know what you're talking about? Sounds as if you got up on the wrong side of the bed this morning, and I need to do some more research to find out whether it's even worthwhile for me to embark on this project.
[Edit] So here is a quote from another book, Windows Presentation Foundation Unleashed: "You won't be able to build a professional audio application solely using WPF, but you can easily enhance an application with music and sound effects!"
"Easily enhance" sounds a long way from your, "media control in WPF barely works" assertion. I just want my customers to be able to start some sound files when they start a picture show. If they have AAC files and I can only support MP3 files and they absolutely have to play their AAC files, I also found out that there are readily available conversion tools that will go from AAC files to MP3 files, so I don't think your alarmist attitude about "media control in WPF" is warranted for the simple things I want to do. So go sow your sour grapes somewhere else, and next time try to be a little more constructive.
modified on Monday, July 6, 2009 9:43 AM
|
|
|
|
|
fjparisIII wrote: Because MacDonald's book makes statements like this: "The support WPF provides for audio is a signficant step up from previous versions of .NET...WPF gives you the ability to play a wide variety of sound formats, including MP3 and anything else supported by Windows Media Player."
ROTFL. I can play all that in ANY C# application. And, that's exactly what I thought I said. IF I didn't, I must have deleted it, bc I typed it in at first. It uses WMP, so it plays what WMP plays, which probably means you can play other formats IF you install a filter for WMP support.
They've added NOTHING, they gave you WMP, same as Winforms.
fjparisIII wrote: . Are you absolutely certain you know what you're talking about?
Yes. I have written a great many applications that use sound and video in C#, in and out of WPF. I was making a generalisation.
fjparisIII wrote: , I also found out that there are readily available conversion tools that will go from AAC files to MP3 files
I'd have assumed you knew that already, sorry. You should have asked.
fjparisIII wrote: so I don't think your alarmist attitude about "media control in WPF" is warranted for the simple things I want to do.
I was talking in general, about my general experiences with it.
fjparisIII wrote: So go sow your sour grapes somewhere else, and next time try to be a little more constructive.
http://thingsihateaboutmicrosoft.blogspot.com/[^]
I am doing both of those things. Where Microsoft frameworks have bugs, I am not scared to say so, and I have a blog to tell people how to work around them.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Christian Graus wrote: Why would it be surprising?
It might be surprising because MP4 has been around for a decade and WPF has only been around for about 3 years. But in looking around, I didn't find a free MP4 codec, so maybe MP4 isn't in the public domain yet and that's why Microsoft doesn't offer it for free.
Christian Graus wrote: The media control in WPF barely works
What do you mean by "barely works"? I got MediaPlayer to work perfectly the first time I tried it with a list of MP3 files I fed into it. All of the properties like Volume, Balance, and SpeedRatio work as advertised, and you can start, pause, and stop music files, and cycle through a list of music files with the same MediaPlayer instance, all without a hiccup.
If all these things work, then how can you say it "barely works"? When I read "barely works" from your answer, I expected intermittent and distorted sound, or even crashes, and approached my development effort with trepidation. I'm greatly relieved to report that none of that happens. The music sounds wonderful and the MP3 sound files play flawlessly. I'd say the MediaPlayer class works great and exactly as advertised, and that your answer is greatly misleading, unless you were using the expression, "barely works," in a sense with which I am completely unfamiliar.
Christian Graus wrote: why would [WPF] have all the latest formats in it?
How many of the "latest formats" have come out since WPF was introduced? I don't know of any, but I'm new to this sound game. In any case, I wasn't referring to "all the latest formats." I was referring to the AAC format, which is just MP4. As I'm sure you know, that format has been around for 10 years.
|
|
|
|
|
AAC is supported in MP4, F4V and some MOV files. Whether or not you'll be able to play them properly depends, to a large extent, on whether or not you have the right Codecs installed.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: Whether or not you'll be able to play them properly depends, to a large extent, on whether or not you have the right Codecs installed.
I know nothing about music files and codecs and want to support music only as a "nice touch" to my main application which is to display large collections of photographs in dozens of different levels of refinement. So I'm restricting myself to the MediaPlayer as I don't want to get into anything low level for functionality as peripheral as this. I want to start the music when photos start showing, playing one music file after another until the user stops showing his photographs.
I should have phrased my question, "does MediaPlayer support AAC?" and I guess the answer is no. But I have found out that there are lots of free utilities that convert AAC to MP3 and so this is not a critical issue. If my application was primarily for playing music I probably wouldn't even try it in WPF. Apparently it would actually be simpler for me to go back to MFC, COM, and Win32. But for my simple audio needs, WPF is the quickest way to get there, especially since I've already got 75,000 lines of code invested in my photo showing application.
|
|
|
|
|
fjparisIII wrote: "does MediaPlayer support AAC?" and I guess the answer is no.
The answer is yes - but you need a codec installing. The answer to "does MediaPlayer support AAC out of the box?" is no.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: fjparisIII wrote:
"does MediaPlayer support AAC?" and I guess the answer is no.
The answer is yes - but you need a codec installing. The answer to "does MediaPlayer support AAC out of the box?" is no.
What is involved in "installing a codec"? Is this something the user can do after they buy my application, or is it something I have to build into my application?
|
|
|
|
|
The user can do this after they buy your application, but you may want to offer some default codecs in your installer, bearing in mind that some codecs work well in x64 and some don't. Some of your users will probably have favourite codecs installed already, so it's always a good idea to let them bypass the installation phase.
This KB[^] describes the process of installing and removing codecs.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I don't think I want to get involved in installing codecs. If my application was focused on sound that would be a different matter.
If the user has pre-installed sound codecs, does this mean that if a user has installed a codec for AAC files that MediaPlayer will run AAC files automatically? What are the file extensions for AAC files? I haven't been able to find out this information.
|
|
|
|
|
AAC is an Apple Codec I believe (used in iTunes and QuickTime). Is there a reason you're so adamant about AAC? Do you have a ton of these laying around? I'd say you're better off using MP3 or WMA for audio if possible.
|
|
|
|
|
For someone who wanted to blast me, it seems you've done not even basic research before asking your question. Still, it seems Pete has filled in the gaps from what I said. There is NO support in WPF. NONE. WPF uses Media Player, just like C#. Your book is full of lies. In ANY .NET framework, the media player will play whatever formats have codecs installed for Windows Media Player.
A codec is just a program you install, I have shipped codecs with my installers in the past.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|