Async Await in Windows apps for UX

Friday, July 17, 2015

Asynchronous programing can help us to improve better User Experience Like on next scenario: You got list of items , now every selection on any list items made some IO operation or complex validation on server or whatever. You can easily solve it out with async operation. View: <ListBox IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Data}" SelectedValue="{Binding MyProperty, UpdateSourceTrigger=PropertyChanged}" /> ViewModel: public List<string> Data { get { return new List<string>() { "aa", "bb", "cc", "dd", "ee" }; } } public object...
אין תגובות

Async Await in Windows apps for beginners

Wednesday, March 4, 2015

In basically asynchronous programming may be required a long study, since we running on a single . UI thread, however we can start with small demo of mining data and live update .Think about list of items and notification from the server ,Now, if we used regular function the view get freeze until the function return .But with asynchronous pattern we can continue while the background task is running :For this demo lets use this xaml <Window x:Class="AsyncAwaitDemoOnWPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> ...
אין תגובות