Hi,
i'm tried to write an application for Media Center using Visual Basic 2010.
I wrote a very basic app with a only one code (launch.vb) and a simple MCML page.
When I try the app the Media Center enter in the application but the page is not displayed.
The Launch Code is very simple:
Imports System.Collections.Generic
Imports Microsoft.MediaCenter.Hosting
Imports Microsoft.MediaCenter
Namespace MyProject
Public Class MyAddIn
Implements IAddInModule
Implements IAddInEntryPoint
Private Shared s_session As HistoryOrientedPageSession
Public Sub Initialize(appInfo As Dictionary(Of String, Object), entryPointInfo As Dictionary(Of String, Object)) Implements IAddInModule.Initialize
End Sub
Public Sub Uninitialize() Implements IAddInModule.Uninitialize
End Sub
Public Sub Launch(host As AddInHost) Implements IAddInEntryPoint.Launch
'Dim myResource As My.Resources.Resources
'MsgBox(My.Resources.Resources.Prova.Rank)
If host IsNot Nothing AndAlso host.ApplicationContext IsNot Nothing Then
host.ApplicationContext.SingleInstance = True
End If
s_session = New HistoryOrientedPageSession()
Dim app As New MyProject.Application(s_session, host)
Try
Microsoft.MediaCenter.Hosting.AddInHost.Current.MediaCenterEnvironment.Dialog("Allarm", "it's Work", DialogButtons.Ok, 5, False)
s_session.GoToPage("resx://MyProject/MyProject.Resources/Prova")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
End Namespace
and the MCL is:
<Mcml xmlns="http://schemas.microsoft.com/2008/mcml"
xmlns:cor="assembly://MSCorLib/System">
<UI Name="Prova">
<Properties>
<Color Name="MyColor"
Color="White"/>
</Properties>
<Locals>
<cor:String Name="MyString"
String="Hello"/>
</Locals>
<Rules>
<Default Target="[MyText.Content]"
Value="[MyString]"/>
</Rules>
<Content>
<Text Name="MyText"
Color="[MyColor]"
Font="Calibri, 24"/>
</Content>
</UI>
</Mcml>
The Debug works and devinstall too. When i launch the app from MediaCenter i receive the message "it's Work" but the page "Prova" is not loaded. Why?
It's the code s_session.GoToPage("resx://MyProject/MyProject.Resources/Prova") right?
(I have put Prova.mcml on resources.resx)
Can you help me?