﻿
{"id":4088,"date":"2016-04-20T14:12:15","date_gmt":"2016-04-20T14:12:15","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=4088"},"modified":"2016-04-20T14:12:15","modified_gmt":"2016-04-20T14:12:15","slug":"cta-inotifypropertychanged-interfaceinin-kullanimi","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/cta-inotifypropertychanged-interfaceinin-kullanimi\/","title":{"rendered":"C#&#8217;ta INotifyPropertyChanged Interface&#8217;inin Kullan\u0131m\u0131"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>Olu\u015fturdu\u011funuz herhangi bir s\u0131n\u0131fta; propertylerin de\u011fer de\u011fi\u015fikliklerinde veya metodlar\u0131n algoritmalar\u0131nda olay yaratmam\u0131z\u0131 sa\u011flayacak olan INotifyPropertyChanged Interface&#8217;ini tan\u0131taca\u011f\u0131m.<\/p>\n<p>Yaz\u0131m\u0131z\u0131 k\u0131sa tutmak i\u00e7in hemen mevzuya giri\u015f yap\u0131yorum.<\/p>\n<p>INotifyPropertyChanged Interface&#8217;ini kullanabilmeniz i\u00e7in \u00f6ncelikle System.ComponentModel k\u00fct\u00fcphanesini kod sayfan\u0131za entegre etmeniz gerekmektedir.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    class Banka : INotifyPropertyChanged\r\n    {\r\n        public event PropertyChangedEventHandler PropertyChanged;\r\n\r\n        private double para;\r\n\r\n        public double Para\r\n        {\r\n            get\r\n            {\r\n                return para;\r\n            }\r\n            set\r\n            {\r\n                para = value;\r\n                if (PropertyChanged != null)\r\n                {\r\n                    PropertyChanged(this, new PropertyChangedEventArgs(nameof(Para)));\r\n                }\r\n            }\r\n        }\r\n    }\r\n<\/pre>\n<p>Yukar\u0131daki kod blo\u011funu incelerseniz e\u011fer INotifyPropertyChanged Interface&#8217;i PropertyChangedEventHandler isimli delege tipinden PropertyChanged isimli bir event implement etmektedir. Uygulanan event\u0131 propertynin de\u011feri de\u011fi\u015fti\u011fi noktada f\u0131rlatmaktay\u0131z.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    class Program\r\n    {\r\n        static void Main(string&#x5B;] args)\r\n        {\r\n            Banka banka = new Banka();\r\n            banka.PropertyChanged += Banka_PropertyChanged;\r\n            banka.Para += 100;\r\n\r\n            Console.Read();\r\n        }\r\n\r\n        private static void Banka_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\r\n        {\r\n            Console.WriteLine(&quot;Para eklendi&quot;);\r\n        }\r\n    }\r\n<\/pre>\n<p>G\u00f6rd\u00fc\u011f\u00fcn\u00fcz gibi Para propertysine veri set edildi\u011finde ilgili event tetiklenmekte, dolay\u0131s\u0131yla propertyde veri de\u011fi\u015fikli\u011fi oldu\u011fu zaman bundan event arac\u0131l\u0131\u011f\u0131yla haberdar edilmekteyiz.<\/p>\n<p>Sonraki yaz\u0131lar\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<\/p>\n<p>\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Merhaba, Olu\u015fturdu\u011funuz herhangi bir s\u0131n\u0131fta; propertylerin de\u011fer de\u011fi\u015fikliklerinde veya metodlar\u0131n algoritmalar\u0131nda olay yaratmam\u0131z\u0131 sa\u011flayacak olan INotifyPropertyChanged Interface&#8217;ini tan\u0131taca\u011f\u0131m. Yaz\u0131m\u0131z\u0131 k\u0131sa tutmak i\u00e7in hemen mevzuya giri\u015f yap\u0131yorum. INotifyPropertyChanged Interface&#8217;ini kullanabilmeniz i\u00e7in \u00f6ncelikle System.ComponentModel k\u00fct\u00fcphanesini kod&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":3223,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,338,720],"tags":[62,1105,168,1109,1108,1107],"class_list":["post-4088","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-sharp-c","category-c-5-0","category-c-6-0","tag-event","tag-inotifypropertychanged","tag-interface","tag-propertychanged","tag-propertychangedeventhandler","tag-system-componentmodel"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/4088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=4088"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/4088\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/3223"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=4088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=4088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=4088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}