Quantcast
Channel: Infragistics Community
Viewing all 2372 articles
Browse latest View live

Internationalizing and Localizing .NET Desktop Applications

$
0
0

Introduction

This blog will provide examples of internationalization and localization across two .NET platforms - Windows Forms and WPF. The approaches are similar although the syntax is slightly different. A similar approach can be used in ASP.NET. Things get much different in HTML5 and JavaScript, where 3rd party libraries are often used.

Overview of the Project

The project, which we'll create in both Windows Forms and WPF, is a very simple UI with a label and a dropdown. Using just these elements, we can demonstrate the following aspects of internationalization:

  1. Strings in an external file
  2. Modification of UI layout
  3. An alternative to checking for string equality

Windows Forms Example

  1. In Visual Studio, create a new Windows Forms project.

  2. From the Common Controls section of the toolbox, add a Label and a ComboBox. Name them lblQuestion and cmbColor.
  3. Set the Text property of the Label to "What is your favorite color?". Instead of laying out the UI horizontally, we can do it vertically. This will allow more space for the translation of the question, as the spacing was tight in English, and other languages could have a longer string, which would truncate.


  4. Instead of adding strings directly to the Items property in the designer, add a few colors to the ComboBox through the code behind. This is done so that there can be a Value property associated with each item, instead of only Text.

    cmbColor.DisplayMember = "Text";
    cmbColor.ValueMember = "Value";
    
    var colors = new[] {
       new { Text = "Red", Value = "red" },
       new { Text = "Blue", Value = "blue" },
       new { Text = "Yellow", Value = "yellow" },
       new { Text = "Green", Value = "green" },
       new { Text = "Pink", Value = "pink" }
    };
    
    cmbColor.DataSource = colors;
    
  5. Add code to the SelectedValueChanged event to check if the user selected the green dropdown item. Note that this uses "SelectedValue", not "SelectedText", which is why we had to set the items in code to include a value that won't change based on locale.

    private void cmbColor_SelectedValueChanged(object sender, EventArgs e)
    {
      if ((string)cmbColor.SelectedValue == "green")
      {
          MessageBox.Show("Green is my favorite color too!");
      }
    }
  6. Now that we have everything set up, let's externalize the UI string resources. This can be done either before or after the initial design, as Visual Studio handles it for you either way.

    1. Set the Localizable property of the Form to true. This will setup the form resource file for you.
    2. In the Solution Explorer, open the Form1.resx file. You can see that the question has been added here.
    3. You can copy this file, rename the copy according to your target locale's culture code, and add it to the project. I'm using Japanese (ja) as an example.
    4. In the target locale's file, you can remove any entries beginning with ">>", as these don't need to be duplicated. You can also remove any entries under "Other", as well as any images, icons, files, etc. that you don't plan to change. Then you can translate the question.
  7. This won't work for anything in the code behind, because the Form1.resx file is autogenerated by the designer. If you add something to the .resx file that doesn't exist in the designer, then change the designer, it will remove what you added. Instead, for the code behind, let's add a separate resource file to the project.

    1. Add the key and value for the message in the code behind. Add the colors in here too.
    2. Copy, rename, and add the file to the project.
    3. Translate the entries from the code behind.
    4. Replace the hardcoded strings from the code behind with references to this resource file. You may have to rebuild to see the intellisense.

      private void cmbColor_SelectedValueChanged(object sender, EventArgs e)
      {
         if ((string)cmbColor.SelectedValue == "green")
        {
            MessageBox.Show(Strings.favoriteColorMatch);
         }
      }
      var colors = new[] {
        new { Text = Strings.colorRed, Value = "red" },
        new { Text = Strings.colorBlue, Value = "blue" },
        new { Text = Strings.colorYellow, Value = "yellow" },
        new { Text = Strings.colorGreen, Value = "green" },
        new { Text = Strings.colorPink, Value = "pink" }
      };
  8. Build and run the project.

  9. You can test out your other locale by using the following code in the constructor, before InitializeComponent:

    System.Threading.Thread.CurrentThread.CurrentUICulture = 
            new System.Globalization.CultureInfo("ja"); 

    WPF Example

    1. In Visual Studio, create a new WPF project.
    2. From the Common WPF Controls section of the toolbox, add a Label and a ComboBox to the <Grid> section of the XAML file. Name them lblQuestion and cmbColor. Set the Content property of the Label to "What is your favorite color?". You can arrange them vertically in a stack panel, which will allow more space for localized text.

      <Grid><StackPanel VerticalAlignment="Center"><Label Content="What is your favorite color?" HorizontalAlignment="Center" 
                          Name="lblQuestion" /><ComboBox HorizontalAlignment="Center" Name="cmbColor" Width="120" /></StackPanel></Grid>
    3. Add items to the ComboBox using the designer. Set the Content for the text, and the Tag for the value. The resulting XAML will look like this:

      <ComboBox HorizontalAlignment="Center" Name="cmbColor" Width="120" 
                     DropDownClosed="cmbColor_DropDownClosed"><ComboBoxItem Content="Red" Tag="red" /><ComboBoxItem Content="Blue" Tag="blue" /><ComboBoxItem Content="Yellow" Tag="yellow" /><ComboBoxItem Content="Green" Tag="green" /><ComboBoxItem Content="Pink" Tag="pink" /></ComboBox>
    4. Add code to the DropDownClosed event to see if the user selected the green dropdown item. Note that we will check the Tag property, not the Content property, to avoid internationalization issues.

       private void cmbColor_DropDownClosed(object sender, EventArgs e)
       {
           ComboBoxItem cbi = (ComboBoxItem)cmbColor.SelectedItem;
           if (cbi.Tag.ToString() == "green")
           {
               MessageBox.Show(Properties.Resources.favoriteColorMatch);
           }
       }
    5. Now that we have everything set up, let's externalize the UI string resources.

      1. Open the Resources.resx file that comes with the project.
      2. Add the keys and values for the question, message in the code behind, and colors.
      3. Copy, rename, and add the file to the project.
      4. Translate the entries from the code behind.
      5. Replace the hardcoded strings from the XAML file and the code behind with references to this resource file. First, add a namespace declaration to the XAML file.
        xmlns:resx="clr-namespace:WPFI18N.Properties" 
        Make sure you have set the resource file's access modifier to Public.

        Then you can use bindings to the file in XAML.
        <Label Content="{x:Static resx:Resources.question}" 
                HorizontalAlignment="Center" Name="lblQuestion" /><ComboBox HorizontalAlignment="Center" Name="cmbColor" Width="120" 
                DropDownClosed="cmbColor_DropDownClosed"><ComboBoxItem Content="{x:Static resx:Resources.colorRed}" 
             Tag="red" /><ComboBoxItem Content="{x:Static resx:Resources.colorBlue}" 
             Tag="blue" /><ComboBoxItem Content="{x:Static resx:Resources.colorYellow}" 
             Tag="yellow" /><ComboBoxItem Content="{x:Static resx:Resources.colorGreen}" 
             Tag="green" /><ComboBoxItem Content="{x:Static resx:Resources.colorPink}" 
             Tag="pink" /></ComboBox>
        In the code behind:
        MessageBox.Show(Properties.Resources.favoriteColorMatch); 
    6. Build and run the project.

    You can test out your other locale by using the following code in the constructor, before InitializeComponent:

    System.Threading.Thread.CurrentThread.CurrentUICulture = 
                   new System.Globalization.CultureInfo("ja"); 

    Conclusion

    In these two examples, we demonstrated how to take text, layout, and comparison into consideration when designing a desktop application.

    For testing, you can also change the CurrentCulture which will affect things like dates and number formatting. This doesn't apply in our simple example, but would impact a more complete application.

    Note that even in another language, the message only shows up if the green item is selected. This is why we didn't compare the text of the selected item - so that we don't have to worry about it not working.

    By planning for internationalization early, we saved ourselves from having to change the layout of the UI or change the comparison logic later in the development cycle.


Get a Free Copy of Eric Reiss’ Usable Usability

$
0
0

Usability has become a business imperative: The more difficult a product or service is to use, the less likely a customer will buy it (or will buy it a second time). Now you can learn the fundamentals of usability design with a free copy of Usable Usability: Simple Steps for Making Stuff Better, a concise guide to usability design by Eric Reiss, CEO of FatDUX Group.

