Exploring NDepend

Recently, I was looking for tools to improve code readability as well as tools which can help me to write better code. There are many tools. And then I met NDepend – often called as ‘Swiss Army Knife for .NET developers’. And glad that I could try it out. This tool can check your code on many parameters, for example coding standards, code quality, dependencies and what not.

Here, let me give you a glimpse of what it can do. However, I’m covering just 1% of what it actually does and what I understood. There are many things, which I’ve yet to explore.

To start with, when I open my project in NDepend, it analyzes it and gives a detailed report. One part of it is basic details about app statistics. It is like a dashboard.

image

This report shows, number of lines commented, assemblies and its member count and other parameters.

This tool also shows violated rules and how they can be fixed

image

On clicking on those violations, you will be taken directly to that code where it can be fixed.

One of the best and most important thing about this tool, also the one that I liked is it shows dependency graph. This can help you if you want to improve the app architecture. Basically you need to know your app’s dependencies when you’re deploying/publishing it. Lesser the dependencies, better the product Smile

image

One more thing, which I think as the key feature of NDepend is Treemap Metric View. In this case rectangles represent method and the size depends on the number of lines. However, this view can give more details. Read more about it here

image

As I mentioned before, I haven’t got a chance to explore all the features of this tool. But this post can give you the idea about what it can do and how it can help you. As and when I’ll explore more features of it, I’ll write it down here. Meanwhile, do give it a try here: http://www.ndepend.com/ 

Happy coding
Mayur Tendulkar

#365 Admin

I carpool to work with Dev. We enjoy our ~45 mins. ride and while traveling we listen to 80’s/90’s songs (If given a chance he would kill me for my choice of songs Smile) and also talk about various things at our day-to-day job and how those can be automated. One of the thing that we discussed was basic – User Management. E.g. adding a user, resetting password, etc.… So, we thought about enabling IT admins to manage their Active Directory remotely.

Recently, I was working on a project where we had to use Azure Active Directory for user management. And I thought it can add value if ported on mobile. So – #365 Admin.

Using this tool, IT admins can browse through users, reset their password or add a new user. This is v1.0 release and I’m planning to add more features and release updates once in a month or as and when ready/required.

Thanks to Girish, Aviraj and Vittorio for all their support while building this app.

The app is certified in the store and will be available in general in coming weeks.

Thanks,
Mayur Tendulkar

//PUBLISH – Global Event Updates

Microsoft is hosting a global event //PUBLISH. This event is in series with //build, //learn and will be called //publish. You can find more information about this event at: https://publishwindows.com/ 

The idea behind this event is to help you get your apps in the store. If you’re working on any existing app (Windows Store or Windows Phone) or have an app idea, we’ll help you to complete it and submit it on the store. We at Pune User Group are happy to say that, PUG will be hosting this event in Pune. As this is a global event, we’ll be hosting it on the same dates i.e. 16th and 17th May. This post will give you idea about the event.

In Pune, you can find agenda and registration details here: Pune Link. Once you register, we’ll send confirmation mail to registered users and they’ll be invited for the event.

As it is going to be session+coding+support event, please make sure that your machine is properly configured. Please get the latest version of Visual Studio and Windows Phone SDK installed on your machine to avoid confusion at the venue. If you need any help with it, please contact us. My email ID is mayur.tendulkar {at} puneusergroup.org

And have I mentioned, there will be prizes too (for eligible candidates Smile)

Till then.. register and happy coding.

Mayur Tendulkar

It’s All About Controls (Part 2)

Thanks for reading Part 1 of this multi-part blog post. If you’ve missed, in Part 1, we talked about what has been added (or converged with Windows) in Windows Phone 8.1 SDK. This part will mainly cover the changes that are included in this SDK. These are important changes and you must make a note of it to build stunning apps. Perhaps, later, there will be part 3, in which I’ll cover some 3rd party components, which can be used in Universal apps. Do let me know if you want to cover anything specific.

Panorama Is Now Hub

wp_ss_20140421_0003 wp_ss_20140421_00014

With Windows and Windows Phone convergence, Panorama control from Windows Phone is changed to Hub control. It is similar to Hub control available on Windows and gives effects like Panorama. It also, share the same XAML in both the platforms

image  

image


StatusBar (SystemTray) Changes

StatusBar or SystemTray is top-most component on page, which shows various details:

image

In Windows Phone 8 apps, you could show/hide system tray from XAML. For example:

