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 :-
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 :-
And to get a feel for the overall structure in the SE pane, here is the collapsed view :-
And for some of you the expanded view is also useful, informative and instructive :-
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.
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 :-
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 :-
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 :-
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,
P.S. here is one of the constructor issues :-
Hope this helps the Team and some of you guys out there ;-0)
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.
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))
Yes, in image '_02'line 21 replaces your server name string - I discovered some months ago that 'localhost' will work on most SQL Server platforms - full and express from Microsoft. I tend to use this now for sample solutions that I place on 'OneDrive' for sharing and distribution - AND - it makes moving stuff over to laptops for conference sessions a doddle.
So now (see other attachments), the Person and City data appears right away (a few lines/records) and any that I enter stays in the DB between application launch events, it persists.
That's the good news, the bad news is that I can't really understand most of your code as yet ;-0(( I feel like a complete novice! The generic stuff seems a bit to me like the code equivalent of over normalising data - too much of it and all 'apparent meaning' seems to get lost!
Oh! and please remember that this is still your full C# applet, I have not as yet translated it into X# syntax, but I will, as a start to learning more on the generics side of things.
At least with a working X# sample we X# guys can all have a starting point for going further. So your legacy Nick, will linger on for a good few years yet ;-0)
DS2015Start will be a WPF Application (generates app.xaml and adds the WPF assemblies basically), the rest are plain class libraries. So for the View library you'll need to add the WPF assemblies manually for your user controls - apart from that you shouldn't need references to WPF anywhere else.