Usable Usability author Eric Reiss

In Usable Usability, Eric divides usability design into two main categories: physical properties, which encompass functionality, responsiveness, ergonomics, convenience and foolproofing; and elegance and clarity, which consist of visibility, understandability, logic, consistency and predictability. Throughout the book, Eric explores how to improve usability in the design of physical objects, the layout and structure of websites and apps, and the processes and rules of services. How can your web forms be more responsive? How color help you improve the logic and predictability of your processes? How can user testing show you the ways your system can break down?

In addition to explaining key concepts in easy-to-understand terms, the book illustrates usability with photos of good and bad examples of products and services, brief anecdotes about usability experiences, and “tales from the trenches” of usability gone awry. Each chapter includes a checklist of questions to consider, resources for additional detail, and key concepts readers can Google to learn more.

Usable Usability draws on material that Eric taught as professor of Usability and Design in the Master of Digital Marketing program at the Instituto de Empresa Business School in Madrid, Spain. He also shares examples from industrial design, business cases, world history, and personal experience, illustrating how vital usability is in every part of our daily lives. From a bedside alarm clock or light switch, to the safety systems on a commercial aircraft, to the ecommerce sites where we spend our time and money, usability makes a difference to comfort, safety, and the bottom line.

“Not only do product and service usability complement each other, but ultimately, a bad experience with one element within a brand affects our willingness to get cozy with other elements,” Eric says in the book. “To ignore usability is to lose money. It’s as simple as that.”

To get your free Usable Usability e-book, simply download a free trial of Indigo Studio, which lets you create interactive prototypes as quickly and easily as setting up wireframes. Indigo Studio includes reusable design libraries, with elements optimized for a wide range of devices. Indigodesigned.com lets you conduct virtual usability testing so you can reach more users in less time, capturing valuable feedback to create a better design. Find out more about Indigo Studio and download your free copy of Usable Usability today. And hear Eric discuss the book and his thoughts about usability in a two-part podcast on The Storyboard.

Want to Work with Infragistics’ Consulting Team?

$
0
0

What is Infragistics Consulting?

Since its inception in 2008, the Infragistics Consulting Team has worked with customers across a wide variety of verticals and business challenges to design and build useful, usable, beautiful and maintainable software products using Infragistics’ suite of products. We pride ourselves in understanding what our clients need and want. Take, for example, our recent work with Keysight Technologies and Transport4, where we successfully collaborated with clients to create truly business impactful solutions.

In recent years, as Infragistics has grown, so has the Consulting Team. Thus, we are currently looking to expand our consulting partner ecosystem of experienced software developers, UX Architects, and UX Designers.

Why Join Infragistics’ Consulting Ecosystem?

Members of the consulting ecosystem have the opportunity to participate in Infragistics customer projects as part of the Infragistics team to meet the increasing demand from our customers. We provide a wide range of consulting and implementation services ranging from new solution design and implementation, technology migration and mobilization, application redesign, and usability testing to name a few. Projects last anywhere from a few weeks to a few months, or more.

As a member of a project team, you work with members of the Infragistics UX or Solution Development team to design and implement innovative business applications. Benefits include:

  • having Infragistics identify short- and long-term projects;
  • the option to work remotely or in our Cranbury, NJ office alongside Infragistics’ industry leading User Experience and Development professionals and as a member of an Infragistics project team;
  • the opportunity to solve difficult and satisfying business problems and deliver innovative solutions;
  • the chance to use the latest development tools and processes;
  • competitive rates, and more!

If you are an independent consultant with experience designing or developing outstanding business solutions, we invite you to join our ecosystem.

Ready to Join Our Ecosystem?

Simply email consulting@infragistics.com and a Consulting Manager will contact you to review your experience and provide further details about the program.

We look forward to working with you!

UXify US 2017 | Call For Proposals

$
0
0

UXify US 2017 is currently accepting proposals for the conference scheduled to take place at Infragistics in Cranbury, NJ on Friday, April 7. If you have a unique perspective on UX Research, Design, Development, Content and the process that underlies the creation of awesome experiences, we would love to hear from you!

In previous years, we’ve had speakers from AT&T, Deutsche Bank, HFI, Electronic Ink, EPAM, Google, Siemens, Infragistics and others. This is a single-track event with 60 to 100 participants, primarily UX professionals (research, design and development) and others interested in user experience.

When
Friday, April 7
Noon – 5pm

Where
Infragistics Headquarters
2 Commerce Drive
Cranbury, NJ 08512

Presentations
30 minutes in length, including Q&A
Topic should map to the theme “Making Technology Personal

Submission Requirements
Please send a 150-word presentation abstract and 75-100 word bio to krichardson@infragistics.com. Proposals are due no later than Friday, March 3, 2017 for consideration.

uxify 2017

ReportPlus Desktop Release Notes – Volume Release 1.1.250.0

$
0
0

ReportPlus Desktop Version 1.1.250.0 is here with feature enhancements, fixes and new SDK localization services too:

Enhancements:

  • Calculated fields editor functional improvements
  • SharePoint enterprise repository performance improvements
  • Added drilling support the Treemap view
  • Move dashboards and folders support
  • Implemented Change Visualization Type in View Mode option
  • Added SDK Localization Service
  • Ad-hoc Hierarchies support
  • Grid view styling improvements
  • Tooltips styling improvements
  • Application samples update

Fixed issues:

  • Tabular data number fields type is now correctly inferred when non-English region format settings are used
  • A large set of MIME types for CSV files is now supported, so that web resources are correctly loaded
  • Dashboards synchronization is now successful when a newly created folder is uploaded to the enterprise repository
  • SharePoint document library files are now shown in the data source metadata browser
  • Fixed incorrect items creation/update permissions being assigned to a user for the Enterprise repository root folder
  • Adding a global filter now immediately filters XMLA data
  • A “move” option is added for SharePoint dashboards repository
  • The items in the XMLA global filter for month date-time level are now sorted in the correct order
  • Multi-level hierarchies can now be expanded in XMLA global filter editor
  • Fixed dashboards synchronization issues after a shared item is removed from your view
  • Users with perpetual license can now successfully sign in the ReportPlus Desktop application
  • Dynamic global filter items with XMLA data source are now properly pre-filtered
  • Unselecting a measure item in XMLA global filter editor’s "With Data For Measure" section is now possible
  • An empty item is no longer added to a local filter's values list
  • Fixed date time field format settings previously not valid for Japanese
  • Treemap view tooltips no longer remain visible when they should disappear
  • It is now not possible to maximize widgets while in dashboard edit mode
  • Addressed an inconsistency in fixed columns behavior between XMLA and tabular data grid
  • Grid View / Chart View toggle button is now displayed only when applicable
  • Fixed an issue with chart markers not being shown for a step line chart in certain cases
  • The “IF({if-condition},{value if true},{value if false})” expression is now correctly evaluated when its two value arguments are of different type
  • Calculated field editor's type is now successfully changed when the field data type's changed by the expression result
  • It is now possible to export a dashboard to PDF/PPT even if you have not specified a logo image
  • A Save prompt is now displayed when a widget title is changed and then "Done" is selected
  • Addressed an issue with calculated field filter values not being correctly populated for non-argument functions
  • Fixed an issue with incorrect Value Column value being displayed in the Treemap view settings panel
  • Link to dashboard now works for the Treemap view
  • XMLA global filter "With Data For Measure" option’s visibility is now visible only when the IsDynamic option is checked
  • Header area is no longer visible when exporting a dashboard/widget as an image
  • XMLA fields' tooltip now provide more information on the item's origin
  • The ReportPlusViewer component is now available in Visual Studio's toolbox

We hope you’ll enjoy our latest release!

What’s New in SharePlus: Simplified Creation of Data Visualizations

$
0
0

We’re pleased to announce the release of a new version of SharePlus for iOS with a focus on simplified creation of data visualizations. As businesses race to become digital and keep work flowing anywhere, using data insights to make smarter decisions is more critical than ever before. Aware of the key role of self-service business intelligence (BI), we've significantly reduced the steps needed to create BI dashboards, making it even easier for you to directly visualize data from any spreadsheet or SharePoint list in SharePlus.

Get Actionable Answers from Your Spreadsheets — Fast

