Git Product home page Git Product logo

snippets's Introduction

Shell XAML Snippets for Visual Studio

Luis Matos has organized an entire month of community blogging around code snippets. He gives a fine definition of what code snippets are, but I'll give you my definition.

You know the stuff that you have to write over and over, but can never quite remember the ceremony? The same stuff you find in an old project, or some blog, or some GitHub repos and promptly forget to make it easy to access. Those are code snippets.

I don't maintain my own collection of code snippets, primarily because I'm a lazy developer. Also in my role at Microsoft I reinstall my Visual Studio environment often. Oh, and because until today I didn't $#*&#$^ know how to add snippets. Now that I've done it, I'll promptly forget. :P

Shell Snippets

In the spirit of my very clinical definition above, I considered what code I kept copy-pasting from other projects because I couldn't be bothered to memorize them. Shell in Xamarin.Forms makes it really easy to create an app with a flyout menu or tabs. It's the next level of customizing those that I end up snagging from other projects. No longer! I hereby present to you my new collection of Shell snippets!!!

Disclaimer: these are currently for VS Windows only. You can create snippets for XAML in VS Mac, however there's a bug that stops you there.

Shell

  • ShellStyles - shell-styles will generate the styles for all the app-level colors and options

Flyout

  • FlyoutMenu - flm will scaffold out a series of flyout items
  • FlyoutItem - fli will generate a single flyout item
  • FlyoutItemStyles - fl-styles gives you the different styles needed for the label, image, and background of the item
  • FlyoutItemTemplate - temp-flyout will give you the default flyout item template that you can then expand and customize

TabBar

  • TabBar - tb will scaffold out a tab bar with several tabs
  • Tab - tab will generate a single tab item

Currently tabs cannot be templated and styles are not implemented. This is coming on the Xamarin.Forms roadmap.

MenuItem

  • MenuItemTemplate - temp-menu will give you the default menu item template that you can then expand and customize

In Conclusion

If you need guidance on how to implement snippets in Visual Studio 2019, head on over to the documentation guide.

Thanks again to Luis for organizing yet another great community effort.

Thanks to Tim Heuer for his 2013 blog about creating XAML code snippets.

snippets's People

Contributors

davidortinau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

shuheydev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.