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: 857822" data-attributes="member: 63847"><p>Albert,</p><p>with your help i got my first listitem skin working. It does everything i want for focusing and clicking on an item, but throws an exception in the log file</p><p>whenever I change the focus of an item.</p><p> </p><p>I am using now "Name" and Style="{ThemeResource MenuListViewStyle}" which results in a nice list item menu list.</p><p>whenever I change the focus the following function is executed correctly:</p><p> </p><p>public void FocusedItemChanged(ListItem focusedListItem)</p><p>{</p><p>if (focusedListItem == null)</p><p>return;</p><p>mylogger.Debug("FocusedItemChanged: Focused item=" + focusedListItem.Labels["Name"]);</p><p> </p><p>//update label</p><p>FocusedItem = LocalizationHelper.Translate(FOCUSED_ITEM_RESOURCE, focusedListItem.Labels["Name"]);</p><p>mylogger.Debug("FocusedItemChanged: Completed");</p><p>}</p><p> </p><p>However, after "FocusedItemChanged: Completed" it throws an exception</p><p> </p><p>[2012-04-07 20:29:19,112] [12236 ] [InputMgr ] [DEBUG] - FocusedItemChanged: Completed</p><p>[2012-04-07 20:29:19,125] [12249 ] [InputMgr ] [ERROR] - CommandBaseMarkupExtension: Error executing command '{CommandStencil Source=MyTestPlugin.Models.MyTestPluginScreen2,Path=FocusedItemChanged}'</p><p>System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.</p><p>bei MyTestPlugin.Models.MyTestPluginScreen2.FocusedItemChanged(ListItem focusedListItem)</p><p>--- Ende der internen Ausnahmestapelüberwachung ---</p><p>bei System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)</p><p>bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)</p><p>bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)</p><p>bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)</p><p>bei MediaPortal.UI.SkinEngine.MarkupExtensions.CommandBaseMarkupExtension.Execute(IEnumerable`1 parameters)</p><p> </p><p>My screen file is:</p><p> </p><p><Include.Resources></p><p> </p><p><!-- Header --></p><p><ResourceWrapper x:Key="Header_Text" Resource="[MyTestPluginScreen2.ScreenTitle]"/></p><p> </p><p><!-- SlimTvClient model --></p><p><Model x:Key="MyTestPluginScreen2" Id="cefc2f41-8a0d-4f92-b2e7-c7fa2194e90d"/></p><p> </p><p><!-- Contents --></p><p><ControlTemplate x:Key="Contents_Template"></p><p><DockPanel Context="{Model Id=cefc2f41-8a0d-4f92-b2e7-c7fa2194e90d}" LastChildFill="False"></p><p><Label Content="{Binding FocusedItem}" Color="{ThemeResource TextColor}" FontSize="22" DockPanel.Dock="Top" HorizontalAlignment="Left"/></p><p><Label Content="{Binding SelectedItem}" Color="{ThemeResource TextColor}" FontSize="22" DockPanel.Dock="Top" HorizontalAlignment="Left"/></p><p><ListView Name="TestListView" DockPanel.Dock="Center" Height="300" Width="600" ItemsSource="{Binding MyListViewItems}" SelectionChanged="{CommandStencil Source={StaticResource MyTestPluginScreen2}, Path=FocusedItemChanged}" Style="{ThemeResource MenuListViewStyle}"></p><p><ListView.Resources></p><p><CommandBridge x:Key="Menu_Command" Command="{Binding Path=Command,Mode=OneTime}"/></p><p></ListView.Resources></p><p></ListView></p><p></DockPanel></p><p></ControlTemplate></p><p> </p><p> </p><p></Include.Resources></p><p> </p><p>Any idea what could causing this?</p></blockquote><p></p>
[QUOTE="huha, post: 857822, member: 63847"] Albert, with your help i got my first listitem skin working. It does everything i want for focusing and clicking on an item, but throws an exception in the log file whenever I change the focus of an item. I am using now "Name" and Style="{ThemeResource MenuListViewStyle}" which results in a nice list item menu list. whenever I change the focus the following function is executed correctly: public void FocusedItemChanged(ListItem focusedListItem) { if (focusedListItem == null) return; mylogger.Debug("FocusedItemChanged: Focused item=" + focusedListItem.Labels["Name"]); //update label FocusedItem = LocalizationHelper.Translate(FOCUSED_ITEM_RESOURCE, focusedListItem.Labels["Name"]); mylogger.Debug("FocusedItemChanged: Completed"); } However, after "FocusedItemChanged: Completed" it throws an exception [2012-04-07 20:29:19,112] [12236 ] [InputMgr ] [DEBUG] - FocusedItemChanged: Completed [2012-04-07 20:29:19,125] [12249 ] [InputMgr ] [ERROR] - CommandBaseMarkupExtension: Error executing command '{CommandStencil Source=MyTestPlugin.Models.MyTestPluginScreen2,Path=FocusedItemChanged}' System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. bei MyTestPlugin.Models.MyTestPluginScreen2.FocusedItemChanged(ListItem focusedListItem) --- Ende der internen Ausnahmestapelüberwachung --- bei System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) bei MediaPortal.UI.SkinEngine.MarkupExtensions.CommandBaseMarkupExtension.Execute(IEnumerable`1 parameters) My screen file is: <Include.Resources> <!-- Header --> <ResourceWrapper x:Key="Header_Text" Resource="[MyTestPluginScreen2.ScreenTitle]"/> <!-- SlimTvClient model --> <Model x:Key="MyTestPluginScreen2" Id="cefc2f41-8a0d-4f92-b2e7-c7fa2194e90d"/> <!-- Contents --> <ControlTemplate x:Key="Contents_Template"> <DockPanel Context="{Model Id=cefc2f41-8a0d-4f92-b2e7-c7fa2194e90d}" LastChildFill="False"> <Label Content="{Binding FocusedItem}" Color="{ThemeResource TextColor}" FontSize="22" DockPanel.Dock="Top" HorizontalAlignment="Left"/> <Label Content="{Binding SelectedItem}" Color="{ThemeResource TextColor}" FontSize="22" DockPanel.Dock="Top" HorizontalAlignment="Left"/> <ListView Name="TestListView" DockPanel.Dock="Center" Height="300" Width="600" ItemsSource="{Binding MyListViewItems}" SelectionChanged="{CommandStencil Source={StaticResource MyTestPluginScreen2}, Path=FocusedItemChanged}" Style="{ThemeResource MenuListViewStyle}"> <ListView.Resources> <CommandBridge x:Key="Menu_Command" Command="{Binding Path=Command,Mode=OneTime}"/> </ListView.Resources> </ListView> </DockPanel> </ControlTemplate> </Include.Resources> Any idea what could causing this? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Questions on writing my first plugin
Contact us
RSS
Top
Bottom