The new update will allow anyone in your organization to visualize the metrics that matter most to them in one place within the SharePlus app regardless of where data is kept (SharePoint, Office 365, Google Drive, Dropbox, Box, etc.). Data insights are now one tap away: create a visualization directly from within an open spreadsheet, from the 'Actions' menu of a data file or from the SharePlus home screen.

A familiar drag-and-drop interface guides you through the choice of grids, line charts, pie charts, histogram-like analyses, maps and more. Make sense of data sets of all sizes, realize trends and clearly inform your decision-making process to advance your business.

Figure 1: Creating data visualizations with SharePlus

Better Decisions with Data: Examples

Today’s workers need to be able to work wherever they are. With access to documents, data, and workflows within one secure native mobile app, it becomes much easier to make the right business decisions.

Financial Managers, for example, need to track and understand all key performance indicators at any moment. Spotting trends and opportunities in real time is possible only when you have the tools to quickly visualize the spreadsheets you’ve received from your team while you were away. Once you’ve created a data visualization based on a spreadsheet in SharePlus, like the one shown in Figure 2, the visualization automatically updates itself whenever someone edits the source spreadsheet.

Figure 2: A Financial Performance dashboard, created with SharePlus’ data visualization capabilities

Executive leaders also face challenges with their mobile — and often geographically dispersed —Board of Directors and leadership teams. Often, a simple data visualization presented at the right time is enough to help leaders steer the wheel in the right direction. In Figure 3, a simple doughnut chart shows them the company’s Services division is a key revenue generator, while the Software one may require investments to have its growth accelerated.

Figure 3: A Doughnut Chart of Sales by Product

Mobile sales teams are another common use case. They rely on SharePlus to work on and share important documents such as customer presentations and proposals, to manage tasks and client meetings. But they also understand the benefits of using data visualizations. The below sales rep, for example, might want to analyze why their pipeline performance has dropped almost twice within a period of one year:

Figure 4: Pipeline Performance of a Sales Rep

Based on the above (and many others) SharePlus use-cases we’ve observed, we’re certain that the new simplified data visualizations in SharePlus will enable your team to make smarter decisions and achieve better results.

SharePlus is the premier mobile collaboration and productivity application for Microsoft SharePoint on-premises and Office 365 – now available with the simplified creation of data visualizations. Try SharePlus Enterprise for iOS free for 30 days here.


A Night At The 2017 IxDA Awards Ceremony

$
0
0

As I wrote in an earlier blog, the Infragistics’ UX team was named a 2017 Interaction Design Association’s (IxDA) international awards competition finalist. It was a great honor to have been selected by the judges for our redesign of the complex, scientific software that controls Keysight Technology’s line of Atomic Force Microscopes.

[youtube] width="719" height="381" src="http://www.youtube.com/embed/3FvNREcZVVU" [/youtube]

As Infragistics’ user experience consulting group, the UX work that we do for our clients doesn’t always get the public recognition it deserves. While our efforts measurably improve the working lives of thousands of individuals across all industry verticals, our proudest achievements are often celebrated only by the project teams and the other UX folks here in the office. On the evening of February 8th, we celebrated with others in our profession!

IMG_2923

No, we didn’t win but there is honor in being selected and no shame in being runner up against the best examples of interaction design from across the world! Plus, we did get to go home with a trophy…which made us feel better ;-)

image2

Drop us a line if we can help you with your complex application!

---------------------------------------------

Kevin Richardson has been working in the area of user experience for more than 25 years. With a PhD in Cognitive Psychology, he has experience across business verticals in the fields of research, evaluation, design and management of innovative, user-centered solutions.

On the weekends, you can find Kevin on his motorcycle, racing for Infragistics Racing at a number of different racetracks on the East coast.

How Do You Research Something That Doesn’t Yet Exist?

$
0
0

I once was in a project-scoping meeting for a client who wanted to create next generation banking products and services. Since these were new ideas, they assumed that the customers didn’t exist yet. We were considering conducting contextual inquiries, and a colleague said, “You can’t research someone who doesn’t exist yet.” His point was that you can’t go out and observe a future set of tasks that no one performs yet. He was right that you can’t observe tasks that don’t yet exist, but he was wrong in assuming that observing what people do now wouldn’t be helpful in understanding what to design for the future.

Future customers, who will eventually buy and use your future product and services, won’t suddenly materialize from thin air. They already exist now and are presently doing something else. You need to find those people, and learn about them, to help you shape your new product or service.

Some people mistakenly think user research involves conducting focus groups and user interviews to ask people what they want and to get their opinions about future product and service ideas. In fact, those are the worst ways to gather information about a future design. Instead, user research involves going out to observe and interview people as they perform their typical tasks in their natural environment.

"" 
Image credit: Boegh

How to Research Something That Doesn’t Exist

But what do you do when you want to conduct user research for a future product or service that doesn’t yet exist? With a redesign, you can observe how people use the current product, and when you’re designing something new in a field with competitors, you can observe people using those competing products. But how do you research something that is completely new, without existing competitors, where the tasks and users don’t yet exist? User research is still very valuable in a situation like this, and the process is the same as with an existing product.

Identify the Users

First, identify the type of people who you think will use your new product or service. What characteristics and behaviors define them? You should have at least some idea of the types of people who might use it. If not, perhaps you should consider whether there’s an audience for the product.

Identify the Tasks

Second, identify the tasks that they will be performing with the future product or service. What current tasks will this product replace or enhance? What do they do now that is somewhat similar? At the least, you should know what domain of their lives that this new product or service will fit in. That’s what you want to observe.

Identify the Tools and Technology

Third, identify the tools and technology that they currently use, which the new product or service will replace or complement. You should understand how they currently use those tools.

Identify the Environment

Fourth, identify the environment that the new product or service will be used in. Your research will help you understand the environmental factors that you’ll need to consider in your design.

Conduct Research

After identifying these elements, visit these people to observe and interview them to understand their characteristics and behaviors, their current tasks, the tools and technology they use, and the environment in which they perform those tasks. For example, when designing a future banking product, you would want to understand how the target user group currently uses banks and manages their finances. Seeing their problems and successes will show you how your new product or service will fit into their lives. In fact, it may give you inspiration for additional innovations.

Don’t Ask For Opinions of Your New Idea

Finally, one thing not to do – don’t ask people for their opinions of your new product idea. It’s very difficult for people to imagine something that doesn’t yet exist. People are very inaccurate at predicting what they might or might not use in the future. Wait until you have a tangible prototype that people can use, to get their feedback.

"" 
Image credit: Christian Hellmann

Innovation Comes From Understanding

Successful innovation comes from understanding problems and opportunities and designing solutions to solve them. The old saying, “necessity is the mother of invention,” is true. People create inventions to solve problems. Sure, you can invent things that solve your own problems, and maybe those inventions will be useful to other people, but if you want to ensure that you create inventions that will solve other people’s problems, you need to first understand their problems, needs, and goals. The best way to get that information is by conducting user research.


Fast product delivery through prototyping: Charles Plath and Mike Fagan talk about development for the insurance industry on The Storyboard

$
0
0

In this episode of The Storyboard: Conversations about Usability and UX, (iTunes | RSS | Direct Download | Google Play | Stitcher | Soundcloud), Elden Nelson talks with Charles Plath and Mike Fagan of Instec, a company that develops custom software for insurance companies. Charles is Instec’s user experience director; Mike is vice president of product management. Together they explain how Instec uses prototyping and user insights to create products that meet the requirements of a regulated industry while helping customers differentiate themselves from their competitors. Instec offers fast time to market for its custom solutions, delivering wireframes and prototypes within weeks and initial versions of usable products within months. The company’s secret: agile development processes and Indigo Studio prototyping.

Mike and Charles discuss some of the design and development challenges they face, such as getting the initial creation teams to think more expansively, helping customers articulate what they really need in a solution, and identifying the right moment to shift from free-form ideation to building and testing a product design. Mike describes the Instec philosophy of getting the minimum viable version of a product into the marketplace as quickly as possible, so customers can start seeing benefits and solving problems immediately while the development team continues to work on more complex features to roll out later.

Indigo Studio has helped Instec improve its design and development process by enabling customers to see how a product will work in practice, when it’s still early enough to propose significant changes without slowing down the development schedule. Before prototyping, customer review meetings relied on slide presentations and sketched designs; customers could see the visual design but only get a partial view of the workflow and functionality. Now, when Mike and Charles present interactive prototypes made using Indigo Studio, “They get so into it that they forget it’s a prototype,” says Charles.

