전체 글
-
WPF Animations and the Async/Await ModelIT Story/C# & WPF 2019. 11. 27. 18:30
I recently encountered this little gotcha at work, and thought it could benefit others, so… here you go. When you start an animation in WPF from code and then make an awaitable call, the animation fails to show until the call is complete. Why is this? As an example, suppose we have this click handler on a button: private async void _Button_Clicked(object sender, EventArgs e) { firstAnimation.Beg..
-
How to do async calls without locking the UI thread in WPFIT Story/C# & WPF 2019. 11. 27. 18:29
WPF developers that have worked with async await have most likely run into problems with avoiding race conditions with the UI thread, either making the entire UI lock up or burden the UI thread and cause clients not responding. This article will show you how to avoid this. The way to do this is to await using another thread and afterwards use that result back again on the WPF thread to do the up..
-
C#으로 ContainsKey and ContainsValue methodsIT Story/C# & WPF 2019. 11. 20. 22:12
The ContainsKey() method determines whether the dictionary contains the specified key and the ContainsValue() method determines whether the dictionary contains the specified value. using System; using System.Collections.Generic; namespace CheckElements { class Program { static void Main(string[] args) { var domains = new Dictionary { {"sk", "Slovakia"}, {"ru", "Russia"}, {"de", "Germany"}, {"no"..
-
How to get all elements of a ListIT Story/C# & WPF 2019. 11. 20. 22:08
Return value: This method returns a List containing all the elements that match the conditions defined by the specified predicate otherwise it returns an empty List. Exception: This method will give ArgumentNullException if the match is null. Below programs illustrate the use of List.FindAll(Predicate) Method: Example 1: // C# Program to get all the element that // match the specified conditions..