image

Now, in 8.1 (WinRT) apps you’ll need to use code behind to do it. For example:

image


Flyouts, Flyouts Everywhere

Flyout is a new control in WP8.1 SDK. As MSDN says, use it to display lightweight UI. Also, unlike a dialog, a flyout can be lightly dismissed by clicking or tapping outside it. You can create a flyout by using following code. And actually add a flyout to any control which is a FrameworkElement.

1  

image


Command From Your Bar

With WP8.1, you do get your old AppBar.. but also get CommandBar. This command bar shares code with Windows. It also have Primary Commands and Secondary Commands. Which represents main buttons and menu on bottom app-bar in WP app. Whereas, on Windows, they have positions on app-bar as left and right.

image

image


Zoom – SemanticZoom

With WP8.1, LongListSelector is gone. However, it is replaced with SemanticZoom – in convergence with Windows. This control actually has two views which are shown in different way according to Zoom In/Out mode. It will be another topic for blog. But to put it into simple words: you’ll see a large list of photos in Grid. But when you *squeeze* it, you’ll see a list. OR vice a versa as you design your view.

image

With these controls, there are some more changes in controls are added. Like RichTextBLOCK (not Box), WebView (not Browser). But I would love to keep this post short.  

In next series (rather, I’m planning to change the name Smile), I’m going to talk about API changes in Windows Phone 8.1 SDK. Meanwhile, do let me know your feedback and if you want anything more covered here.

Happy Coding

Mayur Tendulkar

It’s All About Controls (Part 1)

Any app, be it a normal desktop app, web app, mobile app or tablet app – requires controls. Right from the Page (yes, page is also a control within a frame) to textbox, button, etc. are all controls and they play a key role in building these apps. With latest update to Windows Phone, there are lots of (and good) updates to controls available in Windows Phone SDK. In this post, we’ll try to cover these updates. As I said, there are lots of updates, we’ll cover them in parts. This is part one.

In-Built Theming Support

While implementing (or forcing) themes in Windows Phone 8 apps, you as a developer had to depend on some third party libraries. One famous library by Jeff, ThemeManager was very helpful. With 8.1, theming is in built into Windows Phone, just like Windows store apps. You can use RequestedTheme property to set the desired theme. Also, you don’t need to restart the app to take theming into the effect.

image

Icing on the cake: This property is available to all UIElement, that means, you can set it not for just page but also to StackPanel, TextBox, etc. as well & design your UI as you wish.

Head For All

Remember arranging that TextBlock just above the TextBox to give a label to it? Now, you don’t need to juggle with it. Almost every input control like TextBox, DatePicker, TimePicker has a Header property. And apart from it, controls like TextBox also have a PlaceholderText property, which allows you to provide ‘watermark text’ So, now you don’t need Watermark Textbox Control too.

image

Windows Phone Toolkit – Is In-Built!

From above code sample, you might have guessed that, DatePicker, TimePicker and such controls are newly added to the Windows Phone SDK. Previously available in Windows Phone Toolkit, many controls are now part of SDK. Just see the difference in Windows Phone 8.0 and 8.1 control set and you’ll get the picture Smile

Windows Phone 8.0 Windows Phone 8.1 8.1 Continued…
image image image

So now, for basic controls you’re not required to depend on 3rd party libraries. There are some special cases though and I’ll talk about them in later posts.

In-Built Animations

Animations are very important to give fast & fluid feeling. They also provide feedback. Imagine you click on a button and you don’t feel that it is clicked! Windows Phone has some in built animations by default. But just like controls, Windows Phone Toolkit provided additional animations api for your apps. Now, with this release of SDK, those animations are also available to you, without depending on any libraries. For example some page transitions are available here. And below code can tell you how to use them.

image

Now, before ending this post, I would like to comment here that you can use this code (which is in Windows Phone app) in your Windows Store apps. Yes. The XAML is almost same for both kind of apps. So, you can share maximum XAML code with these platforms. Which also means, you get theming, animations, controls (DatePicker, TimePicker, etc…) in Windows as well. And you can just copy paste the code or do a file-linking. Below picture (from //build session) can give you more idea Smile

image

These are all good additions. Now, with these additions there are some changes. For example, Panorama is gone and replaced with Hub control to align with Windows controls. Changes in how you access System Tray, etc. And we’ll talk about these changes in next part.

Till then… Happy Coding.

Mayur Tendulkar