Charles points out that with prototyping, Instec can show customers what many competitors can only describe in future terms. “We actually show them,” Charles says. “Not only will you be able to get this product, but this is how it works. There’s absolute clarity about how it will function and operate.”

Tune in to this episode of The Storyboard for ideas about how to break through constraints during the ideation phase of a project and how to keep from making your prototype look too good — so that customers know they can still push for changes.

Visit iTunes to download the episode, and subscribe to The Storyboard.

UXify 2017 | Making Technology Personal

$
0
0

Celebrate UXify 2017 - Making Technology Personal with the Infragistics team and special guests on Friday, April 7, 2017 from noon till 5.

Our fifth annual FREE user experience event brings together the community of academics, practitioners, technologists, and business leaders for a conversation about applied design, UX, content strategy and development at Infragistics' ultra-sleek, central NJ-based headquarters. Lunch and soft drinks will be provided.

It's an excellent opportunity to network, learn, share knowledge and gain new insights!

Eventbrite - UXify US 2017 - Making Technology Personal

2017 Speakers

Welcome Remarks
Jason Beres
, Senior Vice President, Developer Tools, Infragistics

Kevin Richardson
Director of User Experience, Infragistics
Making Technology Personal...Again (Keynote)

Tracy Kroop
Director of User Experience, Dell Boomi
The Details Matter: Designing for User Experiences

Brian McElaney
Senior Software Engineer, Revzilla
Glue: Tools That Integrate Development and Design

Rebecca Danna
Senior Design Manager, IBM
UX for AI - Engaging the Human and the Computer

Jim Ross
Principal User Experience Architect, Infragistics
Exploring User Research Myths and Legends

Jack Cole
Design Director, Motivate Design
Customer Service Tech: Meeting Customers Where They Are

Jason Caws
User Experience Architect, Infragistics
Summarizing Infinity: Deciding What Data You Need

Ann Cosfol
VP of Customer Success, Journey Sales
New Product UX in Emerging Markets

Eventbrite - UXify US 2017 - Making Technology Personal

Don’t Get Stuck (to the bottom of a beer mug)

$
0
0

This past weekend I had a little post-St. Patrick’s Day fun hanging out with my husband at a local biergarten. We drank some delicious Belgian beer, shared a giant pretzel, and spent the afternoon people watching. Good times!

While sitting at the bar, my husband pointed out the non-traditionally shaped coasters they used there; they consisted of the usual circle to put your mug on with an extra bubble attached to the side.

 

Picture1

 

These are genius for two reasons: not only does the mug no longer cover the brand, this design gives you a tab to leverage so that your coaster doesn’t get stuck to the bottom of your glass.

 

Picture2

 

So simple, so obvious, how has no one thought of this before?

And THAT my friends, is the essence of good user experience. Our goal as UX professionals is to identify and solve problems people may not realize they have. Intuitive solutions like this one never fail to bring joy to the user and make them feel like someone is reading their mind before they are even aware of what they are thinking.

I never knew that I NEEDED a coaster that wouldn’t get stuck to my glass. Well sure, of course I didn’t like it when that happened, but I never said, “Gee, they should make a coaster that doesn’t stick to my glass.” Compound this with the fact that traditional coasters are printed with ads that are hidden most of the time and you have a real winner! Why advertise on something that no one will see? Solving two problems is always better than solving one and I’d like to buy whomever thought of this great idea a drink.

Now perhaps it was just a coincidence, but this new kind of coaster seems like quite an effective marketing tool because when we moved on to another restaurant for dinner, my husband drank Jameson’s for the rest of the night.

To read more about the connection between drinking beer and UX, check out my colleague Jim Ross’ thoughts about The Usability of Self Service Beer.

Expert Opinions: What does the future look like for Native apps vs. PWAs?

$
0
0

We’re really excited about the growth of the modern web in 2018, and our SVP of Developer Tools, Jason Beres recently had a chance to sit down with Stephen Fluin, Developer Advocate on the Angular team at Google.  We have three parts of the conversation, this post on the future of Native apps vs. PWAs, one on Server Side Rendering, and a third with the Angular team’s advice for Enterprise Developers. 

Jason Beres: One of the things I'm really interested in, and I think our customers are as well, is progressive web apps. I want to get your opinion on where you see progressive web apps going. Do you have an opinion on Native versus progressive web apps?

Stephen Fluin: Sure. So where are progressive web apps going? I would say that they are going to continue to evolve and allow us to build better experiences with the web technologies that we know and have today.

So, if I think back three or four years ago, progressive web apps didn't exist. A lot of the API's that we rely on now for building engaging web applications didn't exist so you had to build a Native application. I was in consulting at the time and I met with companies over and over saying, "Build a native home bot. Build a native home bot." Have a team for Objective-C. Have a team for Java. This is the way you should go.

But the web has done a lot of catching up with the Native mobile experiences, so the situation has changed. First, we now have a bunch of the API's so I buy us things like progressive web apps and service worker. I can build an offline web experience using web technologies, but also from the perspective that all of the kind of intermediate layers that exist for translating between a web developer's Native JavaScript in HTML and these sorts of things, and interfacing with Native device capabilities, they've gotten better at that process as well.

It used to be that they were always two years behind in terms of catching up. They're still behind in terms of their ability to fill and provide all of these kinds of modern, new capabilities that come out with the Native platforms, but they're much better at it now. They have a process down, they have a system, they have teams of people working on these things. 

It's both evolving from the perspective of pure web, and the platform itself is getting richer. We have lots of new API's for payment request, for engaging with the camera and recording audio and video, things like that. But even if you do need the most advanced API's to take full advantage of these mobile platforms, you can do that with web technologies.

Beres: If you fast forward three to five years, how does an individual's behavior change where they would expect it from their progressive web app versus having to go to an app store? If they find a merchant's app, like you did the shoe store in your keynote or the retail merchant, and I can do a lot through their site, I don't need their app.

I don't need to go to the iOS app store and download something. How do you see the future?

Fluin: I definitely see a convergence in terms of the way that people find apps and the way that people find websites where there's kind of value to both.

So when I find things on the web it can be very transactional, right? I'm not making a commitment to the website I visit.

I can browse them, they don't necessarily have all my information, I'm not giving up anything about my device to work with them. That's a huge way that I think we see apps becoming more like Android's Instant apps. Now I can take advantage of Android app features right away, but at the same time, we see that things are going kind of the other way where I want to have a long-term relationship using these web technologies. So I see conversions.

There's also a huge amount of value to the app store and Google Play, whereby having a curated marketplace with standardized reviews, standardized kind of permission system, I trust those places in a way that I don't, there's not a network of trust that has been yet established for the web. We get that implicit network of trust from things like social media and from friend recommendations, from search in general.

But they're not as well developed. They're not as formal.

Beres: That's interesting. You're right on there.

So then how does the, does progressive web apps potentially play into the Android instant app concept? Is it similar, the same? Would you be able to take a progressive web app and make it an instant app and put it in a store?

Fluin: I'm not as familiar with this, but at Chrome Dev Summit recently, the Chrome team actually announced a set of new capabilities for building mobile applications where now you can more seamlessly handoff between the web layer and the native layer and really unify these two code bases. I think that's a really exciting technology as well.

Beres: The conversions will happen probably organically. Mostly to what you were saying in your consulting days, there's not, the budgets aren't there anymore in the enterprise or in the small business to have different teams working on different platforms that are unique, so you need technology that's going to help you get some bit of scale, economies of scale for the apps that you're building.

Fluin:  Sure. And there's always going to be use cases for, “I do need to build a native application for every platform I want to target,” right?

Including kind of more interesting ones like Assistance for example. I think that the web, in general, is getting better at all those things and so the kind of business opportunity cost of not having those is decreasing.

Beres: Yeah, the user experience of the progressive web apps I've seen is really, really good.

So when the argument around, well we want this type of UX so we're going to go native, that argument gets less and less critical now because with the web you can mimic that experience really well with the PWA.

Fluin: Absolutely. We've seen with the ride-hailing services, Uber and Lyft, you see this with Twitter. We're seeing tons of PWA's. There's a really cool URL that I point a lot of people to, which is Chrome://serviceworker-internals.

