Beta 10 and Vs 2017 - great !!

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

Beta 10 and Vs 2017 - great !!

Post by Phil Hepburn »

Hi guys,

Well, I have given Beta 10 and the Visual Studio integration a bit of a good test earlier today.

I even managed to find the Beta 10 installer before Robert had posted his news ;-0)

I like the improvements and the new version certainly speeded up my task of manually converting Nick Friends IoC (inversion of control) sample from C# into X#. For those who don't know Nick, he created an MVVM sample app for our User Group meeting many years back now, and it still stands the test of time as a useful app pattern to follow. I will make the working X# solution available to those who wish to see it and try it out - Nick, if you have any objection then shout now !

Before we go into more detail about VS 2017, here is the picture of success - yes, it surprised me, I did think I would have more issues than I did :-
beta10_NFdemoApp_01.jpg
beta10_NFdemoApp_01.jpg (53.58 KiB) Viewed 274 times
Not fantastic to look at, but it all works interactively as expected. Now below we can see that in my code I had already had code lines entered with 'self:' embedded, but today I used quite a few 'self.' with the single dot or point. The next image shows both in one image, lines 24 and 36 :-
beta10_NFdemoApp_02.jpg
beta10_NFdemoApp_02.jpg (74.43 KiB) Viewed 274 times
And to get a feel for the overall structure in the SE pane, here is the collapsed view :-
beta10_NFdemoApp_03.jpg
beta10_NFdemoApp_03.jpg (45.28 KiB) Viewed 274 times
And for some of you the expanded view is also useful, informative and instructive :-
beta10_NFdemoApp_04.jpg
beta10_NFdemoApp_04.jpg (82.41 KiB) Viewed 274 times
Yes, you can see the MVVM general structure, and the References section (expanded below) shows the required Galasoft framework for MVVM as well as the 'IoC' stuff - the Controller to allow us to separate out the opening, display, and closing of the Windows and UserControl GUI stuff.
beta10_NFdemoApp_05.jpg
beta10_NFdemoApp_05.jpg (77.07 KiB) Viewed 274 times
Now then folks, what are the negatives to what I have done today, what gave ne grief in the VS IDE ?

Well, even though I could happily mix my coded 'self:' and 'self.' bits, when I came to a final compile and run, the code in a file generated by the 'system' showed this :-
beta10_NFdemoApp_06.jpg
beta10_NFdemoApp_06.jpg (42.08 KiB) Viewed 274 times
Yes, for some reason line 51 and the ' : ' after SELF was not liked. And even though I did not really know what I was doing I changed this manually and the app then compiled and ran !

Here is the change and run screen image :-
beta10_NFdemoApp_07.jpg
beta10_NFdemoApp_07.jpg (145.67 KiB) Viewed 274 times
So why this happens only on line 51 we need Robert and his Team guys to tell us.

Now then some more issues with VS2017 and beta 10 - I had a few errors and 'drop outs' when VS stopped and reset itself. I was not too surprised - AND _ I was copying chunks of C# code into the X# editor before manually cleaning it up. The Constructors in a few code files gave me most of the drop-out issues. However the one seen below in in the App file :-
beta10_NFdemoApp_08.jpg
beta10_NFdemoApp_08.jpg (109.33 KiB) Viewed 274 times
I like the #regions and the expand / collapse now available. I will continue to try stuff out as I go along with my preparation for Cologne, but there are a lot to things to try.

Summary is - good news - working apps can be made and got to work.

I realise that VS integration is a complex and difficult aspect / issue, however, it is important to many of us, so work in progress and keep on improving it a few more things at a time. I am more than willing to help by testing.

Cheers, and Best regards,
Phil.
Wales, UK.

P.S. here is one of the constructor issues :-
beta10_NFdemoApp_09.jpg
beta10_NFdemoApp_09.jpg (38.68 KiB) Viewed 274 times
Hope this helps the Team and some of you guys out there ;-0)
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

Beta 10 and Vs 2017 - great !!

