<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3306400</guid>
        <pubDate>Fri, 26 Apr 2013 15:24:54 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3306400</link>
        <description><![CDATA[maxim84_: Подредактировал ссылки и добавил в <a class='tag-url' href='http://forum.sources.ru/index.php?showtopic=376107&st=0' target='_blank'>FAQ</a>.<br>
Спасибо, за материал.]]></description>
        <author>maxim84_</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305802</guid>
        <pubDate>Thu, 25 Apr 2013 19:23:19 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305802</link>
        <description><![CDATA[maxim84_: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>Я не знаю, как этооформить </div></div><br>
примерно, как я постом выше.]]></description>
        <author>maxim84_</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305793</guid>
        <pubDate>Thu, 25 Apr 2013 18:51:14 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305793</link>
        <description><![CDATA[Koss: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=374934&view=findpost&p=3305590'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>maxim84_ &#064; <time class="tag-quote__quoted-time" datetime="2013-04-25T13:29:24+00:00">25.04.13, 13:29</time></span><div class='quote '><br>
Оформите пост для фака более структурировано и понятно. Сообщение будет удалено через 5 дн.</div></div><br>
ну ссылки три. для тех, кому нужно вааще по простецки объяснить. Я не знаю, как этооформить]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305645</guid>
        <pubDate>Thu, 25 Apr 2013 14:16:34 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305645</link>
        <description><![CDATA[maxim84_: Все забываю вам дать ссылку :( <br>
<br>
вот, посмотрите: <a class='tag-url' href='http://habrahabr.ru/post/176851/' target='_blank'>Руководство разработчика Prism</a> - Хорошо расписано как работать с XAML-base инструментами. Так же расписаны основные приемы, паттерны и архитектурные решения. Прочитать этот материал - лишнем не будет.]]></description>
        <author>maxim84_</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305548</guid>
        <pubDate>Thu, 25 Apr 2013 12:55:48 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305548</link>
        <description><![CDATA[Koss: собственно, выложу ссылки . Тут что-то типа MVVM для дебилов. :)<br>
<br>
<a class='tag-url' href='http://megadarja.blogspot.ru/2010/04/mvvm-wpf.html' target='_blank'>Шпаргалка по MVVM в WPF</a> - В статье рассказывается о основных приемах, используемых при разработке WPF-приложений с использованием MVVM<br>
<a class='tag-url' href='http://gandjustas.blogspot.ru/2009/07/mvvm-1.html' target='_blank'>Паттерн MVVM. Часть 1. </a> - Короткое объяснение прицепов паттера MVVM в WPF-приложениях<br>
<a class='tag-url' href='http://svyatoslavpankratov.blogspot.ru/2011/11/mvvm-pattern-1.html?showComment=1366694619530' target='_blank'>Основы MVVM Pattern’а – часть 1.</a> - В статье продемонстрирован хороший пример WPF-приложения с использованием MVVM. Присутствует ссылка на исходный код примера статьи.<br>
<br>
это надо добавить в faq <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2013-04-25T12:57:03+00:00">25.04.13, 12:57</time></span></span><br>
мне помогло)]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305310</guid>
        <pubDate>Thu, 25 Apr 2013 06:06:47 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305310</link>
        <description><![CDATA[Koss: спасибо, ребята&#33; Вы все волшебники&#33;]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305218</guid>
        <pubDate>Wed, 24 Apr 2013 17:41:09 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3305218</link>
        <description><![CDATA[Koss: в смысле вот таким макаром перереализовавать интерфейс:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp;public void NotifyPropertyChanged&#60;T&#62;(Expression&#60;Func&#60;T&#62;&#62; property)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (PropertyChanged != null)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var memberExpression = property.Body as MemberExpression;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PropertyChanged(this, new PropertyChangedEventArgs(memberExpression.Member.Name));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
?<br>
<br>
чтоб туда делегат можно было сувать?]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304727</guid>
        <pubDate>Tue, 23 Apr 2013 17:55:00 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304727</link>
        <description><![CDATA[Craft: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=374934&view=findpost&p=3304693'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Koss &#064; <time class="tag-quote__quoted-time" datetime="2013-04-23T15:36:26+00:00">23.04.13, 15:36</time></span><div class='quote '>а почему у меня в геттер не заходит? в отладчике даже ловушку ставил.</div></div><br>
Потому что обновленные данные получаются через метаданные <a class='tag-url' href='http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty.getmetadata.aspx' target='_blank'>GetMetadata</a>. Более подробно про то как это работает можно почитать <a class='tag-url' href='http://10rem.net/blog/2010/12/16/strategies-for-improving-inotifypropertychanged-in-wpf-and-silverlight' target='_blank'>здесь</a>. Либо <a class='tag-url' href='http://justinangel.net/AutomagicallyImplementingINotifyPropertyChanged' target='_blank'>источник2</a> на который все ссылаются.]]></description>
        <author>Craft</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304693</guid>
        <pubDate>Tue, 23 Apr 2013 15:36:26 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304693</link>
        <description><![CDATA[Koss: а почему у меня в геттер не заходит? в отладчике даже ловушку ставил.]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304691</guid>
        <pubDate>Tue, 23 Apr 2013 15:23:40 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304691</link>
        <description><![CDATA[Craft: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=374934&view=findpost&p=3304550'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Koss &#064; <time class="tag-quote__quoted-time" datetime="2013-04-23T11:15:34+00:00">23.04.13, 11:15</time></span><div class='quote '>да и ещё вопрос есть.. каким боком тут INotifyPropertyChanged взаимодействует?<br>
я ни к каким событиям не подписывался.<br>
Почему , когда убрать наследование от INotifyPropertyChanged ничего не апдейтится?</div></div><br>
Вот таким<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <span class='tag-quote__quote-info'>MSDN</span><div class='quote '><br>
Для появления уведомления об изменении привязки клиента и источника данных связанный тип должен:<br>
Либо реализовать интерфейс INotifyPropertyChanged (предпочтительный вариант).<br>
Либо обеспечить событие изменения для каждого свойства связанного типа.</div></div>.<br>
Просто для обновления свойста используеться <a class='tag-url' href='http://msdn.microsoft.com/ru-ru/library/system.windows.data.binding.updatesourcetrigger.aspx' target='_blank'>updatesourcetrigger</a>. А почему именно так это работает прочтите об Binding.UpdateSourceTrigger и INotifyPropertyChanged по ссылкам которые вам приводили.]]></description>
        <author>Craft</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304550</guid>
        <pubDate>Tue, 23 Apr 2013 11:15:34 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304550</link>
        <description><![CDATA[Koss: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public string name</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get { return item.name; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;item.name = value;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (value == &quot;0&quot;)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BackColor = Brushes.Green;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OnPropertyChanged(&quot;name&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;private Brush _backcolor;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public Brush BackColor</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return _backcolor;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_backcolor = value;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OnPropertyChanged(&quot;BackColor&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div><br>
а почему не работает типа такого:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public Brush BackColor</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return (name==&quot;0&quot; ? Brushes.Green : Brushes.White);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2013-04-23T11:21:16+00:00">23.04.13, 11:21</time></span></span><br>
да и ещё вопрос есть.. каким боком тут INotifyPropertyChanged взаимодействует?<br>
я ни к каким событиям не подписывался.<br>
Почему , когда убрать наследование от INotifyPropertyChanged ничего не апдейтится?]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304499</guid>
        <pubDate>Tue, 23 Apr 2013 09:21:32 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3304499</link>
        <description><![CDATA[Koss: начал разбираться в этом MVVM<br>
переделал под этот паттерн. Почему не зеленеет?<br>
<span class="b-attach" data-size="30922" data-hits="203" data-attach-id="28875" data-attach-post-id="3304499">
			<span class="b-attach__title"></span><a class='b-attach-link' href='https://forum.sources.ru/index.php?act=Attach&amp;type=post&amp;id=3304499&amp;attach_id=28875' title='Скачать файл' target='_blank'>WpfApplication4.7z</a> (, : 203)
		</span> <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2013-04-23T09:22:50+00:00">23.04.13, 09:22</time></span></span><br>
да.. и почему у меня в текстбоксе можно только первый элемент редактировать?]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302917</guid>
        <pubDate>Fri, 19 Apr 2013 04:53:00 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302917</link>
        <description><![CDATA[Koss: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=374934&view=findpost&p=3302766'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>100500 &#064; <time class="tag-quote__quoted-time" datetime="2013-04-18T13:09:01+00:00">18.04.13, 13:09</time></span><div class='quote '>Так надо новый добавить а не обновить существующий? </div></div><br>
insert, update и Delete. На этом примере я с ВПФ разбираюсь.]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302781</guid>
        <pubDate>Thu, 18 Apr 2013 13:39:37 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302781</link>
        <description><![CDATA[Craft: <strong class='tag-b'>Koss</strong> Еслы вы хотите чтобы данные обновлялись автоматически используйте <a class='tag-url' href='http://msdn.microsoft.com/en-us/library/ms668604.aspx' target='_blank'>ObservableCollection</a> а не List. Если вы добавите в List новый айтем то данные вы не увидете обновленные. Нужно писать как вам писал <strong class='tag-b'>100500</strong> об INotifyPropertyChanged и сделать проперти для List&lt;Item_N&gt; list_n. Тогда данные будут обновлены. Попробуйте использовать MVVM паттерн. И отделите код от логики. Так будет проще сопровождать проэкт. Модель вам уже написали. <br>
ViewModel написать не сложно. Вот мое виденье как можно переписать логику. <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">public class NotifyPropertyChangedBase : INotifyPropertyChanged</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public event PropertyChangedEventHandler PropertyChanged;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public void RaisePropertyChanged(string propertyName)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var propertyChanged = PropertyChanged;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (propertyChanged != null)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;propertyChanged(this, new PropertyChangedEventArgs(propertyName));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">public class Item_N : NotifyPropertyChangedBase</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public int id { get; set; }</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;private Brush _backcolor;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public Brush BackColor</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return _backcolor;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_backcolor = value;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RaisePropertyChanged(&quot;BackColor&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;private string _name;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public string Name</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return this._name;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_name = value;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RaisePropertyChanged(&quot;Name&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (Exception Exception)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;public class Item_NViewModel : NotifyPropertyChangedBase</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;private ObservableCollection&#60;Item_N&#62; _itemsNCollection = new ObservableCollection&#60;Item_N&#62;();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public ObservableCollection&#60;Item_N&#62; ItemsNCollection</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get { return _itemsNCollection; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_itemsNCollection = value;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RaisePropertyChanged(&quot;ItemsNCollection&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;#region Command</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;#endregion</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div></ol></div></div></div></div> И всю логику пишете во ViewModel. Тогда ваш код будет отделен от View.]]></description>
        <author>Craft</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302766</guid>
        <pubDate>Thu, 18 Apr 2013 13:09:01 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302766</link>
        <description><![CDATA[100500: Так надо новый добавить а не обновить существующий?]]></description>
        <author>100500</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302761</guid>
        <pubDate>Thu, 18 Apr 2013 12:57:31 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302761</link>
        <description><![CDATA[Koss: блин.. я неправильно думал..<br>Мне казалось, что public List&lt;Item_N&gt; list_n; должен будет так же изменяться. <br>клацну я там, например на трее в менюшке, &quot;добавить объект&quot;, в обработчике кликания будет что-то вроде:<br>list_n.Add(new Item_N { id = 7, name = &quot;7&quot; });<br>и он появиться и в трейчике.]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302747</guid>
        <pubDate>Thu, 18 Apr 2013 12:33:32 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302747</link>
        <description><![CDATA[100500: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>(Item_N)treeView1.SelectedItem; я смотрел. только возвращает, и всё.</div></div><br>
Возвращает что? <br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">public List&#60;Item_N&#62; list_n;</div></ol></div></div></div></div> Это просто объявление списка с данными которые будут добавляться в группу. Тут ничего не должно меняться]]></description>
        <author>100500</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302741</guid>
        <pubDate>Thu, 18 Apr 2013 12:23:14 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302741</link>
        <description><![CDATA[Koss: а вот тут:<br>
public List&lt;Item_N&gt; list_n;<br>
он поменяется? <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2013-04-18T12:24:07+00:00">18.04.13, 12:24</time></span></span><br>
(Item_N)treeView1.SelectedItem;  я смотрел. только возвращает, и всё.]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302727</guid>
        <pubDate>Thu, 18 Apr 2013 12:07:49 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302727</link>
        <description><![CDATA[100500: Задать для treeViewItem MouseLeftButtonUp и в нём изменить свойство у текущего выбранного элемента. <br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&#60;TreeViewItem Name=&quot;MyGroup&quot; Header=&#39;1111&#39;</div><div class="code_line">ItemsSource=&quot;{Binding list_n}&quot; MouseLeftButtonUp=&quot;MyGroup_MouseLeftButtonUp&quot;&#62;</div></ol></div></div></div></div><br>
<br>
<br>
В коде обработчика:<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;private void MyGroup_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)</div><div class="code_line">&nbsp;{</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;Item_N MySelectedItem = null;</div><div class="code_line">&nbsp;&nbsp;Type CheckType = treeView1.SelectedItem.GetType();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (CheckType.Name == &quot;Item_N&quot;) </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MySelectedItem = (Item_N)treeView1.SelectedItem; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MySelectedItem.Name=&quot;Я элемент&quot;;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">}</div></ol></div></div></div></div><br>
<br>
В самом классе вроде нужно добавить уведомления для изменения свойств для нашего treeView, иначе он не &#39;поймёт&#39; что мы меняем свойства элемента.<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;public class Item_N: INotifyPropertyChanged</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public int id { get; set; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;private string _name;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public string name</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return this._name; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_name = value;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (PropertyChanged != null)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PropertyChanged(this, new PropertyChangedEventArgs(&quot;name&quot;));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (Exception Exception)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public event PropertyChangedEventHandler PropertyChanged; &nbsp;//вот оно</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2013-04-18T12:19:54+00:00">18.04.13, 12:19</time></span></span><br>
А для того чтобы сделать зелёным, можно создать биндинг на свойство background у TextBlock т.е.  <br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&#60;TextBlock Text=&quot;{Binding name}&quot; Background=&quot;{Binding BackColor}&quot;/&#62;</div></ol></div></div></div></div><br>
<br>
в классе:<br>
<br>
<br>
<br>
 <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">public class Item_N: INotifyPropertyChanged</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public int id { get; set; }</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; private Brush _backcolor;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public Brush BackColor</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return _backcolor;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _backcolor = value;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (PropertyChanged != null)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PropertyChanged(this, new PropertyChangedEventArgs(&quot;BackColor&quot;));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;private string _name;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public string name</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return this._name; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_name = value;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (PropertyChanged != null)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PropertyChanged(this, new PropertyChangedEventArgs(&quot;name&quot;));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (Exception Exception)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public event PropertyChangedEventHandler PropertyChanged; &nbsp;//вот оно</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div></ol></div></div></div></div><br>
<br>
задаём: <br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">if(MySelectedItem.Name == &quot;0&quot;)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; MySelectedItem.BackColor = (Brush)new BrushConverter().ConvertFromString(&quot;Green&quot;);</div><div class="code_line">}</div></ol></div></div></div></div>]]></description>
        <author>100500</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302692</guid>
        <pubDate>Thu, 18 Apr 2013 11:11:42 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3302692</link>
        <description><![CDATA[Koss: никто не знает? <br>можно упростить. Есть трей, с заданным айтем сорсом. <br>как при щелчке на текущий айтем сделать что-нибудь с привязанным объектом?]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3298034</guid>
        <pubDate>Sun, 07 Apr 2013 13:40:40 +0000</pubDate>
        <title>update данных</title>
        <link>https://forum.sources.ru/index.php?showtopic=374934&amp;view=findpost&amp;p=3298034</link>
        <description><![CDATA[Koss: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&#60;Window x:Class=&quot;WpfApplication4.MainWindow&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Title=&quot;MainWindow&quot; Height=&quot;350&quot; Width=&quot;525&quot;&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;Grid&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#60;TreeView Height=&quot;311&quot; HorizontalAlignment=&quot;Left&quot; Name=&quot;treeView1&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;503&quot; &#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#60;TreeViewItem Header=&#39;1111&#39;</div><div class="code_line">ItemsSource=&quot;{Binding list_n}&quot;&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#60;TreeViewItem.ItemTemplate&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#60;DataTemplate&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#60;StackPanel Orientation=&quot;Horizontal&quot;&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#60;TextBlock Text=&quot;{Binding name}&quot;/&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#60;/StackPanel&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#60;/DataTemplate&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#60;/TreeViewItem.ItemTemplate&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#60;/TreeViewItem&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#60;/TreeView&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;/Grid&#62;</div><div class="code_line">&#60;/Window&#62;</div></ol></div></div></div></div><br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">namespace WpfApplication4</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;/// &#60;summary&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp;/// Логика взаимодействия для MainWindow.xaml</div><div class="code_line">&nbsp;&nbsp; &nbsp;/// &#60;/summary&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp;public partial class MainWindow : Window</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public List&#60;Item_N&#62; list_n; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public MainWindow()</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InitializeComponent();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InitializeComponent();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_n = new List&#60;Item_N&#62;();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_n.Add(new Item_N { id = 1, name = &quot;1&quot; });</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_n.Add(new Item_N { id = 2, name = &quot;2&quot; });</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_n.Add(new Item_N { id = 3, name = &quot;3&quot; });</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_n.Add(new Item_N { id = 4, name = &quot;4&quot; });</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_n.Add(new Item_N { id = 5, name = &quot;5&quot; });</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_n.Add(new Item_N { id = 6, name = &quot;6&quot; });</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataContext = new { list_n };</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;public class Item_N</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public int id { get; set; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public string name { get; set; }</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">}</div></ol></div></div></div></div><br>
такой значит, код есть. <br>
Как можно при щелчке на элементе трея обновить привязанное поле name , и сделать его 0, и как сделать чтобы если name равно &quot;0&quot; - сделать айтем, например зелёным ?<br>
<span class="b-attach" data-size="23186" data-hits="229" data-attach-id="28504" data-attach-post-id="3298034">
			<span class="b-attach__title"></span><a class='b-attach-link' href='https://forum.sources.ru/index.php?act=Attach&amp;type=post&amp;id=3298034&amp;attach_id=28504' title='Скачать файл' target='_blank'>WpfApplication4.7z</a> (, : 229)
		</span>]]></description>
        <author>Koss</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	