If you type that URL into your browser, what you get is an internal kind of Chrome debugging report that shows you every PWA that you've visited. A lot of people are kind of shocked at how many there are. Sites that they browse every day are starting to add more and more of these PWA features without the user ever needing to make a conscious decision to do that.

###

We’d like to thank Stephen Fluin for his time in this interview, and invite you to check out more of what he has to say over at the Angular Blog. To learn more about Infragistics’ support for Angular, check out our Ignite UI for Angular page, and watch this space for the rest of the conversation.

Watch remote users interact with your prototype

$
0
0

A few months ago, we showed you how easy it is to use Indigo Studio to test your prototypes with actual users, even if you can’t directly observe them.

We’ve made it even easier since then: now, in addition to tracking your users’ interactions with your prototypes, you can also record the users themselves via their webcam (with their opt-in permission, of course). Every facial expression, eye movement, and vocalization is synchronized to the interactions recorded in the prototype, so you can really dig into the user experience!

Check it out for yourself—we’ve created a sample usability study so you can see how it works.

When you run the study, you’ll be prompted to install a browser extension to support video recording. For full video replays, we require Google’s Chrome browser, but if you’re only interested in recording interactions with the prototype, any browser will do.

Pretty easy, isn’t it?

If you want to see what the replay looks like from the perspective of the study owner, here’s a look at a usability test I set up and then took myself.

https://youtu.be/8GM3sPiqFZs

Notice how every word I say (yes, I talk to myself) and eye movement tracks to the cursor on the screen. Also notice the red and blue dots on the timeline—they correspond to incorrect and correct interactions according to the flow I defined when I set up the study.

It’s really that easy.

You can also easily generate and review a report from each study--here's an example.

If you’re an Indigo Studio Professional or Indigo Studio Enterprise user, you already have everything you need to run unlimited usability studies with video replays at no extra cost.

Or, you can download Indigo Studio Essential for free and get 30 days of full access to all of Indigo Studio Professional’s advanced features, including remote usability studies.

To find out more and try for yourself, visit our "Usability Testing at Scale" page and learn how Indigo Studio can help you ensure your user experience delights your users long before the first line of code is written.

How to dynamically create a Component in Angular

$
0
0

In this article, we will learn to create a component dynamically. You may need to load a component dynamically in various scenarios such as want to show a popup modal etc.

Let us assume that, we have a component as listed below, which we will load dynamically.

import { Component, Input } from '@angular/core';
 
@Component({
    selector: 'app-message',
    template: `<h2>{{message}}</h2>
`
})
export class MessageComponent {
    @Input() message: string;
}

To load MessageComponent dynamically you need a container. Let us say that we want to load MessageComponent inside AppComponent. We need a container element in the AppComponent.

Template of AppComponent is as below:

<div style="text-align:center">     <h1>         Welcome to {{ title }}!
     </h1>     <template #messagecontainer>     </template> </div>

As you see that, we have an entry point template or a container template in which we will load MessageComponent dynamically.

In the AppComponent, we need to import following:

  1. ViewChild, ViewContainerRef, and ComponentFactoryResolver from @angular/core
  2. ComponentRef and ComponentFactory from @angular/core
  3. MessageComponent from message.component

After importing required things, AppComponnet will look like following listing:

import {
    Component,
    ViewChild,
    ViewContainerRef,
    ComponentFactoryResolver,
    ComponentRef,
    ComponentFactory
} from '@angular/core';
import { MessageComponent } from './message.component';
 
@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    title = 'app';
}

We can access template as the ViewChild inside the Component class. Template is a container in which, we want to load the component dynamically. Therefore, we have to access temple as ViewConatinerRef.

ViewContainerRef represents container where one or more view can be attached. This can contain two types of views.

  1. Host Views
  2. Embedded Views

 Host Views are created by instantiating a component using createComponent and Embedded Views are created by instantiating an Embedded Template using createEmbeddedView. We will use Host Views to dynamically load MessageComponent.

Let us create a variable called entry which will refer template element. In addition, we have injected ComponentFactoryResolver services to component class, which will be needed to dynamically load the component.

export class AppComponent {
    title = 'app';
    @ViewChild('messagecontainer', { read: ViewContainerRef }) entry: ViewContainerRef;
    constructor(private resolver: ComponentFactoryResolver) { }
}

Keep in mind that entry variable which is reference of template element has API to create components, destroy components etc.

Now to create component, let us create a function. Inside the function, we need to perform following tasks,

 

  • Clear the container
  • Create a factory for MessageComponent
  • Create component using the factory
  • Pass value for @Input properties using component reference instance method

Putting everything, together createComponent function will look like listing below:

createComponent(message) {
    this.entry.clear();
    const factory = this.resolver.resolveComponentFactory(MessageComponent);
    const componentRef = this.entry.createComponent(factory);
    componentRef.instance.message = message;
}

We can call createComponent function on click event of the button. Let us put two buttons in the template and call createComponent function on click of the buttons.

<div style="text-align:center">    <h1>        Welcome to {{ title }}!
    </h1>    <button (click)="createComponent('Welcome Foo ! ')">Welcome</button>    <button (click)="createComponent('Foo Again ?')">Not Welcome</button>    <br />    <template #messagecontainer>    </template></div>

In output, you can see that component is getting loaded dynamically on click of the button.

As you click on the buttons component will be reloaded with different message.  You can destroy a component using destroy method on the componentRef.

destroyComponent() {
    this.componentRef.destroy();
}

 

Either you can destroy dynamically loaded component by manually calling the function or put it inside ngOnDestroy() life cycle hook of the component, such that when host component is destroyed automatically dynamically loaded component will also destroy.

Putting everything together, AppComponent will look like listing below:

import {
    Component,
    ViewChild,
    ViewContainerRef,
    ComponentFactoryResolver,
    ComponentRef,
    ComponentFactory
} from '@angular/core';
import { MessageComponent } from './message.component';
 
@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    title = 'app';
    componentRef: any;
 
    @ViewChild('messagecontainer', { read: ViewContainerRef }) entry: ViewContainerRef;
    constructor(private resolver: ComponentFactoryResolver) { }
 
    createComponent(message) {
        this.entry.clear();
        const factory = this.resolver.resolveComponentFactory(MessageComponent);
        this.componentRef = this.entry.createComponent(factory);
        this.componentRef.instance.message = message;
    }
    destroyComponent() {
        this.componentRef.destroy();
    }
}

At this point on running application, you will get an error because we have not set the entryComponents in the AppModule. We can set that as shown in the listing below:

import { AppComponent } from './app.component';
import { MessageComponent } from './message.component';
 
@NgModule({
    declarations: [
        AppComponent, MessageComponent
    ],
    imports: [
        BrowserModule
    ],
    providers: [],
    bootstrap: [AppComponent],
    entryComponents: [MessageComponent]
})
export class AppModule { }

This is all you need to do to load a component dynamically in Angular.

Like this post?

And there you have it! If you like this post, please like it and share it. In addition, if you haven’t checked out Infragistics Ignite UI for Angular, be sure to do so! They’ve got 30+ material based Angular components to help you code speedy web apps faster.

Infragistics Rounds Out 2017 with Awards from VSM, ComponentSource and SD Times

$
0
0

Before we close the books on 2017, we’re proud to announce that we ended the year with product awards from Visual Studio Magazine, ComponentSource, and SD Times Magazine.  

Visual Studio Magazine 2017 Reader’s Choice Awards

Infragistics products won gold, silver and bronze across six categories in the Visual Studio Magazine 2017 Reader’s Choice Awards. Readers vote for their favorite Visual Studio- and .NET Framework-related development tools and services in 36 categories. SharePlus Enterprise won Gold in the SharePoint Components and Tooling category, edging out the previous year’s winner in tight voting, according to VSM.

Infragistics products winning Silver were Ultimate UI for Windows Forms in the Component Suite: Desktop (WinForms, WPF) category, and Ultimate UI for Xamarin in the Component Suite: Cross-Platform (Windows, Mac, Linux, etc.) category. Bronze awards went to Ultimate UI for WPF in the Component Suite: Desktop (WinForms, WPF) category; Ignite UI for JavaScript/HTML5 and ASP.NET MVC in the Component Suite: Web (ASP.NET, HTML5, JavaScript, XAML) category; and Indigo Studio in the Software Design, Frameworks, and Modeling Tools category.

