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
Calling a method within the Model once the Screen has completed loading
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="Valk" data-source="post: 978033" data-attributes="member: 18631"><p>In my quest I decided to dig deeper into MP2. As I was going through I came across IWorkflowModel.cs and noticed a small TODO:</p><p> </p><p>// TODO: Create methods Activate and Deactivate to execute initialization/deinitialization like message queue setup etc.</p><p> </p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000">// EnterModelContext and ExitModelContext can then be replaced by ChangeModelContext.</span></span></span></span></span></span></span></span></span></p><p> </p><p>While I didn't implement ChangeModelContext I did add an <span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #0000ff"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #0000ff"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #0000ff">void</span></span></span></span></span></span></span></span></span><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'"> Activate(</span></span></span></span><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #2b91af"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #2b91af"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #2b91af">NavigationContext</span></span></span></span></span></span></span></span></span><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'"> currentContext); </span></span></span></span>function to IWorkflowModel.cs and implemented it in WorkflowManager.cs at the end of the function UpdateScreen_NeedsLock(bool push, bool force)</p><p> </p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-family: 'Tahoma'"><span style="color: #000000">After that I found I was able to get my dialog to appear but while the thread is working on the first load of the form the side menu expands until the dialog is shown.</span></span></span></span></span></span></span></span></span></span></span></p><p> </p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-family: 'Tahoma'"><span style="color: #000000">At the moment I'm not sure what's causing the menu to expand in the first place but it's causing me grief.</span></span></span></span></span></span></span></span></span></span></span></p><p> </p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008000"><span style="font-family: 'Tahoma'"><span style="color: #000000">So I guess the follow up question is how did @<a href="https://forum.team-mediaportal.com/members/albert.67886/" target="_blank">Albert</a> I guess intend the Activate function to work so I can do this properly? <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /> </span></span></span></span></span></span></span></span></span></span></span></p></blockquote><p></p>
[QUOTE="Valk, post: 978033, member: 18631"] In my quest I decided to dig deeper into MP2. As I was going through I came across IWorkflowModel.cs and noticed a small TODO: // TODO: Create methods Activate and Deactivate to execute initialization/deinitialization like message queue setup etc. [SIZE=3][FONT=Consolas][COLOR=#008000][SIZE=3][FONT=Consolas][COLOR=#008000][SIZE=3][FONT=Consolas][COLOR=#008000]// EnterModelContext and ExitModelContext can then be replaced by ChangeModelContext.[/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE] While I didn't implement ChangeModelContext I did add an [SIZE=3][FONT=Consolas][COLOR=#0000ff][SIZE=3][FONT=Consolas][COLOR=#0000ff][SIZE=3][FONT=Consolas][COLOR=#0000ff]void[/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas] Activate([/FONT][/SIZE][/FONT][/SIZE][SIZE=3][FONT=Consolas][COLOR=#2b91af][SIZE=3][FONT=Consolas][COLOR=#2b91af][SIZE=3][FONT=Consolas][COLOR=#2b91af]NavigationContext[/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas] currentContext); [/FONT][/SIZE][/FONT][/SIZE]function to IWorkflowModel.cs and implemented it in WorkflowManager.cs at the end of the function UpdateScreen_NeedsLock(bool push, bool force) [SIZE=3][FONT=Consolas][COLOR=#008000][SIZE=3][FONT=Consolas][COLOR=#008000][SIZE=3][FONT=Consolas][COLOR=#008000][FONT=Tahoma][COLOR=#000000]After that I found I was able to get my dialog to appear but while the thread is working on the first load of the form the side menu expands until the dialog is shown.[/COLOR][/FONT][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE] [SIZE=3][FONT=Consolas][COLOR=#008000][SIZE=3][FONT=Consolas][COLOR=#008000][SIZE=3][FONT=Consolas][COLOR=#008000][FONT=Tahoma][COLOR=#000000]At the moment I'm not sure what's causing the menu to expand in the first place but it's causing me grief.[/COLOR][/FONT][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE] [SIZE=3][FONT=Consolas][COLOR=#008000][SIZE=3][FONT=Consolas][COLOR=#008000][SIZE=3][FONT=Consolas][COLOR=#008000][FONT=Tahoma][COLOR=#000000]So I guess the follow up question is how did @[URL='https://forum.team-mediaportal.com/members/albert.67886/']Albert[/URL] I guess intend the Activate function to work so I can do this properly? ;) [/COLOR][/FONT][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Calling a method within the Model once the Screen has completed loading
Contact us
RSS
Top
Bottom