Post by Phil Hepburn »

Hi folks,

Here is the link to my OneDrive folder where you can find Nick's IoC sample :-

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

Please let me know if you have any issues or problems with downloading and/or running the sample.

Regards,
Phil.
NickFriend
Posts: 248
Joined: Fri Oct 14, 2016 7:09 am

Beta 10 and Vs 2017 - great !!

Post by NickFriend »

Hi Phil,

No problem and no objection of course. However I would suggest that if you want to do an example with all this stuff, the one I did for DevShare 2015 is much better.... uses generic base classes for data access and various other bits, and attaches to Entity Framework for the data (though you can easily unplug that and put in some static data to make it easier). It's generally better structured.

I thought that was the one you were using... stands the test of time better than the UG one which I did a couple of years before. Another point is that it has plenty of documentation in the code as well.

Nick
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Beta 10 and Vs 2017 - great !!

Post by wriedmann »

Hi Phil,

even if I like XIDE much more than Visual Studio, I have tried to create a small WPF application in VS 2015, and yes, Intellisense works now like expected.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

Beta 10 and Vs 2017 - great !!

Post by Phil Hepburn »

Hi Nick,

Point taken on the sample, and Generics too, that is another aim of mine.

The issue is however, that unless many of us guys get a suitable, simple enough, example to follow then doing all stuff at once turns guys away. There is just too much new stuff that way around.

I am happy enough now, to focus on IoC (inversion of Control) because I have a good feel for MVVM and making data binding work correctly and 100% of the time. Then there is LINQ, Lambda, Anonymous Types - the list goes on. So I need a steady - steady approach, you know, a bit at a time.

I am thinking of writing in X# various samples, small to medium, and including some parts then more parts in other examples. We need a 'step ladder' approach I feel.

Also remember that you are using C# and have all the features of the language (for years) and 100% of the VS integration works 100% time. We are still on our way to some of those goals.

Us X# guys now have a lot available, but also have a few BIG steps to take to get to doing things the modern .NET way.

But please do keep suggesting to me when you see fit. I need all the ideas I can get.

I will be back to you for Generics ;-0)

Oh! and I also need to fit into the development pattern the Unit Testing, that is a real must.

My immediate plan is to now design and write/create an 'IoC' sample which is simply the switching from one screen to another - the basic framework as it were. I will do that using the current IoC sample of yours, now that I have all the correct X# syntax to use.

Glad to hear that you survived the decorators - what colours do you now have on the walls and ceilings ? Assuming that you still have walls and ceilings, after the mayhem ;-0))

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

Beta 10 and Vs 2017 - great !!

Post by Phil Hepburn »

Thanks for doing that test Wolfgang, it helps me out.

I have gone over 100% to VS 2017 Enterprise, so I don't wish to re-visit VS 2015.

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

Beta 10 and Vs 2017 - great !!

Post by Phil Hepburn »

Hi Nick,

If you have your hands on the DevShare 2015 sample you refer to, could you please post it to me one way or another - OneDrive and shared link is best !?

Then I will look at converting it to full X# code etc., etc..

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

Beta 10 and Vs 2017 - great !!

Post by Phil Hepburn »



Hi Nick,

I think I have found the sample you refer to.

Is this image looking right, can you remember ?

When I run this in VS 2017 it compiles and runs but seems not to have any backend data.

Did you use a proper EF6 database and Code First approach ?

Cheers,
Phil.

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

Beta 10 and Vs 2017 - great !!

Post by Phil Hepburn »

Whoops !

Forgot to attach it .............
NFdevShare15_01.jpg
NFdevShare15_01.jpg (39.32 KiB) Viewed 274 times
Does this look right ?

Phil.
NickFriend
Posts: 248
Joined: Fri Oct 14, 2016 7:09 am

Beta 10 and Vs 2017 - great !!

Post by NickFriend »

That looks like it... you'll need to edit the connection string according to your SQL Server instance. I think there should be a Readme file in there somewhere with some instructions/suggestions.

Nick
Post Reply