ComponentSource

Three Infragistics products were named to ComponentSource’s list of bestselling products for 2017: Infragistics Professional (formerly Infragistics NetAdvantage for .NET) at No. 7, Infragistics Ultimate at No. 20, and Infragistics Windows Forms at No. 46. The awards are based on 2016 sales figures by dollar value.

SD Times

Infragistics was one of eight companies awarded Best in Show for User Experience in the 2017SD Times 100 Software Development Awards. Honors go to companies with products “with tools and technologies that can win a user’s attention (and appreciation), regardless of device.”


Design Responsibly

$
0
0

Clients and users tend to appreciate the technical aspects of a design; the way the parts fit, the information architecture, the layout, the way it looks, how it meshes with expectations, the way it allows tasks to be accomplished. If they’re really attentive, they just might appreciate the way the design itself disappears, becoming part of the environment, unnoticed, supporting a users’ actions but never becoming more important than the action.

Philosophy and Vocation

I find it helpful to think about design as a philosophy rather than as a product, and a calling rather than a job title. Design is expressive. It moves us. Done well, design enables people to more completely become who they want to be. From kitchen utensils to complex scientific software, good design allows for the unhindered expression of human intention.

Our Responsibility

As custodians of design, we have a duty to positively affect the lives of others. I’m serious when I suggest that we should even have our own oath, “Do Only Good”, similar to the Hippocratic Oath, "Do No Harm”. After 27 years in this profession, I’ve learned that doing good isn’t always easy. It takes work, perseverance, and dedication to our craft. Even the best of intentions can be whittled away by compromises and self-interest. Constrained by the overlapping sets of user, business, and technical requirements, we may not always be able to design “outside the box,” but we need to always be thinking around the edges.

Beyond Deliverables

Our role in society, however, extends beyond our deliverables. Good work and satisfied clients are not enough. Our work has consequences. To borrow Alan Cooper's phrase, our goal should be to become “good ancestors.” We need to consider how our work impacts the broader, techno-social ecosystem. Will we be leaving the world better than we found it? This isn’t easy, and we certainly can’t know for sure. But striving to become a good ancestor should be a prerequisite for any designer who wants to be worthy of their title.

Design at Infragistics

Here at Infragistics Consulting, we pride ourselves on delivering thoughtful and useful design. Getting the job done isn't the same as getting the job done well and we sweat the small stuff because it matters. Let us show you how we can help by contacting us at services@infragistics.com.

Learn More

Announcing the new WPF XamDataGrid Control Configurator

$
0
0

If you're a customer of our Infragistics Ultimate UI for WPF controls, then you are probably already aware of our innovative new control configurators.  Configurators enable Infragistics customers to more easily learn and discover the control APIs because as properties or collections are changed at design-time, these changes are immediately reflected in the Configurator UI. The Configurators also have customized property window categories that group properties by feature.  The Infragistics Control Configurators are a giant leap forward in Visual Studio design-time tooling, providing you with an unparalleled experience and feature set.  Simply put, the control configurators are the gold standard of excellence for a design-time development experience.

With our initial release of the control configurators we supported the following controls:

  • XamBulletGraph
  • XamCategoryChart
  • XamLinearGauge
  • XamPieChart
  • XamRadialGauge

Since our first release, we have had a large number of requests for a control configurator for our most popular, and most complex control in the Ultimate UI for WPF product; the xamDataGrid.  The wait is over!  We are excited to announce the immediate availability of the new xamDataGrid control configurator.

As you know, the Infragistics WPF XamDataGrid is a feature-rich, high performing data grid that meets the needs of demanding enterprise line-of-business applications.  For new users the API and vast feature set can be overwhelming.  With the xamDataGrid control configurator, we make it dead simple to bind your data, add your fields and field layouts, and turn the most important features on and off with the click of a button.  When you're done adding the features you want, you simply hit the "Apply & Close" button and all the code will be generated for you.

Your next question is probably, "How do I get it?"

If you have already installed the Infragistics Control Configurators then you don't have to do anything.  The Visual Studio extension will be updated automatically via the Visual Studio Marketplace.  If you haven't installed the control configurators yet, you can download and install them directly from within Visual Studio or by visiting the Visual Studio marketplace.

If you are a WPF line-of-business developer, we strongly encourage you to investigateUltimate UI for WPF. Feature-rich controls, outstanding support, and design-time Control Configurators for visually configuring your controls, and let us know what you think.

The Infragistics documentation for the Configurators is here:

The Infragistics YouTube videos for the WPF Configurators are here:

Expert Opinions: Server-Side Rendering and Standards

$
0
0

As the web continues to evolve in 2018, developers need to know whether to rely on client side or server side rendering—or whether there’s a middle-ground approach. Our SVP of Developer Tools, Jason Beres recently had a chance to sit down with Stephen Fluin, Developer Advocate on the Angular team at Google.  This is the third of three parts of the conversation including the future of Native apps vs. PWAs, this post about Server Side Rendering, and one more with the Angular team’s advice for Enterprise Developers.

Jason Beres: In your keynote at Angular Connect, you talk about the benefits of server-side rendering. If I'm looking at things like search engine optimization, is there a benefit to using server-side rendering versus pure client side, or is there a negative effect? 

Stephen Fluin: It always depends on your audience. You should look at the specific situation, but for example, the Google web crawler is able to run JavaScript. So Angular applications, if you have the right polyfills, they will index perfectly.

Follow your routes. Navigate across your application. Get all your content index,  all that stuff.

Other search engine crawlers don't necessarily run JavaScript. So if those other search engines are important to you, then that's going to be a driver towards server-side rendering.

But the other thing I would look at is; do you have a share button in your application or do your users want to copy and paste your URL's and put them on Twitter or Facebook? Because those kind of scrapers, those web crawlers that social media platforms have also don't run JavaScript.

So being able to share a link and then have them by a single HB-request get out the bulk of your content and the images and things like that increase the connection to those platforms. And so that kind of also drives you to server-side rendering.

Then the last piece about it from my perspective is that it increases the perceived performance. I say perceived performance because technically you're actually slowing down the process with server-side rendering. By server-side rendering for users, you're giving them a fully rendered version of the application by HTML, because then the browser has to parse and then it bootstraps JavaScript and runs the application on top of that. And ultimately that's I think what enterprises are looking for.

It renders the page and then it renders the page with it. So if I look at every millisecond of performance, it's actually slower.

But because it's increasing the perceived performance, that's usually what matters.

Beres: I think a lot of the world was all server side rendering, then we came to client side rendering the last five to seven years, and it's interesting that you guys are, not going back to, but introducing a server side option in your framework.

Fluin: Yeah. Exactly. And for me, I give a talk at another conference called "What's up with the Web," because I find this really fascinating to watch how there's been a pendulum swing back and forth between client and server and right now the pendulum is swinging, or has swung far toward the client because experience is so key.

Every millisecond that I delay or interrupt my users I'm losing engagement. I can't quite come up with the number off the top of my head, but it's something like if you disengage a user or if you have them wait for a loading screen for more than four seconds, it's like a 60 or 70% chance they're going to disengage and go task switch, think about something else.

And so whether you're serving your employees and you're losing their focus or whether you're serving customers and you're losing their sales, these are both a really big deal.

BeresA lot of the discussions we have as a vendor delivering solutions like component libraries is around questions like; “Where's the web going? What's the best decision to make?” And there really is no standard, but I believe the good thing about Angular is that you guys are providing a more complete, prescriptive framework that developers can get behind. It’s like, “We're here. It's ready. It's primetime.”

You said at Angular Connect, "Thank you but we're sorry," to the folks that were using the beta versions and the RC versions. I think that's the right approach because you're building that trust, but now that you're on Angular 5, we're seeing more growth in Angular. And really it's because of the prescriptive guidance that you're pushing that gives a little bit of certainty and standardization moving forward.

And ultimately that's I think what enterprises are looking for.

Fluin: Yeah, I mean we're seeing huge growth as well. There are tons of production applications that launch every day using Angular, which is kind of really exciting to see all of our hard work paying off, kind of Angular coming back to the main stream so to say after the Angular JS to Angular 2 switch.

