Plugin support (1 Viewer)

ge2301

Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    I think this is the reason why skin files needs to be placed inside the plugin which has the code:
    If you put in an assembly reference this way, the lookup considers all loaded assemblies. Of course BlueVision doesn't have (and must not have) any direct depency to another plugin.
    Could you try to place your modified skin files under OV2 plugin first to see if they are working from this location?
    If I understood you correctly I did so. I'm only working in the Bluevision skin folder of OV2 plugin.

    In ovsSiteMangement.xaml there is this code (and I see the logo in the options view):
    HTML:
                        <Image DockPanel.Dock="Right" Stretch="Uniform" VerticalAlignment="Top"
                               Source="{Binding ElementName=siteslist, Path=CurrentItem, Converter={ThemeResource ovsSiteUtilIconConverter}}"/>

    I tried to copy exactly the same code to sites.xaml and it does not show a logo. I considered the resources as you see below in the complete code of sites.xaml:
    HTML:
    <?xml version="1.0" encoding="utf-8"?>
    <Include
        xmlns="www.team-mediaportal.com/2008/mpf/directx"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ovs="clr-namespace:OnlineVideos.MediaPortal2;assembly=OnlineVideos.MediaPortal2"
        Source="screens\master_bare.xaml">
      <Include.Resources>
    
        <Model x:Key="OnlineVideosModel" Id="C418243F-5BD3-4637-8871-DA6545387929"/>
        <ovs:SiteUtilIconConverter x:Key="ovsSiteUtilIconConverter"/>
    
        <!-- Contents -->
        <ControlTemplate x:Key="Client_Template">
          <DockPanel DataContext="{Binding Source={StaticResource OnlineVideosModel}}" LastChildFill="true">
    
            <ListView x:Name="siteslist" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DockPanel.Dock="Center"
                      Style="{ThemeResource ovsSitesListViewStyle}" Margin="-30, 0,-45,-5"
                      CurrentItem="{Binding Path=FocusedSite, Mode=OneWayToSource}"
                      ItemsSource="{Binding Path=SitesList}" SetFocusPrio="RestoreState"/>
    
            <StackPanel Orientation="Vertical" DockPanel.Dock="Center" VerticalAlignment="Bottom" Margin="0,625,0,-625" >
    
              <Image  Stretch="Uniform" VerticalAlignment="Top"
                     Source="{Binding ElementName=siteslist, Path=CurrentItem, Converter={ThemeResource ovsSiteUtilIconConverter}}"/>
    
              <Label Color="{ThemeResource TextColor}"
                       HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                       DataContext="{Binding ElementName=siteslist,Path=CurrentItem}" Content="{Binding Path=Name}" />
              <Label Color="{ThemeResource TextColor}" Opacity="0.6"
                       HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Wrap="True" Scroll="Auto"
                       DataContext="{Binding ElementName=siteslist,Path=CurrentItem}"
                       Content="{Binding Description}" />
            
            </StackPanel>
    
          </DockPanel>
        </ControlTemplate>
      </Include.Resources>
    </Include>
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Ah ok. Then we need to check OV2 itself.

    same code to sites.xaml
    In ovsSiteMangement.xaml
    From your both quotes (without checking xaml) I guess the two screens are using different backing models, so properties might be different. Are the Model-ID and the DataContext of the controls the same in both screens?
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    From your both quotes (without checking xaml) I guess the two screens are using different backing models, so properties might be different. Are the Model-ID and the DataContext of the controls the same in both screens?
    The datacontext is different.
    The ovsSiteManagement.xaml uses DataContext="{Binding Source={StaticResource ovsSiteManagerModel}}"
    The Sites.xaml uses DataContext="{Binding Source={StaticResource OnlineVideosModel}}"

    EDIT:
    Also OnlineVideosStyle.xaml uses the same code to show the image and there its starting with: <DataTemplate x:Key="ovsOnlineSiteItemDataTemplate" DataType="{x:Type ovs:OnlineSiteViewModel}">
     
    Last edited:

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    In OV it was quite easy to change the button style, because it can be defined in ovsSiteItemContainerStyle.
    HTML:
        <Style x:Key="ovsSitesListViewStyle" TargetType="{x:Type ListView}">
            <Setter Property="Template" Value="{ThemeResource ovsListViewTemplate}"/>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <WrapPanel IsItemsHost="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="{ResolutionResource ovsSitesPanelMargin}"/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="ItemTemplate" Value="{ThemeResource ovsSiteItemDataTemplate}"/>
            <Setter Property="ItemContainerStyle" Value="{ThemeResource ovsSiteItemContainerStyle}"/>
            <Setter Property="DataStringProvider" Value="{ThemeResource DefaultItemDataStringProvider}"/>
        </Style>

    For news there is no style setter. Changing the "BasedOn" does not work.
    HTML:
      <Style x:Key="NewsFeedsContainerStyle" BasedOn="{ThemeResource MenuListViewStyle}">
        <Setter Property="ItemTemplate" Value="{ThemeResource NewsFeedDataTemplate}" />
      </Style>

    How can I switch to the framed focus button? :unsure: Added a second setter "ItemContainerStyle" and adding a to OV comparable code behind made MP2 fall back to standard skin.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    @morpheus_xx
    I installed the latest version of WebRadio for MP2. With Titanum skin it seems to work well. With BlueVision it is veeery slow and generating lot's of failures :( A few times I had to close MP2 by task manager.
    I was going to create a BV specific skin, since I like this plugin. But at first it should be clarified why it's causing trouble with BV. I checked also ApolloOne, it's the same problem. Do you have an idea from the logs. I thought it's better to ask you first instead of contacting BigGranu, who can most probably not say too much about BV.
     

    Holzi

    Super Moderator
  • Team MediaPortal
  • April 21, 2010
    7,934
    2,235
    Ba-Wü
    Home Country
    Germany Germany

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    I installed the latest version of WebRadio for MP2. With Titanum skin it seems to work well. With BlueVision it is veeery slow and generating lot's of failures :( A few times I had to close MP2 by task manager.
    I fixed the issue. Reason was an empty ListView style, which lead to using a non-virtualization StackPanel. For the huge list of >10.000 web radio stations it causes a big performance issue.

    I've added missing styles to BlueVision, same changes still must be done for ApolloOne!
     
    Last edited:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    @ge2301 I think it's mandatory to move the plugin-dependent styles out of BlueVision plugin folder.

    Once you have styles for OnlineVideos included, but don't have the plugin installed (like I have here), you cannot use BlueVision anymore, because of missing dependencies in styles. A fallback to "Default" then happens.

    This means, at least for all plugins which are not part of core installation, the styles must be placed in the plugin which needs them. Exceptions could be allowed for the inbuilt and used plugins like Weather and News (because we use them directly in HomeModel and should have clear references to them inside plugin.xml). But the real clean way would be to place all styles in their respective plugin.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    @ge2301 I think it's mandatory to move the plugin-dependent styles out of BlueVision plugin folder.

    Once you have styles for OnlineVideos included, but don't have the plugin installed (like I have here), you cannot use BlueVision anymore, because of missing dependencies in styles. A fallback to "Default" then happens.

    This means, at least for all plugins which are not part of core installation, the styles must be placed in the plugin which needs them. Exceptions could be allowed for the inbuilt and used plugins like Weather and News (because we use them directly in HomeModel and should have clear references to them inside plugin.xml). But the real clean way would be to place all styles in their respective plugin.

    Oh, I'll move them out. The question is only where in GitHub I push them. I guess just to offer them seperately from the plugin for download is also not the ideal way.
     

    Users who are viewing this thread

    Top Bottom