A Dummy takes a lot of help (1 Viewer)

BigGranu

Development Group
  • Team MediaPortal
  • February 7, 2013
    238
    172
    49
    Germany Germany
    Country flag
    I come from germany and can no Chinese.
    And sorry, but my English is only slightly better. :oops:

    I have said morpheus_xx, I would have some experiences with WPF and xaml.
    However, apparently these do not reach by far.

    Since 2 days, I fight with a simple Listview.
    This is so depressing. :cry:

    In WPF ordinarily I use
    XAML:
    Code:
    <Window x:Class="WpfApplication1.MainWindow"
    		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    		Title="MainWindow" Height="350" Width="525">
    	<Grid>
    		<ListView HorizontalAlignment="Left" Height="267" Margin="24,10,0,0" VerticalAlignment="Top" Width="341" ItemsSource="{Binding Path=meineListe}">
    			<ListView.View>
    				<GridView>
    					<GridViewColumn DisplayMemberBinding="{Binding Path=Titel}" />
    				</GridView>
    			</ListView.View>
    		</ListView>
    	</Grid>
    </Window>
    CODE:
    Code:
    using System.Collections.ObjectModel;
    using System.Windows;
     
    namespace WpfApplication1
    {
     
    	public partial class MainWindow : Window
    	{
    		public MainWindow()
    		{
    			fillList();
    			DataContext = this;
    		}
     
    		private void fillList()
    		{
    			meineListe = new ObservableCollection<TestListe>();
    			for (int i = 1; i <= 10; i++)
    			{
    				TestListe _liste = new TestListe();
    				_liste.Titel = "Zeile " + i;
    				meineListe.Add(_liste);
    			}
    		}
     
    		public class TestListe
    		{
    			public string Titel { get; set; }
    		}
     
    		public ObservableCollection<TestListe> meineListe { get; private set; }
    	}
    }
    And its works fine.

    In the Plugin Workflow, I use
    Code:
    	public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext)
    	{
    		fillList ();
    	}
    In The Plugin xaml
    Code:
    	<ListView x:Name="Test" DockPanel.Dock="Center" Style="{ThemeResource ListViewStyle}"
    	  VerticalAlignment="Center" HorizontalAlignment="Center" Width="1100" Height="500" ItemsSource="{Binding Path=meineListe,Mode=OneTime}">
    	</ListView>
    What must I do, to make it work in plugin?
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,401
    6,972
    Germany Germany
    Country flag
    Hi BigGranu, don't worry, it will work soon. MP2 is different, but once you get the first results it will be easier (y)

    About your question: without knowing the full xaml file, I guess about following possible causes:
    Please ask more questions, it will also help new developers to understand MP2's architecture!
     

    BigGranu

    Development Group
  • Team MediaPortal
  • February 7, 2013
    238
    172
    49
    Germany Germany
    Country flag
    Thank you morpheus_xx. (y)
    I'll test it on the weekend.
    Unfortunately, I have this days little time.

    But there's the "GUITestPlugin" in the Resources.
    There is also a page for the ListView.
    Unfortunately, only fixed items. :(
    Could maybe one of the pros here extend this example? :whistle:
    Maybe I'm not the only dummy.
     

    BigGranu

    Development Group
  • Team MediaPortal
  • February 7, 2013
    238
    172
    49
    Germany Germany
    Country flag
    Another short Question.:rolleyes:
    How can I use the Virtualkeyboard in MP2 Code?
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,401
    6,972
    Germany Germany
    Country flag
    It is automatically used for text boxes, if you hit enter/ok it is shown.
     

    BigGranu

    Development Group
  • Team MediaPortal
  • February 7, 2013
    238
    172
    49
    Germany Germany
    Country flag
    And the next.
    Which player do I need for streamingaddresses and how I call him on?
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,401
    6,972
    Germany Germany
    Country flag
    We already have different kind of players that support either audio only or video. In your case a "audio only" directshow player would be best, I think.

    We did the same in the MediaSite plugin, so take a look there as reference:
    • Created an own ResourceProvider (that is able to access streams)
    • Created a player that uses LAV splitter source
    • For playback we create a MediaItem using a MimeType that the player knows.
    https://github.com/VicDemented/Medi...al/Incubator/MediasitePlugin/ResourceProvider
    https://github.com/VicDemented/Medi...tor/MediasitePlugin/Models/MediasitePlugin.cs #355ff

    Generally spoken, the MediaSite plugin does in fact nearly the same and can guide you through the different classes.

    To the player: as we aim for "audio only", your player should derive from https://github.com/MediaPortal/Medi...Source/UI/Players/VideoPlayer/BaseDXPlayer.cs.

    An example is my "LiveRadioPlayer": https://github.com/MediaPortal/Medi...ubator/SlimTvClient/Player/LiveRadioPlayer.cs

    A note: if you copy classes from MediaSite, always check for defined Guids, you must replace them by your own (VS->Extras->Create Guid). Same is valid for PluginId, WorkflowStates i.e.
     
    Last edited:

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    Top Bottom