When it comes to stability, I really think that's key for developers, but at the same time we have to balance that with innovation. I really like how we've positioned ourselves for the future where we can keep you developing applications the way you learn. So you learn Angular and then you write applications one way. And then we can kind of automatically take advantage of the web as it continues to progress for you.

And I'll give a couple examples of this.

WebAssembly is a really cool new technology, but you shouldn't actually be shipping WebAssembly today for a lot of use cases.

But, as the Angular team, we're in a really unique position where if at some point WebAssembly makes sense for how you should be delivering all web applications, we could actually flip a switch and then instead of compiling down to ES5, we could be shipping WebAssembly. Then depending on bootstrapping, handling all the connected piece, all the dom communication for you and because we've had this platform approach, we're really uniquely positioned to do that.

And another example is the shift around ES modules. So ES modules have been a spec standard for a while. But they didn't actually exist in the browsers until basically this year. Like WebAssembly, it's maybe not the best idea today to try and ship an application with ES 2015 modules for search quality and for other reasons. But when that does make sense, or if there's a way for us to ship an application that automatically opts the user's modern browsers into those sorts of things for performance gains, we can do that for you because we're the ones handling the build tool chamber, the ones handling the bootstrapping for you.

I'm really, really excited to see the web continue to evolve and Angular developers being able to just turn a switch on or getting, receiving all these benefits automatically by default.

Beres: How do you see WebAssembly evolving in the next few years?

Fluin: I don't know. I think it's really exciting. We've almost gotten to a point where JavaScript was the assembly of the web, but obviously, WebAssembly's far more performant. I think it's going to evolve dramatically in the next couple years as we, as people start trying to use it. As they encounter all of the issues of cross-project compatibility, run times ... kind of permissions issues. We're going to have to work through all those things before every application, every site can take advantage of it.

Beres: For specific verticals, like financial services where they're building internal apps where every nanosecond counts, and performance is the primary goal.  So if dev teams can use any technology that will improve any type of performance, it could be interesting for them but I was intrigued when I saw WebAssembly a couple years ago at Google IO, and it's interesting to see that it's slowly making its way up the ladder, right.

Fluin: Yep. Exactly.

Beres: I mentioned Material earlier and there was a lot of talk about Material at Angular Connect. How do you see Material evolving or have do you see its use by Angular and other platforms over the years and is Material something that you guys are focused on? Or are you focused on other design languages as well?

Fluin: Sure. The Angular Material team is kind of focused on two things. First, they are focused on taking Google's Material Design philosophy and manifesting that philosophy as a set of usable components that give you the Material Design aesthetic kind of out of the box. If you add Material to your project, it's going to feel like a Material application. And that's really important for a lot of teams to have that from Google because we came up with Material design, we ship Angular, so having a default, “hey, I don't want to do any time thinking about my design.”

Beres: Like clarity. Use it and you get what you expect.

Fluin: Yep. So, Material ends up serving as kind of a great default, so to say. But then the other half of what they're doing is the CDK or the component depth kit which is designed to enable other people to build fantastic component libraries. It's really important to me at least that we have a healthy ecosystem of design philosophies, of approaches to component, of enterprise-grade solutions that solve the different problems. Material is never going to solve everyone's problems.

And so having us providing tools that help other component authors and vendors move faster, provide better quality user experiences, it's really their second mission.

I think if we look forward five years from now, that team is maybe still somewhat focused on Material, but they're also responsible for making all of the other component libraries successful.

Beres: What I hear a lot from our customers is, “Is it Material based? Does it work with Material?” So I think Material is getting that traction anyway because it's a beautiful stylized library, it has a beautiful look and feel.

Fluin: It feels very consistent across platform.

###

We’d like to thank Stephen Fluin for his time in this interview, and invite you to check out more of what he has to say over at the Angular Blog. To learn more about Infragistics’ support for Angular, check out our Ignite UI for Angular page. ICYMI- Here's part one of the conversation, and part three is available now.

Simplifying ViewChild and ContentChild in Angular

$
0
0

In this blog post, we will learn about ViewChild and ContentChild in Angular.

Essentially ViewChild and ContentChild are used for component communication in Angular. Therefore, if a parent component wants access of child component then it uses ViewChild or ContentChild.

Any component, directive, or element which is part of a template is ViewChild and any component or element which is projected in the template is ContentChild.

ViewChild and ViewChildren

If you want to access following inside the Parent Component, use @ViewChild decorator of Angular.

  1. Child Component
  2. Directive
  3. DOM Element

ViewChild returns the first element that matches the selector.

Let us assume that we have a component MessageComponent as shown in the below listing:

import { Component, Input } from '@angular/core';
@Component({
    selector: 'app-message',
    template: `<h2>{{message}}</h2>`
})
export class MessageComponent {
    @Input() message: string;
 
}

We are using MessageComponent inside AppComponent as shown in below listing:

import { Component, OnInit } from '@angular/core';
@Component({
    selector: 'app-root',
    template: `
  <div>
  <h1>Messages</h1>
  <app-message [message]='message'></app-message>
  </div>`
})
export class AppComponent implements OnInit {
    message: any;
    ngOnInit() {
        this.message = 'Hello World !';
    }
}

In application, you will get the output as below:

Here, MessageComponent has become child of AppComponent. Therefore, we can access it as a ViewChild. Definition of ViewChild is:

The Child Element which is located inside the component template”,

Here MessageComponent is located inside template of AppComponent, so it can be accessed as ViewChild.

export class AppComponent implements OnInit, AfterViewInit {
    message: any;
    @ViewChild(MessageComponent) messageViewChild: MessageComponent;
 
    ngAfterViewInit() {
        console.log(this.messageViewChild);
    }
 
    ngOnInit() {
        this.message = 'Hello World !';
    }
}

We need to do following tasks:

  • Import ViewChild and AfterViewInit from @angular/core
  • Implement AfterViewInit life cycle hook to component class
  • Create a variable with decorator @ViewChild
  • Access that inside ngAfterViewInit life cycle hook

In the output console you will find reference of MessageComponent, also if you can notice that __proto__ of MessageComponnet is set to Object. 

Now let us try to change value of MessageComponent property

ngAfterViewInit() {
    console.log(this.messageViewChild);
    this.messageViewChild.message = 'Passed as View Child';
}

Here we are changing the value of ViewChild property, you will notice that value has been changed and you are getting output as below:

However, in the console you will find an error: “Expression has changed after it was last checked

This error can be fixed two ways,

  1. By changing the ViewChild property in ngAfterContentInit life cycle hook
  2. Manually calling change detection using ChangeDetectorRef

To fix it in ngAfterContentInit life cycle hook you need to implement AfterContentInit interface

ngAfterContentInit() {
    this.messageViewChild.message = 'Passed as View Child';
}

Only problem with this approach is when you work with more than one ViewChild also known as ViewChildren. Reference of ViewChildren is not available in ngAfterContnetInit life cycle hook. In that case, to fix the above error, you will have to use a change detection mechanism.  To use the change detection mechanism:

  1. Import ChangeDetectorRef from @angular/core
  2. Inject it to the constructor of Component class
  3. Call detectChanges() method after ViewChild property is changed

You can use manual change detection like shown in below listing:

constructor(private cd: ChangeDetectorRef) {}
 
ngAfterViewInit() {
    console.log(this.messageViewChild);
    this.messageViewChild.message = 'Passed as View Child';
    this.cd.detectChanges();
}

Manually calling change detection will fix “Expression has changed after it was last checked,” error and it can be used with ViewChildren also.

To understand ViewChildren, let us consider AppComponent class created as shown in below listing:

import { Component, OnInit } from '@angular/core';
 
@Component({
    selector: 'app-root',
    template: `
  <div>
  <h1>Messages</h1>
  <app-message *ngFor="let f of messages" [message]='f'></app-message>
  </div>`
})
export class AppComponent implements OnInit {
    messages: any;
    ngOnInit() {
        this.messages = this.getMessage();
    }
    getMessage() {
        return [
            'Hello India',
            'Which team is winning Super Bowl? ',
            'Have you checked Ignite UI ?',
            'Take your broken heart and make it to the art'        ];
    }
}

We are using MessageComponent inside a *ngFor directive hence there are multiple references of MessageComponent. We can access it now as ViewChildren and QueryList as shown in the listing below:

