How to create a RadMediaPlayer Style

8 posts, 0 answers
  1. Scott Laughton
    Scott Laughton avatar
    12 posts
    Member since:
    May 2006

    Posted 17 Mar 2009 Link to this post

    Hi there,
            I posted the question "how to specify what buttons show on the player", and Miroslav was kind enough to provide me with a solution for that.  However I need some further clarity on this.  I have done the following:

    1. Created a new Silverlight 2 project in VS2008.
    2. Dropped a RadMediaPlayer in the Grid.
    3. Given it the following name: x:Name="RadMediaPlayer1"
    4. Saved the page.
    5. Opened the Page.xaml in blend.
    6. Selected the RadMediaPlayer1 element.
    7. Right clicked on it and selected Edit Control Parts (Template)/Edit A Copy from the context menu.
    8. Gave it the name "RadMediaPlayerStyle1" and selected the Define In Application option and pressed OK.
    9. Saved All files and then went back to the project in VS2008 and reload the files.
    10. Rebuilt the solution.

    After doing all this the RadMediaPlayer element now has the Style="{StaticResource RadMediaPlayerStyle1}" attribute, and the RadMediaPlayerStyle1 data has been added to the App.xaml, however the RadMediaPlayer element no longer renders in the VS2008 preview. 

    When I inspect the VS2008 Error List panel it has the following error:


    Error 1 Invalid attribute value telerikMedia:PlaylistPresenter for property TargetType. [Line: 471 Position: 68] C:\Visual Studio 2008\Projects\TestProjects\SilverlightApplication_RadMediaPlayerStyle\SilverlightApplication_RadMediaPlayerStyle\Page.xaml 1 1 SilverlightApplication_RadMediaPlayerStyle

    The declarition the above error refers to is actully in the App.xaml.

    My Silverlight app is going to have a number of pages with RadMediaPlayer elements in them and I want to reuse the style.

    What am I doing wrong?

    Here is my setup:
     - RadControls for Silverlight 2009.1.312.1020
     - Microsoft Visual Studio 2008 Version 9.0.30729.1 SP
     - Microsoft Expression Blend 2.0 Version 2.1.1760.0 SP1 
     - Microsoft .NET Framework Version 3.5 SP1
     - Windows XP Pro x64

    Regards,

        Scott.

  2. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 20 Mar 2009 Link to this post

    Hi Scott,

    Thank you for your feedback. It turned out that there is an issue with the design-time support of RadMediaPlayer. I scheduled this issue for fixing and it will be resolved for the upcoming Service Pack, which is due in  a couple of weeks. Thank you once again for your feedback.

    I updated your Telerik points.

    All the best,
    Dimitrina
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Scott Laughton
    Scott Laughton avatar
    12 posts
    Member since:
    May 2006

    Posted 20 Mar 2009 Link to this post

    Dimitrina,
            Thank you for your reply.  This is most unfortunate as my deliver date is Wensday.  I get a simlar issue when attempting to create a style for the RadTreeViewItem.

    1. Created a new Silverlight 2 project in VS2008.
    2. Dropped a RadTreeView in the Grid.
    3. Gave it the following name: x:Name="RadTreeView1"
    4. Added 3 RadTreeViewItem's.
    5. Saved the page.
    6. Opened the Page.xaml in blend.
    7. Selected the RadTreeView1 element.
    8. Right clicked on it and selected Edit Control Parts (Template)/Edit A Copy from the context menu.
    9. Gave it the name "RadTreeViewStyle1" and selected the Define In Application option and pressed OK.

    Once I did this Blend shows an error in the Errors panel saying:
    The resource "System.Windows.Controls.CheckBox" could not be resolved | File: App.xmal

    I need to apply a style to the RadTreeView Items so the Header text will wrap.

    I have been working with the trials up until now and had planed to purchase a Telerik Premium Collection for .NET license tommorow, so I could just build my project for release, and then deliver it early next week.  Is there any chance of a hotfix for these issues, as telling the client, and all the other contractors they will have to wait for another month till they can get paid, is not going to go down real well.

    Regards,    

            Scott.

  5. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 20 Mar 2009 Link to this post

    Hi Scott,

    Since the issues you encountered are mission-critical for you, we will do our best to fix them ASAP. I hope we will be able to send you a hotfix by the end of the day. The treeview item problem is already resolved and we are working on the MediaPlayer issue. In case we do not make it today, will a hotfix on Monday work for you? Let us know what you think.

    Greetings,
    Tihomir Petkov
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Scott Laughton
    Scott Laughton avatar
    12 posts
    Member since:
    May 2006

    Posted 20 Mar 2009 Link to this post

    Tihomir,
            Thanks for the prompt reply, and making the effort to resolve these issues a priority, it is very much appreciated.  Yes Monday would be fantastic!!  I will purchase my license tomorrow, and all going well, will have everything I need to deliver the project by Monday.

    Thank you to the Telerik team for looking after us ;-)

    Regards,

        Scott. 
  7. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 20 Mar 2009 Link to this post

    Hi Scott,

    We prepared a hotfix for you which I am attaching to this post. Please check if everything works fine and let us know.

    The issue with editing MediaPlayer's theme in Blend turned out to be weird and you should use a temporary workaround until we have time to properly resolve it. Here is the workaround:

    When you edit MediaPlayer's template in Blend start as you would normally do, but when Blend generates a copy of the style for you, find the following line:

    <EventTrigger RoutedEvent="telerik:RadMediaPlayer.Loaded">

    and substitute it with this one:

    <EventTrigger RoutedEvent="Canvas.Loaded">

    The second line is the actual code in the control, but while generating a copy of the style, at run time Blend substitutes the trigger with the version on the first line.

    We also found another issue with the themes which does not allow you to put themes/styles in the resources of your application (App.xaml). However, if you keep your custom styles/themes out of App.xaml there should be no problems. We will be investigating this further, but you should stick with the workaround until we resolve the problems.

    Hope this solves your problems. Let us know how it goes.

    Kind regards,
    Tihomir Petkov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  8. Scott Laughton
    Scott Laughton avatar
    14 posts
    Member since:
    Feb 2006

    Posted 21 Mar 2009 Link to this post

    Tihomir,
            Thank you for your efforts to push this hotfix through for me.  It did resolve the style issues, however I have run into some other issues.  I bought a Telerik Premium Collection for .NET license this morning, so I have put in a support request for this issue.

    Thanks again Tihomir,

        Scott.
  9. Richard
    Richard avatar
    1 posts
    Member since:
    Apr 2009

    Posted 05 Apr 2009 Link to this post

    Hi,

    This was driving me nuts. Thank you so much for the quick response to the above poster, since I had the exact same problem with the trial version. The answer to this post has fixed it, yay!

    Great customer service, keep it up!

    Regards,
    Richard
Back to Top
DevCraft banner