moving over - to X# in all my apps ........

Public forum to share code snippets, screen shorts, experiences, etc.
Post Reply
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

moving over - to X# in all my apps ........

Post by Phil Hepburn »

Hi guys,

I am on a mission - to convert all my older xBase apps to X#. I have 38 to go!

Robert has kindly given me an updated copy of 'XPorter' so that WPF apps convert okay, there previously was an issue.

This has allowed me to make the first steps with the app shown below - it was the conference sample from 2015, which did MVVM, WPF, XAML and data binding, as well as use EF6.

Because we did not have Roslyn back then, I had to do the LINQ and some EF6 stuff in C#, so I made a 'DAL' - or thin "Data Access Layer". This is still present in the exported app, but I now intend to manually convert the C# so we have 100% working X# code. I will make this available when the task is completed so we can all see the required X# syntax.
Cologne2015Sample_01jpg.jpg
Cologne2015Sample_01jpg.jpg (113.81 KiB) Viewed 380 times
Note also that at the moment there is still 'VN' in some titles and folder/file names. All will change as I make the change-over. Hopefully no legacy 'bits'.

Hope this interests as few, and THANKS to Robert for the new working XPorter app.

Regards, 
Phil.
Wales, UK.
Frank Maraite
Posts: 178
Joined: Sat Dec 05, 2015 10:44 am
Location: Germany

moving over - to X# in all my apps ........

Post by Frank Maraite »

Hi Phil,

have a good journey!

Frank
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

moving over - to X# in all my apps ........

Post by Phil Hepburn »

Hi Frank,

Thanks for the 'travelling' support - the journey is now over (well the first part at least) and it was an interesting route for a journey, indeed ;-0)

I now have a re-shaped version of my main demo app for the 2015 Cologne conference. It is all in X# and no C# in site, or other xBase links either.

I am including an image of the better formed (structured) S.E. (solution explorer) pane from VS 2017 RC 3 as this helps explain what the app does for us :-
Xport2015_01.jpg
Xport2015_01.jpg (73.52 KiB) Viewed 380 times
You will see enough in the SE pane detail to know that we have a general MVVM pattern of design approach. As well as there being a strong presence of LINQ to support the Entity Framework (6) and 'code first' application.

Out of interest the first time I got the code to (eventually) compile, the database in SQL Server was correctly created and seeded with sample data. Great!

Here is the main 'entry' screen :-
Xport2015_02.jpg
Xport2015_02.jpg (64.22 KiB) Viewed 380 times
Each of the buttons in the two sets of seven, will produce a different 'View' which is of a UserControl format, and these UCs get swapped in/out of the ContentControl at the bottom half of the main screen.
Xport2015_03.jpg
Xport2015_03.jpg (134.97 KiB) Viewed 380 times
The screen can be dragged at the bottom right corner to size and accommodate the data grid contents - see these next two examples :-
Xport2015_04.jpg
Xport2015_04.jpg (167.75 KiB) Viewed 380 times
And now another which uses a couple of Enums for specific data values - eExp (experience) and eKnow (knowledge). You may have noticed a folder entry in the SE pane for 'Enums'.

Finally we have an example of an edit screen where data can be interactively changed and then saved back to the back-end database.
Xport2015_05.jpg
Xport2015_05.jpg (208.06 KiB) Viewed 380 times
In manually changing the C# code I noticed some code PRG dates of March 2013 - yes, a long time to wait for LINQ to be available to me in xBase. So thanks to Roslyn and Microsoft, and Robert and his team ;-0)

Before I go let me say I love the fact that I can use a single 'dot' in place of a double dot, most places in X# - this made the manual coding changes from C# to X# a lot less tedious ;-0)

Karl, I am sure you will shout at me for using ' . ' but it is easier, and I am a lazy guy ;-0)

Hope this interests a few - AND - guys attending the Conference in Cologne will get a full and FREE copy of this.

Cheers,
Phil.
Wales, UK.
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

moving over - to X# in all my apps ........

Post by Phil Hepburn »

Hi guys, Robert, one and all,

You may wish to see the app in action - X# LINQ to reality perhaps !? ;-0))

[The extension mp4 has been deactivated and can no longer be displayed.]

However, I think the next larger area video is just a bit too large for posting here so I will supply a OneDrive link just in case :-

https://1drv.ms/f/s!AiCBl-gBWjY9g4kCWBEIRVQWUExk9w

Probably Robert may make changes, or come to the rescue. The file size is just over 5 Megs - because I had to increase the screen capture area so I could demonstrate the app main screen re-sizing to fit/suit the data display.

I will try here just in case I can get away with it :-

Nope, it does what is says on the can - 4 Megs only at the moment.

Good luck with the viewing, which ever way you do it.

Regards,
Phil.
Post Reply