@ViewChildren(MessageComponent) messageViewChildren: QueryList<MessageComponent>;
ngAfterViewInit() {
    console.log(this.messageViewChildren);
}

To work with ViewChildren and QueryList, you need to do following tasks:

  • Import ViewChildren , QueryList , AfterViewInit from @angular/core
  • Make reference of ViewChildren with type QueryList
  • Access ViewChildren reference in ngAfterViewInit() life cycle hook

In the output, you will get various reference of MessageComponent as ViewChildern as shown in the image below:

Now let us try to update properties of ViewChildren as shown in the listing below:

ngAfterViewInit() {
    console.log(this.messageViewChildren);
    this.messageViewChildren.forEach((item) => { item.message = 'Infragistics'; });
}

As you see, we are iterating through each item of ViewChildren and updating each property. This will update property value but again you will get the error, “Expression has changed after it was last checked” as shown in the image below:

You can again fix it by manually calling change detection like ViewChild. Keep in mind that we do not have ViewChildren reference available in AfterContentInit life cycle hook. You will get undefined in ngAfterContentInit() life cycle hook for ViewChildren reference as shown in the listing below :  

ngAfterContentInit() {
    console.log(this.messageViewChildren); // undefined 
}

However, you can manually call change detection to fix error:  “Expression has changed after it was last checked”

 To use a change detection mechanism

  1. Import ChangeDetectorRef from @angular/core
  2. Inject it to the constructor of Component class
  3. Call detectChanges() method after ViewChild property is changed

You can use a manual change detection like shown in below listing:

@ViewChildren(MessageComponent) messageViewChildren: QueryList<MessageComponent>;
constructor(private cd: ChangeDetectorRef) {
}
ngAfterViewInit() {
    console.log(this.messageViewChildren);
    this.messageViewChildren.forEach((item) => { item.message = 'Infragistics'; });
    this.cd.detectChanges();
}

In this way, you can work with ViewChild and ViewChildren.

ContentChild and ContnetChildren

Let us start with understanding about ContnetChild. Any element which is located inside the template, is ContnetChild.

To understand it let us consider MessageContainerComponent.

import { Component } from '@angular/core';
@Component({
    selector: 'app-messagecontainer',
    template: `
    <div>
    <h3>{{greetMessage}}</h3>
    <ng-content select="app-message"></ng-content>
    </div>
    `
})
export class MessageContainerComponent {
    greetMessage = 'Ignite UI Rocks!';
}

In this component, we are using Angular Content Projection.  You can learn more about content projection here

Any element or component projected inside <ng-content> becomes a ContentChild. If you want to access and communicate with MessageComponent projected inside MessageContainerComponent, you need to read it as ContnetChild.

Before we go ahead and learn to use ContentChild, first see how MessageContainerComponent is used and MessageComponent is projected,

import { Component, OnInit } from '@angular/core';
@Component({
    selector: 'app-root',
    template: `
  <div>
  <app-messagecontainer>
  <app-message [message]='message'></app-message>
  </app-messagecontainer>
  </div>`
})
export class AppComponent implements OnInit {
    message: any;
    ngOnInit() {
        this.message = 'Hello World !';
    }
}

As you see in the above listing that in the AppComponent, we are using MessageContainerComponent and passing MessageComponent to be projected inside it. Since MessageComponent is used in MessageContainerComponent using content projection, it becomes ContentChild.

Now, you will get output as shown below:

Since, MessageComponnet is projected and being used inside template of MessageContainerComponent, it can be used as ContentChild as shown in the below listing:

import { Component, ContentChild, AfterContentInit } from '@angular/core';
import { MessageComponent } from './message.component';
 
@Component({
    selector: 'app-messagecontainer',
    template: `
    <div>
    <h3>{{greetMessage}}</h3>
    <ng-content select="app-message"></ng-content>
    </div>
    `
})
export class MessageContainerComponent implements AfterContentInit {
    greetMessage = 'Ignite UI Rocks!';
    @ContentChild(MessageComponent) MessageComponnetContentChild: MessageComponent;
    ngAfterContentInit() {
        console.log(this.MessageComponnetContentChild);
    }
}

We need to do the following tasks:

  • Import ContnetChild and AfterContnetInit from @angular/core
  • Implement AfterContnetInit life cycle hook to component class
  • Create a variable with decorator @ContnetChild
  • Access that inside ngAfterContnetInit life cycle hook

 In the output console you will find a reference of MessageComponent, also if you can notice that __proto__ of MessageComponent is set to Object. 

 

You can modify the ContentChild property inside ngAfterContentInit life cycle hook of the component. Let us assume that there is more than one MessageComponent is projected as shown in the listing below:

import { Component, OnInit } from '@angular/core';
@Component({
    selector: 'app-root',
    template: `
  <div>
    <app-messagecontainer>
    <app-message *ngFor='let m of messages' [message]='m'></app-message>
    </app-messagecontainer>
  </div>`
})
export class AppComponent implements OnInit {
    messages: any;
    ngOnInit() {
        this.messages = this.getMessage();
    }
    getMessage() {
        return [
            'Hello India',
            'Which team is winning Super Bowl? ',
            'Have you checked Ignite UI ?',
            'Take your broken heart and make it to the art'        ];
    }
}

In the output, you will get many MessgeComponent projected as below:

Now we have more than one ContentChild, so we need to access them as ContentChildren as shown in the listing below:

export class MessageContainerComponent implements AfterContentInit {
    greetMessage = 'Ignite UI Rocks!';
    @ContentChildren(MessageComponent) MessageComponnetContentChild: QueryList<MessageComponent>;
    ngAfterContentInit() {
        console.log(this.MessageComponnetContentChild);
    }
}

To work with ContentChildren and QueryList, you need to do following tasks:

  • Import ContentChildren , QueryList , AfterContentInit from @angular/core
  • Make reference of ContnetChildren with type QueryList
  • Access ContentChildren reference in ngAfterContentInit() life cycle hook

 In the output, you will get various reference of MessageComponent as ContentChildren as shown in the image below:

You can query each item in ContentChildren and modify property as shown in the listing below:

ngAfterContentInit() {
    this.MessageComponnetContentChild.forEach((m) => m.message = 'Foo');
}

In this way, you can work with ContentChildren in Angular.

Summary

ViewChild and ContentChild are two very important features of Angular. It is used to access Child Component in the Parent Component.

Any directive, component, and element which is part of component template is accessed as ViewChild. Whereas, any element or component which is projected inside <ng-content> is accessed as ContentChild.

Like this post?

If you like this post, please share it. In addition, if you haven’t checked out Infragistics Ignite UI for Angular Components, be sure to do so! They’ve got 30+ material based Angular components to help you code speedy web apps faster.

Webinar Recap: Introduction to Angular for ASP.NET Web Forms Developers

$
0
0

This week I held a webinar for the APAC region, introducing Angular and Infragistics' offerings to ASP.NET Web Forms Developers.

In the webinar, I shared insights for browser market share and device type market share. I was shocked when I saw the actual number for market share for Internet Explorer, aka IE. I remember when IE was a dominant back in early 2000's.

These facts obviously tell you that you need to support multiple browsers, multi-devices across platforms. and it encourages ASP.NET Web Forms Developers to move on Modern Web App Development.

Desktop Browser

Desktop browser share

Device Type

Device Type Marketshare

source: NETMARKETSHARE

At Infragistics, we made a decision to invest in Angular because we believe Angular is one of the best JS frameworks for developing enterprise Line of Business modern web applications. Now we are offering 30+ Material UI based, 100% Angular components. With these components, you can create rich Angular apps by using Grid, List, Calendar and so on. Ignite UI for Angular is also free for non-commercial use and source code is available at GitHub. We also provide CLI tool that you can speed up your development whether you use Ignite UI for Angular or Ignite UI for JavaScript.

In case you weren't able to join us live, we've made a recording of the webinar and the presentation deck available below:

www.youtube.com/watch

I also briefly covered an Overview of Angular Architecture. I recommend anyone who is looking to get further into the topic watch a getting started angular webinar performed by DJ, my colleague and a specialist for Modern Web Development for your next step:

Next Steps

Ignite UI for Angular

Viewing all 2372 articles
Browse latest View live




Latest Images