No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<html> | <html> | ||
<div class="outdated-alert"> | <div class="outdated-alert"> | ||
<p> <span> ❗🕜 Warning: </span> this article may contain outdated information. Consider before using any descriptions/solutions, otherwise it still | <p> <span> ❗🕜 Warning: </span> this article may contain outdated information. Consider before using any descriptions/solutions, otherwise, it can still be helpful. <a href="https://wiki.mdriven.net/index.php/MDriven_Product_Line#Synonyms_and_name_changes"> <span> Help: Synonyms and name changes </a> | ||
</p> | </p> | ||
</div> | </div> | ||
</html> | </html> | ||
Open | Open the sample that comes with ECO: | ||
[[File:1 - WindowsPhone.png|none|thumb|409x409px]] | [[File:1 - WindowsPhone.png|none|thumb|409x409px]] | ||
Line 14: | Line 14: | ||
[[File:3 - WindowsPhone.png|none|thumb|387x387px]] | [[File:3 - WindowsPhone.png|none|thumb|387x387px]] | ||
The ReadMe explains the missing projects but since you are a developer you will probably not read it. | The ReadMe explains the missing projects but since you are a developer, you will probably not read it. | ||
Delete the missing projects | Delete the missing projects and add new references to MonoAndroidApplication1. | ||
[[File:4 - WindowsPhone.png|none|thumb|368x368px]] | [[File:4 - WindowsPhone.png|none|thumb|368x368px]] | ||
Line 29: | Line 29: | ||
Hit F5 – three windows pop up (the phone emulator starts slowly): | Hit F5 – three windows pop up (the phone emulator starts slowly): | ||
This is a simple WPF UI that shows the information in our “database” | This is a simple WPF UI that shows the information in our “database”. | ||
[[File:10 - WindowsPhone.png|none|thumb]] | [[File:10 - WindowsPhone.png|none|thumb]] | ||
This is the Root directory of our PersistenceServer | This is the Root directory of our PersistenceServer: | ||
[[File:11 - WindowsPhone.png|none|thumb]] | [[File:11 - WindowsPhone.png|none|thumb]] | ||
This is the Phone App | This is the Phone App: | ||
[[File:12 - WindowsPhone.png|none|thumb]] | [[File:12 - WindowsPhone.png|none|thumb]] | ||
Press the first of the X buttons | Press the first of the X buttons at the bottom of the Phone App. | ||
[[File:13 - WindowsPhone.png|none|thumb]] | [[File:13 - WindowsPhone.png|none|thumb]] | ||
Line 88: | Line 88: | ||
</pre> | </pre> | ||
</html> | </html> | ||
We switch back to the WCF app | We switch back to the WCF app and hit Refresh: | ||
[[File:15- WindowsPhone.png|none|thumb]] | [[File:15- WindowsPhone.png|none|thumb]] | ||
You can play around with the WPF app and the Phone | You can play around with the WPF app and the Phone App to ensure that objects created in one client can be seen in the other client after a Refresh. | ||
If things | If things do not work, consult the [[WCF issues|WCF troubleshoot.]] | ||
For now, that is all I am going to show you about the WindowsPhone. Disappointed? Don’t be – we did a lot. We saw strongly typed model-driven business objects on the phone with a WCF connection to the server – that persists everything and lets you find what is on the server. | |||
[[Category:WCF]] | [[Category:WCF]] | ||
[[Category:WindowsPhone]] | [[Category:WindowsPhone]] | ||
[[Category:Mobile UI]] | [[Category:Mobile UI]] |
Revision as of 12:57, 23 February 2023
❗🕜 Warning: this article may contain outdated information. Consider before using any descriptions/solutions, otherwise, it can still be helpful. Help: Synonyms and name changes
Open the sample that comes with ECO:
Open up the sln and ignore/ok this:
You will see this:
The ReadMe explains the missing projects but since you are a developer, you will probably not read it.
Delete the missing projects and add new references to MonoAndroidApplication1.
Choose browse and find the assemblies you downloaded in the PhoneBuilds.zip
Define what to start:
Hit F5 – three windows pop up (the phone emulator starts slowly):
This is a simple WPF UI that shows the information in our “database”.
This is the Root directory of our PersistenceServer:
This is the Phone App:
Press the first of the X buttons at the bottom of the Phone App.
The code on the phone:
private void ApplicationBarIconButton_Click(object sender, EventArgs e) { EcoServiceHelper.GetPersistenceService(_ecospace).Refresh(true); EcoServiceHelper.GetAsyncSupportService(_ecospace).PerformTaskAsync(new Action(() => { IObjectList list = EcoServiceHelper.GetOclPsService(_ecospace).Execute("Class1.allinstances->select(a|a.Class2->notempty)"); int noOfC1ThatHasC2s = list.Count; string extra = ""; if (list.Count > 0) extra = list[0].GetValue<Class1>().Attribute1; int noOfC1 = EcoServiceHelper.GetExtentService(_ecospace).AllInstances<Class1>().Count; EcoServiceHelper.GetAsyncSupportService(_ecospace).DispatchTaskToMainThread(new Action(() => { // UI Stuff - everyone is happy to see that we do this in the main thread ContentStack.Children.Add(new TextBlock() { Text = "db updated, Now C1 Total: " + noOfC1.ToString() + ",\r\n Total of C1 that has C2's " + noOfC1ThatHasC2s.ToString() + " " + extra }); })); })); }
The code makes use of some ECO services.
The other button:
Code:
private void ApplicationBarIconButton_Click_1(object sender, EventArgs e) { Class1 c1 = new Class1(_ecospace); c1.Attribute1 = "Created on WindowsPhone " + DateTime.Now.ToLongTimeString(); ContentStack.Children.Add(new TextBlock() { Text = "c1 created" }); _ecospace.UpdateDatabase(); }
We switch back to the WCF app and hit Refresh:
You can play around with the WPF app and the Phone App to ensure that objects created in one client can be seen in the other client after a Refresh.
If things do not work, consult the WCF troubleshoot.
For now, that is all I am going to show you about the WindowsPhone. Disappointed? Don’t be – we did a lot. We saw strongly typed model-driven business objects on the phone with a WCF connection to the server – that persists everything and lets you find what is on the server.