home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
Questions on writing my first plugin
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="huha" data-source="post: 857731" data-attributes="member: 63847"><p>After having spent hours without success on the listitem I need to ask for help again:</p><p></p><p>I have defined a skin MyTestPluginScreen2.xaml with a listitem in a dockpanel:</p><p></p><p><ListView Name="TestListView" DockPanel.Dock="Center" Height="300" Width="600" ItemsSource="{Binding MyListViewItems}" SelectionChanged="{CommandStencil FocusedItemChanged}"/></p><p></p><p>In the corresponding model MyTestPluginScreen2.cs i have defined:</p><p></p><p></p><p>private ItemsList _testlist = null;</p><p></p><p>public ItemsList MyListViewItems</p><p> {</p><p> get { return _testlist; }</p><p> }</p><p></p><p></p><p></p><p></p><p> public void InitListItems()</p><p> {</p><p> //load settings </p><p> MyTestPluginSettings settings = ServiceRegistration.Get<ISettingsManager>().Load<MyTestPluginSettings>();</p><p></p><p> //define all items for ListView in skin and use MySetting_Int for number of items to create</p><p> _testlist = new ItemsList();</p><p> for (int i = 0; i < settings.MySetting_Int; i++)</p><p> {</p><p> ListItem myitem = new ListItem();</p><p> string myitemstring = LocalizationHelper.Translate(ITEM_RESOURCE, i);</p><p> myitem.SetLabel("Item",myitemstring);</p><p> mylogger.Debug("Adding item="+myitemstring);</p><p> //this command will be executed after selection</p><p> myitem.Command = new MethodDelegateCommand(() => SelectedItemChanged(i));</p><p> _testlist.Add(myitem);</p><p> }</p><p></p><p> //update skin</p><p> MyListViewItems.FireChange(); </p><p> }</p><p></p><p></p><p>I believe i do not have to define any properties, as this is done in the ListItem class. </p><p>I see in the log files that list items are created, but no list item is shown on the screen and i have no idea why.</p><p></p><p>I have included the complete code Step3 in a zip file</p></blockquote><p></p>
[QUOTE="huha, post: 857731, member: 63847"] After having spent hours without success on the listitem I need to ask for help again: I have defined a skin MyTestPluginScreen2.xaml with a listitem in a dockpanel: <ListView Name="TestListView" DockPanel.Dock="Center" Height="300" Width="600" ItemsSource="{Binding MyListViewItems}" SelectionChanged="{CommandStencil FocusedItemChanged}"/> In the corresponding model MyTestPluginScreen2.cs i have defined: private ItemsList _testlist = null; public ItemsList MyListViewItems { get { return _testlist; } } public void InitListItems() { //load settings MyTestPluginSettings settings = ServiceRegistration.Get<ISettingsManager>().Load<MyTestPluginSettings>(); //define all items for ListView in skin and use MySetting_Int for number of items to create _testlist = new ItemsList(); for (int i = 0; i < settings.MySetting_Int; i++) { ListItem myitem = new ListItem(); string myitemstring = LocalizationHelper.Translate(ITEM_RESOURCE, i); myitem.SetLabel("Item",myitemstring); mylogger.Debug("Adding item="+myitemstring); //this command will be executed after selection myitem.Command = new MethodDelegateCommand(() => SelectedItemChanged(i)); _testlist.Add(myitem); } //update skin MyListViewItems.FireChange(); } I believe i do not have to define any properties, as this is done in the ListItem class. I see in the log files that list items are created, but no list item is shown on the screen and i have no idea why. I have included the complete code Step3 in a zip file [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Questions on writing my first plugin
Contact us
RSS
Top
Bottom