Well, we all know (who is programming in WPF) the may be one of the most recently used in WPF, OnPropertyChanged() method. In general we use this approach to notify data GUI, that data it bind to has been changed. Usually it will look something very similar to following: class MyClass : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; private string title; public...
There is interesting concept in C# - params. Here is the refference in MSDN Lets assume you want do create method that should add numbers and return a result. In our regular way we can build it as following: private int sumAllNumbers(int num2) { int sum = sumAllNumber(1, 2); return sum; } Such approach has some limits and not flexibale enough, because in...
Some times we have to pull numbers from mixed string. There are several ways to do it, so here i will indroduce some easy and quick one :) string fullSentence ="Just a sentence with numbers from 1 asd f3 234 6to10111" string numbers = Regex.Split(fullSentetnce @"\D+"); foreach(string number in numbers) { if(!string.IsNullOrEmpty(number) { int i =int.Parse(number); Console.WriteLine("{0}",i); } } Result: ...
Good news for those who interesting in game development ! Unity gives away serial numbers for free for theire product including plugins for android and iOS ! Hurry up, since it will till to 8 March ! ...
When i started to programming in Java (for Android purpose) in IntelliJ instead of Eclipse, i have found that DDMS tool i was working with in Eclipse is missing in IntelliJ. My searches in web reveal that such tool wasn't implemented in IntelliJ. But solution is simple: because the DDMS tool belongs to Android SDK and not to programming environments, it can be provided by Android SDK itself. So if we...
Sometimes we get an error or exception in Visual Studio which points us to some specific line where it has been occured. To make our work more effective, we could use following steps : In VS Tools->Options->Text Editor In order to see lines in cs files we choose C# In order to see lines in xaml files we choose XAML In order...
Lets assume we get an Image : Image img = new Image() { Width = image.Width, Height = image.Height, Source = image }; then, our solution will look as following : Uri path = new Uri(((BitmapFrame)imageControl.Source).Decoder.ToString()); ...